Question: Problems listcontplot /function when n=infinity

Hello Maple experts,

I have some problems.  I can show a plot of f1, after assuming  n= 200 [Here x and y are positives and less than 1]

 

> f1 :=  (x, y,n) -> add(add(  `if` (.5 <= x+j*y+(1/n-(1/n)*x-(1/n)*y)*k and j*y+(1/n-(1/n)*x-(1/n)*y)*k < .5 , (1/(n+1)*(n+2))* factorial(k+j) *  factorial(n+1-j-k)/(factorial(k)*factorial(n-k)), 0), k = 0 .. n), j = 0 .. 1) :

> with(plots);

> listcontplot([seq([seq(f1((1/100)*x, (1/100)*y,200), x = 1 .. 50)], y = 1 .. 50)], axes = normal, levels = 6);

 

Until here, everything is OK.

 

HOWEVER, I want 

1) to define well the function f (called f2, see below) in the case n = infinity (in the way I can plot and take some derivatives)

2) to plot in the plane (x,y)  (x=0..3/4  and y = 0..3/4)

3) to compute diff (f2, x)  and  dx/dy (under n=infinity, f2 becomes a smooth function (almost everywhere) of x and y [I did it by hand]

and I CANNOT.

 

I did try

> f2 :=  (x, y) -> limit( add(add(  `if` (.5 <= x+j*y+(1/n-(1/n)*x-(1/n)*y)*k and j*y+(1/n-(1/n)*x-(1/n)*y)*k < .5 , (1/(n+1)*(n+2))* factorial(k+j) *  factorial(n+1-j-k)/(factorial(k)*factorial(n-k)), 0), k = 0 .. n), j = 0 .. 1), n=infinity) :

(until now, no complain of Maple).. but

> listcontplot([seq([seq(f2((1/100)*x, (1/100)*y), x = 1 .. 75)], y = 1 .. 75)], axes = normal, levels = 6);

ERROR===> Error, (in f2) unable to execute add

And of course, apparently I cannot take derivatives that makes sense.

 

How can I achieve 1-3?

 

Thanks in advance for the help,

 

Jean-Jacques

Please Wait...