vv

7354 Reputation

18 Badges

4 years, 256 days

MaplePrimes Activity


These are replies submitted by vv

@DanishMapleFan 

For this linear equation isolve gives a parametric solution. Use:

restart;
iS:=isolve({169 = 10*x + 3*y});
S:=solve({%[],x>=1,y>=1})[];
seq( iS, _Z1 = ceil(lhs(S[-2])) .. floor(rhs(S[-1])) );

 

@Sam2231 
A short procedure for this.

PSubs:=proc(eq::`=`, e)
local f;
uses Physics;
f:=proc(e)
  local i,j;
  for i to nops(e) do for j from i to nops(e) do
    if is(`*`(op(i..j,e)) = lhs(eq)) then return `*`(op(1..i-1,e), rhs(eq), op(j+1..-1,e)) fi
  od od;
  e
end:
subsindets(e, `*`, f)
end:

with(Physics):
Setup(op = {A, B, S, omega, v, x, x_, `ω_`}):
ex:=(((Iota[c][i]*Dagger(diff(x[i](t), t))) . (Dagger(A[i]))) . (A[i])) . (diff(x[i](t), t))/L[i](t)^2;
PSubs( Dagger(A[i]) . (A[i]) = -A[i]^2, ex );

 

@acer 

Yes, I see. On the other hand, using seq(a, ...) when a is local does not make much sense, a having only 1 level evaluation.

 

@Carl Love 

This seems to be equivalent to seq (simple form only).

SEQ:=proc(e::uneval, eq::uneval)
   local j, jold:=eval(lhs(eq)), S:=NULL;
   assign(lhs(eq),j);
   for j from lhs(rhs(eq)) to rhs(rhs(eq)) do S:=S,eval(e) od;
   assign(lhs(eq),jold);
   S;
end:

a:=i^2: i:=10:  
seq(a, i=1..3); i;
                            1, 4, 9
                               10
SEQ(a, i=1..3); i;
                            1, 4, 9
                               10

 

@Axel Vogt 

It seems that the following well known fact applies: Statisticians can prove almost anything.

@Carl Love 

Your heuristic test looks OK to me (but I am not a statistician :-)).

@Carl Love 

I think you used a heuristic approach. In the cited paper the computed probabilities are Prob(there are j runs of length i), but only for i=1,2,3. For i>3 (the most interesting for our case)  the probabilities are considered too hard to compute.

(Actually in the paper are constructed 3 tests, for each i=1,2,3).

I don't know what P(run length = k)  means; in general a string has several runs. [BTW, the expected number of runs is (n+1)/2].

 

 

@Carl Love 

I see that you have not used the exact probabilities for runs of lengths 1,2,... (from the cited paper) but the approximations seem to be good enough for a simple statistical test.

The OP's expression is in the title (!) 

@mmcdara 

I don't see any contradiction. A good PRNG (pseudorandom number generator) exists of course (in my opinion) in Maple. The question was about the existence of a statistical test in Maple able to discriminate the two lists.  

@Carl Love 

Thanks. I was hoping that one of the general Statistics' tests can be used (more or less directly) to answer the question.
After all, the problem does not seem to be very special. Probably using run lengths the two sequences can be discriminated indeed.

@janhardo 

If you need help, you should post worksheets like this:


 

 

f := x -> x^sin(x);

proc (x) options operator, arrow; x^sin(x) end proc

(1)

g := x -> x^cos(x);

proc (x) options operator, arrow; x^cos(x) end proc

(2)

plot( [f,g], 1..15, color=[red,blue]);

 

# area=?, please help.


Download 02xxx.mw

@ecterrab 

I don't quite understand about one and only one syntax:

In 1D input:  3!=6;    ==>  6 = 6
In 2D input:  3!=6;    ==>  3 <> 6

It's true that in 2D,  3!  =6;    ==>  6 = 6
but isn't this about syntax?

@janhardo 

If you apply what tomleslie said, you have nothing to learn, because Worksheet Mode + 1D-input is almost the same as Classic Maple (actually Classic Maple also had & has a 2D input). The disadvantage of the modern Worksheet Mode is that it starts slower and uses much more memory -- due to Java; but it's more flexible.

@Preben Alsholm 

restart;
local gamma;
beta:=1/6; gamma:=1; delta:=13/6;  # special case
 

gamma

 

1/6

 

1

 

13/6

(1)

##The system in the pdf-file. Right hand sides:
RHS:=[x*(1-x)-x*y,y*(delta-beta*y/x)-alpha*y/(gamma+y)];
ROsol:=solve(RHS=~0,{x,y});
RO:=op(indets(ROsol[2],specfunc(RootOf)));
E:=subs(ROsol[2],[x,y]);
 

[x*(1-x)-x*y, y*(13/6-(1/6)*y/x)-alpha*y/(1+y)]

 

{x = 1, y = 0}, {x = 1-RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13), y = RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13)}

 

RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13)

 

[1-RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13), RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13)]

(2)

x2y2,x3y3:=allvalues(E);

[29/28-(3/14)*alpha-(1/28)*(36*alpha^2-348*alpha+729)^(1/2), (3/14)*alpha-1/28+(1/28)*(36*alpha^2-348*alpha+729)^(1/2)], [29/28-(3/14)*alpha+(1/28)*(36*alpha^2-348*alpha+729)^(1/2), (3/14)*alpha-1/28-(1/28)*(36*alpha^2-348*alpha+729)^(1/2)]

(3)

da:=diff(E,alpha);
dxa,dya:=op(subs(RO=y,y=1-x,da));
J:=VectorCalculus:-Jacobian(RHS,[x,y]);
TR:=LinearAlgebra:-Trace(J);
 

da := [-(6*RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13)-6)/(28*RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13)-6*alpha+1), (6*RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13)-6)/(28*RootOf(14*_Z^2+(-6*alpha+1)*_Z+6*alpha-13)-6*alpha+1)]

 

dxa, dya := 6*x/(29-28*x-6*alpha), -6*x/(29-28*x-6*alpha)

 

Matrix(%id = 18446744074364419718)

 

19/6-2*x-y-(1/3)*y/x-alpha/(1+y)+alpha*y/(1+y)^2

(4)

TR0:=simplify(eval(TR, [x,y]=~x2y2));

(1/7)*((432*alpha^3+288*alpha^2-5508*alpha+1692)*(36*alpha^2-348*alpha+729)^(1/2)+2592*alpha^4-10800*alpha^3-45432*alpha^2+147708*alpha+45684)/((-29+6*alpha+(36*alpha^2-348*alpha+729)^(1/2))*(27+6*alpha+(36*alpha^2-348*alpha+729)^(1/2))^2)

(5)

alpha0:=solve(TR0); evalf(%);

-1/2+2*3^(1/2)

 

2.964101616

(6)

simplify(eval(diff(TR0,alpha), alpha=alpha0));

3/4

(7)

subs(x=x2y2[1], alpha=alpha0,  gamma*( (beta+delta)*x - beta )^2 / (alpha*x)^2):  
simplify(%); # the "obvious" fact: 3/4 <> 1/3

1/3

(8)

 

1 2 3 4 5 6 7 Last Page 1 of 129