## 140 Reputation

14 years, 218 days

## Is well defined this "recursive" functio...

Maple 17

Hi!

Let F(z) (with z complex) a given function. I want to compute F^n(z0), i.e. the composition of F with itself n-times, where z0 is a given point (complex).

Is correct the following procedure to compute F^k(z0)?

App := proc (k, z0) local z1, z2, j; z1 := z0; z2 := NULL; for j to k do z2 := F(z1); z1 := z2 end do; return z2 end proc

## Plot3d: How do I can draw a polynomial a...

Maple 17

Hi!

I want to plot the approximation of a surface by polynomials. The surface is given by (x,y,f(x,y)) where f(x,y) is given by the following expression

proc (x) options operator, arrow; (sum(i*cos((i+1)*(-2+4*x[1])+i), i = 1 .. 5))*(sum(i*cos((i+1)*(-2+4*x[2])+i), i = 1 .. 5)) end proc

with both variables varying in the interval [0,1]. Then, by using the Bernstein polynomials of two variables (see, for instance, this paper for details  https://www.sciencedirect.com/science/article/pii/0021904589900956), the graph of the resulting (plot3d) surface (x,y,p(x,y))  it is not even like to the original surfaces.

Please, see this PDF of what I have done:  plots.pdf

Some idea or suggestion?

Thanks!

## Get the "union" of a list of "intervals"...

Maple 17

Hello,

Assume we have the following "intervals" (I am not sure what is its formal name in Maple)

C :=[0,1/11],[1/11,1/9],[1/9, 1/7],[1/3,1/2],[1/2,1]

How can we get the "union" of these intervals? That is to say, obtain  [0,1/7],[1/3,1]

## Choose a number according to a probabili...

Maple 17

Hello!

Assume we have the first N positive integres, 1,..,N, and we assing to these numbers a (discrete) probability distribution p1,...,pN. Of course, p1+...+pN=1.

Then, How can we select a number in {1,..,N} according to the given probability distribution? That is, the number 1 can be chosen with probability p1, 2 with a probability p2, etc.

## Plotting the free space diagram (Fréchet...

Maple 2017

Hello!

I am interested in plot the so-called "free space diagram", please see https://en.wikipedia.org/wiki/Fr%C3%A9chet_distance for a formal definition. Essentially, given two curves (i.e., two polygonal from [0,1] to the plane) the "free space" is the points (s,t) in the square [0,1]x[0,1] such that the distance from P(s) to Q(t) (if P and Q are the parametrizations of the curves) is less or equal than a prefixed epsilon>0. An image can be the following (the free space is, in the image, the area not colored in black):