acer

32328 Reputation

29 Badges

19 years, 318 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Usually, if it can be plotted numerically then it can also be maximized numerically as well, to get better accuracy. If the plot is successful, then it's quite likely that some form can be optimized as well.

As pointed out, there is some problem with unevaluated summations inside the objective expression, due to innappropriate recognition of the dummy index as if it were an independent variable. That bug may well affect products and limits as well.

If one knows that the general summation call will result in an unevaluated summation expression, then one may instead supply the objective to Maximize in operator form (so as to allow it to be computed using evalf@Sum).

> g:= x -> x*Sum(i^(-5/2)*exp(-i*x),i=1..infinity):

> Optimization:-Maximize(g,0..2);
                [0.397154744381517988, [0.915476581931277900]]

In any event, the OP asked for a solution using the plot, and that is what Robert replied with. Seems perfectly sensible to me.

acer

No, that's not true.

The OP did not specify whether the sequence should be split starting from the left or the right. It may have been what he meant (left to right, starting with most significant digits) or it may not. He really didn't say. His example was a multiple of 3 in length, so splitting by groups of 3 digits looks the same starting from either direction.

Even if the OP further clarifies, the original post still lacks the information about direction. In that absence, it's not true to say that either direction is incorrect.

I gave two methods. One works from left to right, and the other from right to left. (They also reverse the order of the results, but that's irrelevant since ListTools:-Reverse is easy to do.)

> f(1234567890);
                              [123, 456, 789, 0]

ListTools:-Reverse(g(1234567890));
                              [1, 234, 567, 890]

acer

No, that's not true.

The OP did not specify whether the sequence should be split starting from the left or the right. It may have been what he meant (left to right, starting with most significant digits) or it may not. He really didn't say. His example was a multiple of 3 in length, so splitting by groups of 3 digits looks the same starting from either direction.

Even if the OP further clarifies, the original post still lacks the information about direction. In that absence, it's not true to say that either direction is incorrect.

I gave two methods. One works from left to right, and the other from right to left. (They also reverse the order of the results, but that's irrelevant since ListTools:-Reverse is easy to do.)

> f(1234567890);
                              [123, 456, 789, 0]

ListTools:-Reverse(g(1234567890));
                              [1, 234, 567, 890]

acer

I can never tell whether members who post questions in the Student forums are trying to learn some quick way (single routine call, say) or are hoping to figure out "how it works". Hopefully they get good coverage of both here, in general.

acer

I can never tell whether members who post questions in the Student forums are trying to learn some quick way (single routine call, say) or are hoping to figure out "how it works". Hopefully they get good coverage of both here, in general.

acer

It really should be possible to change Maple's Standard GUI so that it will compress/decompress worksheets on the fly.

If this is already being done for ebooks then that serves as proof of concept. But even if on-the-fly compression/decompressiom has to be implemented technically differently for regular worksheets than for ebooks, it should still be possible.

acer

It really should be possible to change Maple's Standard GUI so that it will compress/decompress worksheets on the fly.

If this is already being done for ebooks then that serves as proof of concept. But even if on-the-fly compression/decompressiom has to be implemented technically differently for regular worksheets than for ebooks, it should still be possible.

acer

Is the problem that the contents of the Array are not right, or that it gives a Warning, or that you cannot see the contents?

Ie, did you try it after,

interface(rtablesize=100):

The numeric output seems fine for me in both 32bit and 64bit Linux, with no Warning, with 12.01.

acer

Is the problem that the contents of the Array are not right, or that it gives a Warning, or that you cannot see the contents?

Ie, did you try it after,

interface(rtablesize=100):

The numeric output seems fine for me in both 32bit and 64bit Linux, with no Warning, with 12.01.

acer

If you click on the user's handle (appearing underneath the title of the post) then it takes you to that user's profile-page. I see an entry (on that page, not in the sidebar, if I am logged in) named "Write private message" under the heading "Private messages".

acer

convert(...,`+`) is an old technique. I am not 100% sure, but I suspect that it may predate add.

acer

convert(...,`+`) is an old technique. I am not 100% sure, but I suspect that it may predate add.

acer

>for i from 1 to 5 do
>   x := 5*i^2+2*i-2;
>   if x=22 then
>     next;
>   end if;
>   print(x);
> end do:
                        5

                        49

                        86

                        133

Maple also has a goto, but in your example it looked like what you were after was actually next. (I could be wrong in that guess -- it really wasn't clear. x never equals 20, using that formula with x from 1 to 100. And if say it did then is the posted code supposed to simply skip to the next i, or to loop indefinitely?)

acer

>for i from 1 to 5 do
>   x := 5*i^2+2*i-2;
>   if x=22 then
>     next;
>   end if;
>   print(x);
> end do:
                        5

                        49

                        86

                        133

Maple also has a goto, but in your example it looked like what you were after was actually next. (I could be wrong in that guess -- it really wasn't clear. x never equals 20, using that formula with x from 1 to 100. And if say it did then is the posted code supposed to simply skip to the next i, or to loop indefinitely?)

acer

Ok, it's Friday evening, and time to relax with a little coding. I think that something can be done here using StringTools:-HammingDistance, random permutations of the (usual) most frequent English letters, some fixed-length wordlists, a mix of frequency analysis and a little early deduction (eg, recognition of apostrophe-s and single-letter "a", etc).

acer

First 515 516 517 518 519 520 521 Last Page 517 of 591