MrMarc

3163 Reputation

18 Badges

17 years, 135 days

MaplePrimes Activity


These are replies submitted by MrMarc

all right thanx for explaining that,

Yes I think the probability of ruin is P(Ruin Player B ) = b / (a+b) = 7/ (7+13) =0.35 and

P (Ruin Player A ) = a / (a+b) = 13/ (7+13) =0.65.  As outlined here

algo.inria.fr/csolve/ruin.pdf

The problem is how I can prove that ?!

 

Probably analyze it but I am open to suggestions ( I trust your judgment) :-) . The most important thing

is to find an simple but elegant solution. For example they got some nice 3D chart in the document 

cs.gettysburg.edu/~tneller/papers/pig+.pdf   which would be nice to be able to replicate.

 

"What strategy maximizes the expected score of a turn?  This is a straight-forward, simple computation."

Could you please show how this can be done in Maple ?  I dont know how
 

I am also intrested in other games that  have elegant solution like the "The Gambler's Ruin" problem like

Two gamblers A and B have initially 7 £ and 13 £.
Each time, they throw a coin: If stake, A give 1 £ to B, else B give 1 £ to A.
The game is finish only if A or B is ruined (the time is infinite).
What about the probability for A to win ?

 

Probably analyze it but I am open to suggestions ( I trust your judgment) :-) . The most important thing

is to find an simple but elegant solution. For example they got some nice 3D chart in the document 

cs.gettysburg.edu/~tneller/papers/pig+.pdf   which would be nice to be able to replicate.

 

"What strategy maximizes the expected score of a turn?  This is a straight-forward, simple computation."

Could you please show how this can be done in Maple ?  I dont know how
 

I am also intrested in other games that  have elegant solution like the "The Gambler's Ruin" problem like

Two gamblers A and B have initially 7 £ and 13 £.
Each time, they throw a coin: If stake, A give 1 £ to B, else B give 1 £ to A.
The game is finish only if A or B is ruined (the time is infinite).
What about the probability for A to win ?

 

ha ha that was like thowing me into a lions den :-).  I do appreciate that you take the time and trying to explain

but if I just understod 0.01% of what is on that page I would most likely not ask the question.

I was more hoping for an informative step-by-step reasoning process rather than being drown in fancy equations

( which most likely have a completely different purpose) but I might just have to realize that Ms Fourier is not for me.

ha ha that was like thowing me into a lions den :-).  I do appreciate that you take the time and trying to explain

but if I just understod 0.01% of what is on that page I would most likely not ask the question.

I was more hoping for an informative step-by-step reasoning process rather than being drown in fancy equations

( which most likely have a completely different purpose) but I might just have to realize that Ms Fourier is not for me.

I hope you will see further than my ignorance here but what is a Fourier transform?   Could you please explain ?
 

Also I sent Igor an email asking some questions about the pdf etc and his answer was:
 

"The probability density of the B/S process is more abstract than it may appear. It returns the transitional PDF for the contingent claims written on the underlying asset. In this respect u(t,x) is NOT the stock price, this the option on the stock price (x) seen at certain time (t). This function "travels" in space - stock price, and in time. The solution of this PDE answers the question: what is the prob of the option being at (x,t) moving  to a new point u(x+a, t+b). In short - the solution of the forward Kolmogorov PDE returns the transitional prob density for the option, your PDF (pdf with volatility sqrt(time)) shows the prob density for the stock price. As you can see, these are different."

I hope you will see further than my ignorance here but what is a Fourier transform?   Could you please explain ?
 

Also I sent Igor an email asking some questions about the pdf etc and his answer was:
 

"The probability density of the B/S process is more abstract than it may appear. It returns the transitional PDF for the contingent claims written on the underlying asset. In this respect u(t,x) is NOT the stock price, this the option on the stock price (x) seen at certain time (t). This function "travels" in space - stock price, and in time. The solution of this PDE answers the question: what is the prob of the option being at (x,t) moving  to a new point u(x+a, t+b). In short - the solution of the forward Kolmogorov PDE returns the transitional prob density for the option, your PDF (pdf with volatility sqrt(time)) shows the prob density for the stock price. As you can see, these are different."

An alternative (probably more in line with your reasoning) would be to assume that

player-1 always gets 0.625. However I am not sure how realistic it is to assume that

player-1 will always have a threshold of x=0.5 and expected value=0.625 and never will

change his first value... I must admit I am bit confused here...



restart:
with(ListTools):
with(Statistics):
randomize():

X := proc () local n, x1, x2, p1r1, p1r2, p2r1, p2r2, i, score, sscore;

n := 1000;

p2r1 := Sample(RandomVariable(Uniform(0, 1)), n):

p2r2 := Sample(RandomVariable(Uniform(0, 1)), n):


for i to n do

if p2r1[i] < .625 and p2r2[i] < .625 then score[i] := "p1"

elif p2r1[i] < .625 and .625 < p2r2[i] then score[i] := "p2"

elif .625 < p2r1[i] then score[i] := "p2" end if :

end do:

sscore := [seq(score[i], i = 1 .. n)]:

evalf(Occurrences("p2", sscore)/nops(sscore), 2)

end proc:

Histogram([seq(X(), i = 1 .. 250)]);
 

Initially I could not confirm the result but I think I made some mistakes in the if statments.

I think this should be correct but I am not 100% convinced that it works. Maybe it only works for large samples ?!



restart:
with(ListTools):
with(Statistics):
randomize():

n := 20000:    x1 := .5:     x2 := .6180339883:  

p1r1 := Sample(RandomVariable(Uniform(0, 1)), n):
p1r2 := Sample(RandomVariable(Uniform(0, 1)), n):
p2r1 := Sample(RandomVariable(Uniform(0, 1)), n):
p2r2 := Sample(RandomVariable(Uniform(0, 1)), n):


for i to n do

if `and`(`and`(p1r1[i] < x1, p2r1[i] < x2), p1r2[i] > p2r2[i]) then score[i] := "p1"

elif `and`(`and`(p1r1[i] < x1, p2r1[i] < x2), p1r2[i] < p2r2[i]) then score[i] := "p2"

elif `and`(`and`(p1r1[i] < x1, p2r1[i] > x2), p1r2[i] < p2r1[i]) then score[i] := "p2"

elif `and`(`and`(p1r1[i] < x1, p2r1[i] > x2), p1r2[i] > p2r1[i]) then score[i] := "p1"


elif `and`(`and`(p1r1[i] > x1, p2r1[i] < x2), p1r1[i] > p2r2[i]) then score[i] := "p1"

elif `and`(`and`(p1r1[i] > x1, p2r1[i] < x2), p1r1[i] < p2r2[i]) then score[i] := "p2"

elif `and`(`and`(p1r1[i] > x1, p2r1[i] > x2), p1r1[i] < p2r1[i]) then score[i] := "p2"

elif `and`(`and`(p1r1[i] > x1, p2r1[i] > x2), p1r1[i] > p2r1[i]) then score[i] := "p1"    end if :

end do:


sscore := [seq(score[i], i = 1 .. n)]:

Occurrences("p1", sscore);

Occurrences("p2", sscore);
 

                                    9970
                                    10030
 

thank you for pointing that out to me :-)  I must say I am very impressed with the way you have solve this problem.

Simple, straightforward and powerful with no obscure mathematical tricks

I still cant get my head around that you can actually get an optimal value.. cool

I can not wait to do some simulations to confirm such finding.

I guess the only thing that is missing is a name. What is this type of problem called ?!

Another thing. Could you please explain why you use (x+1) in the

below equation. I did not understand that

 E = P(n1<x)*E(n2) + (1-P(n1<x))*E(n1)
    = x*1/2           + (1-x)*(1/2*(x+1))
    = x/2 + (1-x^2)/2

 

I assume that (1-x) is the probability of getting n1>x and I also assume that  E(n1)=(1/2*(x+1))

where 1/2 is the probability and (x+1) yes I dont know what that is ?!  Presumably the outcome...

but for what ?!

Extremely fascinating stuff Joe!  Good explanation as well :-)

I am just amased that there exist an optimal solution like (sqrt(5)-1)/2.

I am definitely going to explore these concepts further.

Maybe an application at the application center would be nice ?!

 

If I remember correctly  (sqrt(5)-1)/2 is like the inverse of phi or ( 1 - phi ) or something like that,

Is this an coincident ? 

Another question: What is the name of this problem ?  I tried to do some google searches

but I am not sure what the problem is called ?

Joe,

I noticed that your name was in the list with people who had solved the puzzle

domino.research.ibm.com/Comm/wwwr_ponder.nsf/challenges/February2007.html

I was wondering if you could please help us mortals understand the puzzle ?

I found a solution

nrich.maths.org/discus/messages/114352/115671.html

like the one below but I am not sure it is correct. what do you think ?

 

Question:

Consider the following two person game. Each player receives a random number uniformly distributed between 0 and 1. Each player can choose to discard his number and receive a new random number between 0 and 1. This choice is made without knowing the other players number or whether the other player chose to replace his number. After each player has had an opportunity to replace his number the numbers are compared and the player with the higher number wins. What strategy should a player follow to ensure he will win at least 50% of the time?

 

Solution:

Assumption: A player wins if he has a larger number than the other player
Let the players be A and B
Let Player A decide that if he gets a number <p,then he will switch .Otherwise he will retain the number
Let Player B decide that if he gets a number <q,then he will switch .Otherwise he will retain the number

Notations:
x1=amount the player 1 gets in the first turn and x2 is the amount(if exists) the player gets in the second turn
y1=amount the player 2 gets in the first turn and y2 is the amount(if exists) the player gets in the second turn
Now there are 4 events:
1)Player 1's first value is less than p AND Player 2's first value is less than q-->probability=pq
2)Player 2's first value is less than p AND Player 2's first value is greater than or equal to q-->probability=p(1-q)
3)Player 1's first value is greater than or equal to p AND Player 2's first value is less than q-->probability=(1-p)q
4)Player 1's first value is greater than or equal to p AND Player 2's first value is greater than or equal to q-->probability=(1-p)(1-q)
Now probability that A wins=
Pr(event 1) P(x2>y2)+Pr(event 2)*P(x2>y1|y1>q)+P(event 3)*P(x1>y2|x1>p)+P(event 4)*P(x1>y1|x1>p,y1>q)

Now note that
P(x2>y2)=1/2
P(x2>y1|y1>q)=(1-q)/2...can be easily worked out since x2 is uniformly distributed between 0 and 1 ie U(0,1) and y1 is U(q,1)
P(x1>y2|x1>p)=(1+p)/2..same as before
Now for
P(x1>y1|x1>p,y1>q)
Note that if p>q, then this expression is
integral[1/(1-p)*(x-q)/(1-q)],(x=p to 1) =(p-2q+1)/(2(1-q))
if p<=q then the expression is
(1-q)/(2(1-p))

So probability that A wins
=(1+pq^2+pq+p-q-p^2*q-p^2)/2 if p>q
=(1+pq+p+q^2-p^2*q-pq-q)/2 if p<=q
.....and then everything follows as a piece of cake.


thanx Doug !  Yes I agree that the ListTools:-SearchAll command should be versatile

and be able to "accepted search criteria other than an exact match". I think you have more

leverage with MapleSoft and I will let you do the persuasion....:-)

thanx Doug !  Yes I agree that the ListTools:-SearchAll command should be versatile

and be able to "accepted search criteria other than an exact match". I think you have more

leverage with MapleSoft and I will let you do the persuasion....:-)

First 27 28 29 30 31 32 33 Page 29 of 33