vv

13805 Reputation

20 Badges

9 years, 308 days

MaplePrimes Activity


These are replies submitted by vv

This seems to be a "try to guess what I mean" challenge.

@Carl Love  Warning: modp(a,b) = irem(a,b)  only for a>=0. Also, `mod` could be mods.
 

@mclaine The assumptions are important but unfortunately Maple is far from perfect here.
Note first that
simplify(f__1 - f __2, symbolic);
returns 0, but then you will have to decide in what conditions the equality is actually true.

The equality holds when lambda__g * a > 0, even when lambda__g and a  are complex, but Maple is not able to simplify to 0, not even:

combine(simplify(f__1 - f__2)) assuming lambda__g * a>0;
 

 

@one man  The method skips zeros too. Using the zer function I have provided, 
zer(3614)=106.546511887030462;
zer(3682)=107.544351296277895;
so, 68 zeros are missing!

I have a procedure that can find all of them, the first stage being to isolate the zeros. After that, fsolve can be invoked.
 

 

@mmcdara It is an interesting workaround. Unfortunately it has limited efficiency. Yesterday when I tried to find all the zeros using NextZero with adjusted options, I managed to find the first 117 (I think, probably not a coincidence)  zeros, but not beyond (up to 154 as in OP's question). I needed higher precision for this. Your approach has the same problem (just try 120 instead of 100). Also, for Digits:=15, it does not run.
My conclusion is that NextZero must be revised to cover such examples.

@mmcdara I the last example, setting Digits:=15 is enough to work.
For OP's example I could not find any setting!

@mmcdara Note first that the function takes obviously negative values but on short intervals.
The f__eps does not help. Actually for Digits=10 many roots are skipped!
Please compare with the exact roots:

restart: 
Digits := 10:
zer:= k -> evalf(sqrt((-1)^(k+1)*arcsin(10000/10001)+k*Pi)):
f      := proc (x) options operator, arrow; x*(1+1.0001*sin(x^2)) end proc:
eps    := 1:
f__eps := proc (x) options operator, arrow; x*(1+1.0001*sin(x^2))-eps end proc:

sol := NULL:
s := 1.0:
s := RootFinding:-NextZero(f, s): 
sol := sol, s:
printf("%3d  %2.8f\n", 1, s):
for j from 2 to 100 do 
  s__eps := RootFinding:-NextZero(f__eps, s): 
  s := RootFinding:-NextZero(f, s__eps): 
  sol := sol, s:
  printf("%3d  %2.8f  exact=%2.8f\n", j, s, zer(j)):
end do:

  2  3.31382449  exact=2.17405854
  3  4.15507136  exact=3.31382449
  4  4.85260789  exact=3.31808918
  5  5.46177523  exact=4.15507136
  6  6.00950696  exact=4.15847342
  7  6.51132546  exact=4.85260789
  8  6.97714444  exact=4.85552123
  9  7.41375275  exact=5.46177523
 10  7.82604084  exact=5.46436380
 11  8.21767002  exact=6.00950697
 12  8.59146587  exact=6.01185970
 13  8.94966318  exact=6.51132546
 14  9.29406566  exact=6.51349694
 15  9.62615405  exact=6.97714444
 16  9.94716176  exact=6.97917099
 17  10.25812908  exact=7.41375275
 18  10.55994307  exact=7.41565998
 19  10.85336735  exact=7.82604084
 20  11.13906496  exact=7.82784762
 21  11.41761593  exact=8.21767002
 22  11.68953116  exact=8.21939071
 23  11.95526345  exact=8.59146587
 24  12.21521630  exact=8.59311171
 25  12.46975119  exact=8.94966318
 26  12.71919337  exact=8.95124317
 27  12.96383683  exact=9.29406566
 28  13.20394830  exact=9.29558710
 29  13.43977068  exact=9.62615405
 30  13.67152593  exact=9.62762301
 31  13.89941749  exact=9.94716176
 32  14.12363239  exact=9.94858332
 33  14.34434304  exact=10.25812909
 34  14.56170877  exact=10.25950756
 35  14.77587722  exact=10.55994307
 36  14.98698546  exact=10.56128215
 37  15.19516102  exact=10.85336736
 38  15.40052284  exact=10.85467024
 39  15.60318201  exact=11.13906497
 40  15.80324252  exact=11.14033444
 41  16.00080184  exact=11.41761593
 42  16.19595150  exact=11.41885444
 43  16.38877757  exact=11.68953117
 44  16.57936113  exact=11.69074087
 45  16.76777865  exact=11.95526345
 46  16.95410234  exact=11.95644627
 47  17.13840049  exact=12.21521631
 48  17.32073776  exact=12.21637395
 49  17.50117545  exact=12.46975119
 50  17.67977170  exact=12.47088521
 51  17.85658177  exact=12.71919338
 52  18.03165821  exact=12.72030515
 53  18.20505104  exact=12.96383684
 54  18.37680790  exact=12.96492763
 55  18.54697425  exact=13.20394830
 56  18.71559348  exact=13.20501927
 57  18.88270702  exact=13.43977069
 58  19.04835452  exact=13.44082286
 59  19.21257388  exact=13.67152594
 60  19.37540142  exact=13.67256027
 61  19.53687195  exact=13.89941749
 62  19.69701883  exact=13.90043487
 63  19.85587410  exact=14.12363239
 64  20.01346850  exact=14.12463363
 65  20.16983160  exact=14.34434304
 66  20.32499181  exact=14.34532887
 67  20.47897648  exact=14.56170878
 68  20.63181191  exact=14.56267989
 69  20.78352348  exact=14.77587723
 70  20.93413560  exact=14.77683427
 71  21.08367185  exact=14.98698546
 72  21.23215495  exact=14.98792902
 73  21.37960686  exact=15.19516102
 74  21.52604875  exact=15.19609166
 75  21.67150110  exact=15.40052284
 76  21.81598371  exact=15.40144107
 77  21.95951572  exact=15.60318202
 78  22.10211564  exact=15.60408832
 79  22.24380141  exact=15.80324253
 80  22.38459038  exact=15.80413735
 81  22.52449937  exact=16.00080185
 82  22.66354467  exact=16.00168562
 83  22.80174209  exact=16.19595150
 84  22.93910695  exact=16.19682463
 85  23.07565412  exact=16.38877757
 86  23.21139803  exact=16.38964043
 87  23.34635268  exact=16.57936114
 88  23.48053170  exact=16.58021408
 89  23.61394830  exact=16.76777865
 90  23.74661533  exact=16.76862201
 91  23.87854528  exact=16.95410234
 92  24.00975031  exact=16.95493643
 93  24.14024224  exact=17.13840050
 94  24.27003257  exact=17.13922562
 95  24.39913249  exact=17.32073777
 96  24.52755290  exact=17.32155420
 97  24.65530443  exact=17.50117545
 98  24.78239742  exact=17.50198347
 99  24.90884195  exact=17.67977170
100  25.03464784  exact=17.68057156
 

@Carl Love I am not so sure that an implementation with objects would make a big difference without a massive redesign.
If X1,X2 are RVs, a PDF of f(X1,X2) is always problematic, the resulting integral could be very hard do compute, even numerically. After all, what we have here is just a bug, probably very easy to fix, but hard to find without the source.

Nice example, vote up!
NextZero has the parameters guardDigits, maxdistance, initialDigits
but is is very hard to guess a successfull combination. In other cases it works.
It is sad that such simple examples exist!
 

So, for the first F, you have the equations

F(a, b) + a = F(a, b + 1),  F(a, b) = F(a*(a + 1)/2, 2),  a,b in N.

The general solution for the first equation is:

F (a, b)  =  f(a) + a*b

where f is a function of a single variable. Plugging in the second one ==>

f(a*(a + 1)/2) + a*(a + 1) - f(a) - a*b = 0

But this is obviously impossible for arbitrary a,b in N, so, F does not exist.

The same for the second F.

@Mikhail Drugov The package is not bad. This function seems to be not very often used with custom RVs.

To report a bug, check the menu  More ... > Submit Software Change Request

@AmirHosein Sadeghimanesh  All errors obtained during the type checking are not very informative; they simply say that the type is not expected.
solve( [x-[2*y]=3] );
Error, (in unknown) invalid input: Utilities:-SetEquations expects its 2nd argument, equations, to be of type set({boolean, algebraic, relation}), but received {[0]}
 

@ComputerUser  Try to formulate the problem in math terms. Don't use Maple or Excel in this formulation.

@ik74 Impossible, unless you change A itself.

@ComputerUser  F^(-1) is probably the inverse (if it exists) of F : N^2 --> N,
but then  F^(-1) ( F(n,n+1), 2 )  is nonsense.

First 30 31 32 33 34 35 36 Last Page 32 of 176