Gonzalo Garcia

85 Reputation

5 Badges

12 years, 230 days

MaplePrimes Activity


These are questions asked by

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] 

 

Many thanks in advance for your comments and suggestions.

 

 

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.

Many thanks in advance for your comments.

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):

 

 

I have found nothing about this topic in Maple, any suggestion will be welcome!

 

Thanks!

 

Dears,

Realted to this post I am trying to solve the following inequalities in the variable "t"

 

 

 

Cosenos := proc (m, x) local C, x1, x2, y, x0, i, j, j0, k, K0, Kaux, K1, L, R, S, t1, t2, t, r1, r2, d; C := NULL; K0 := NULL; Kaux := NULL; K1 := NULL; L := NULL; R := NULL; S := NULL; d := nops(x); for k to d-1 do if evalf(x[k]) = 1 then j0 := m else j0 := 1+floor(x[k]*m) end if; K0 := K0, [(j0-1)/m, j0/m] end do; K0 := [K0]; S := K0[1][1] <= t, t <= K0[1][2]; for k from 2 to d-1 do S := S, K0[k][1] <= 1/2-(1/2)*cos(Pi*m^(k-1)*t), 1/2-(1/2)*cos(Pi*m^(k-1)*t) <= K0[k][2] end do; K1 := solve({S}, t) end proc

 

However, this run very very slow....For instance, for Cosenos(50, [.3225, .25877, .325, 1])

 

we interrupt the opertion after more than 10 minutes...I am doing something wrong?

Many thanks for your comments and suggestions. 

 

 

 

Hi!

Consider, fixed an integer m>1, the mapping given by the following procedure:

 

G := proc (t) local k, C; C := NULL; C := t; for k from 2 to d do C := C, 1/2-(1/2)*cos(Pi*m^(k-1)*t) end do; return [C] end proc

Then, it can be proved that given x in the cube [0,1]^{d} there is t in [0,1] such that the norm of x-G(t) is less, or equal, than sqrt(d-1)/m. Indeed, dividing the cube [0,1]^{d} into m^{d-1} subcubes of side-length 1/m x ... x 1/m x 1, the point x belongs to some of these subcubes, say J. As, by the properties of the cosines function, the curve G(t) lies in J whenever t in certain subinterval of [0,1], the result follows.

In other words, computing all the solutions of the equation

1/2*(1-cos(Pi*m^(d-1)*t)) = x[d], (j-1)/m <= t and t <= j/m

for some of these solutions the desired t is obtained, where j is such that x1 in [(j-1)/m,j/m] (x1 is the first coordinate of the point x). However, for large values of m and d, the above equation have many solutions, I have tried find all of them and the process is extremely slow....Other way to find such a t can be the following: find a t satisfying the following system of inequalities

EQ := abs(t-x[1]) <= 1/m; for k from 2 to d do EQ := EQ, abs(1/2*(1-cos(Pi*m^(k-1)*t))-x[k]) <= 1/m end do

 

and then, a solution of this system is a such t. I do not know how to find, efficiently, a t such that of x-G(t) is less, or equal, than sqrt(d-1)/m   :(

Some idea?

Many thanks for your comments in advance.

 

1 2 3 4 5 Page 2 of 5