MrMarc

3163 Reputation

18 Badges

17 years, 137 days

MaplePrimes Activity


These are replies submitted by MrMarc

I did not mean to rain on your parade. It just that the code did not work for me. 
When I added DocumentTools:-Do(%Plot0 = f()) then the code started to work
so I thought I might point that out so other people (if they had with similar problems)
easily could get your code to work. I have Maple 13.02 by the way

You cant have the same number of data points if you use a moving average:
                              
restart:
with(plots):
with(Statistics):

a := [[1, 1], [3, 2], [3.5, 4], [4, 6], [5, 5], [6, 7], [7, 6], [8, 5], [9, 5.5], [10, 4], [11, 1], [12, -5], [11.5, -6], [12, -12], [10, -1], [8, -14], [7, -10], [3, -10], [2, -5], [1, -8], [0, 0], [1, 1]]:

b := [seq(op(1, op(i, a)), i = 1 .. nops(a))]:
bb := MovingAverage(b, 2):
nops(a);
nops(bb);

                                     22
                                     21
 

restart:
with(plots):
with(Statistics):

a := [[1, 1], [3, 2], [3.5, 4], [4, 6], [5, 5], [6, 7], [7, 6], [8, 5], [9, 5.5], [10, 4], [11, 1], [12, -5], [11.5, -6], [12, -12], [10, -1], [8, -14], [7, -10], [3, -10], [2, -5], [1, -8], [0, 0], [1, 1]]:

b := [seq(op(1, op(i, a)), i = 1 .. nops(a))]:
bb := MovingAverage(b, 10):
nops(a);
nops(bb);

                                     22
                                     13

You cant have the same number of data points if you use a moving average:
                              
restart:
with(plots):
with(Statistics):

a := [[1, 1], [3, 2], [3.5, 4], [4, 6], [5, 5], [6, 7], [7, 6], [8, 5], [9, 5.5], [10, 4], [11, 1], [12, -5], [11.5, -6], [12, -12], [10, -1], [8, -14], [7, -10], [3, -10], [2, -5], [1, -8], [0, 0], [1, 1]]:

b := [seq(op(1, op(i, a)), i = 1 .. nops(a))]:
bb := MovingAverage(b, 2):
nops(a);
nops(bb);

                                     22
                                     21
 

restart:
with(plots):
with(Statistics):

a := [[1, 1], [3, 2], [3.5, 4], [4, 6], [5, 5], [6, 7], [7, 6], [8, 5], [9, 5.5], [10, 4], [11, 1], [12, -5], [11.5, -6], [12, -12], [10, -1], [8, -14], [7, -10], [3, -10], [2, -5], [1, -8], [0, 0], [1, 1]]:

b := [seq(op(1, op(i, a)), i = 1 .. nops(a))]:
bb := MovingAverage(b, 10):
nops(a);
nops(bb);

                                     22
                                     13

I had never reflected on that previously ...hummm... pretty cool :-)

restart:
r1 := 0.2:      r2 := 0.3:
X1 := exp(r1*t):   X2 := exp(r2*t):
AV := (X1+X2)*(1/2):
plot([X1, X2, AV], t = 0 .. 25, color = [blue, green, red], legend = [typeset("r1= ", r1), typeset("r2= ", r2), "Average"]);

plot([exp(0.2*t), exp(0.3*t), (exp(0.2*t)+exp(0.3*t))*(1/2)], t = 0 .. 25, color = [blue, green, red], legend = [typeset("r1= ", 0.2), typeset("r2= ", 0.3), "Average"])

I had never reflected on that previously ...hummm... pretty cool :-)

restart:
r1 := 0.2:      r2 := 0.3:
X1 := exp(r1*t):   X2 := exp(r2*t):
AV := (X1+X2)*(1/2):
plot([X1, X2, AV], t = 0 .. 25, color = [blue, green, red], legend = [typeset("r1= ", r1), typeset("r2= ", r2), "Average"]);

plot([exp(0.2*t), exp(0.3*t), (exp(0.2*t)+exp(0.3*t))*(1/2)], t = 0 .. 25, color = [blue, green, red], legend = [typeset("r1= ", 0.2), typeset("r2= ", 0.3), "Average"])

All right I think I got it diff(Avg,t)/Avg is the percentage change in the average growth rate.
I just got a bit confused in relation to all other complexity.

Doug, so if we assume that we are taking about an arithmetic average then you agree with
the statement : "the average of exponential growth rates has the same growth rate as the maximum"

Does there exist any simple and clear way that we can show this in a plot ?!

All right I think I got it diff(Avg,t)/Avg is the percentage change in the average growth rate.
I just got a bit confused in relation to all other complexity.

Doug, so if we assume that we are taking about an arithmetic average then you agree with
the statement : "the average of exponential growth rates has the same growth rate as the maximum"

Does there exist any simple and clear way that we can show this in a plot ?!

I apologize if I am a bit slow but Robert could you please explain five things to me:

1) What is the expression  asympt(diff(Avg,t)/Avg, t)  doing ? 
2) Why do you divide by diff(Avg,t) by Avg ?
3) What does O(1) mean ?
4) Why cant I plot  r1+O(1)*(1/exp(t))^(r1-r2)  ?
5) Do you agree or disagree with the statement
"the average of exponential growth rates has the same growth rate as the maximum"  ?

I apologize if I am a bit slow but Robert could you please explain five things to me:

1) What is the expression  asympt(diff(Avg,t)/Avg, t)  doing ? 
2) Why do you divide by diff(Avg,t) by Avg ?
3) What does O(1) mean ?
4) Why cant I plot  r1+O(1)*(1/exp(t))^(r1-r2)  ?
5) Do you agree or disagree with the statement
"the average of exponential growth rates has the same growth rate as the maximum"  ?

could you please elaborate a bit so I can understand ?!

We want alec back !!!  :-)

I do not understand why you have:

if C[t-1] mod 3 = Coin3[t] then
       C[t]:= C[t-1] + d2
     else
       C[t]:= C[t-1] + d1
     end if;


I thought you said that :   "Game C: Flip Coin 3.  If heads play a turn of Game A, if tails play a turn of Game B. "

So why do you have C[t-1[ mod 3 ?   

`mod`(0, 3);
`mod`(1, 3);
`mod`(2, 3);
`mod`(3, 3);
                                      0
                                      1
                                      2
                                      0

The probability of getting 0 or 1 is not 50- 50 here more like 3/4 hummm...

Then you say:

"In Game C, you always flip Coin 1 if your fortune == 2 mod 3, otherwise effectively you're flipping a coin with winning probability 2/5. "

 

I do not understand why you have:

if C[t-1] mod 3 = Coin3[t] then
       C[t]:= C[t-1] + d2
     else
       C[t]:= C[t-1] + d1
     end if;


I thought you said that :   "Game C: Flip Coin 3.  If heads play a turn of Game A, if tails play a turn of Game B. "

So why do you have C[t-1[ mod 3 ?   

`mod`(0, 3);
`mod`(1, 3);
`mod`(2, 3);
`mod`(3, 3);
                                      0
                                      1
                                      2
                                      0

The probability of getting 0 or 1 is not 50- 50 here more like 3/4 hummm...

Then you say:

"In Game C, you always flip Coin 1 if your fortune == 2 mod 3, otherwise effectively you're flipping a coin with winning probability 2/5. "

 

I was planning to upload a flowchart for this "new version" of the game. But I think I will wait with
that (until have understand it better) because it most likely will be wrong because I dont understand why
you introduce a lag in the capital variable  A[t-1], B[t-1], C[t-1]   ie  if A[t-1] mod 3 = 0.

"Game A: if fortune divisible by 3, flip Coin 2, otherwise flip Coin 1."

Also

"Note btw that in this case A[t] = B[t] + 2 for t >= 3.  Do you see why?"

Unfortunately I cannot see why at this stage.

Robert, I am curious where is your source of knowledge. I mean how do you come up with these
specifications for the different versions of the Parrondo game. I guess you could do it by trial and error but there must
exist a more sophisticated approach  ?!

I was planning to upload a flowchart for this "new version" of the game. But I think I will wait with
that (until have understand it better) because it most likely will be wrong because I dont understand why
you introduce a lag in the capital variable  A[t-1], B[t-1], C[t-1]   ie  if A[t-1] mod 3 = 0.

"Game A: if fortune divisible by 3, flip Coin 2, otherwise flip Coin 1."

Also

"Note btw that in this case A[t] = B[t] + 2 for t >= 3.  Do you see why?"

Unfortunately I cannot see why at this stage.

Robert, I am curious where is your source of knowledge. I mean how do you come up with these
specifications for the different versions of the Parrondo game. I guess you could do it by trial and error but there must
exist a more sophisticated approach  ?!

First 18 19 20 21 22 23 24 Last Page 20 of 33