Question about a simple game
|
04-23-2019, 08:09 PM
Post: #1
|
|||
|
|||
Question about a simple game
Hi All,
I wrote a simple game where the user plays against the calculator/PC. The game is an iterative one. In ach iteration the user and the PC generate random numbers (0,1). The user’s random value is added to a summation variable, while the calculator’s random number is subtracted from that summation variable. If the summation variable reaches or exceeds a user-chosen value T, the user is the winner. If the summation variable reaches -T or less, the the calculator win. Here is the pseudo-code: Code: Sum = 0 I noticed that the average iterations, I, for either player (the user or the calculator) to win is a function of T. I used quadratic fit of I as a function of T. The curves I obtained from the numerous runs indicate that the underlying relation between I and T is: I = 0.5*T^2 + T = T*(T/2 + 1) My question is, can someone derive the above equation based on whatever statistical assumptions? Namir |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Question about a simple game - Namir - 04-23-2019 08:09 PM
RE: Question about a simple game - Thomas Okken - 04-23-2019, 08:38 PM
RE: Question about a simple game - Albert Chan - 04-23-2019, 11:05 PM
RE: Question about a simple game - Albert Chan - 04-24-2019, 02:14 AM
RE: Question about a simple game - Namir - 04-24-2019, 03:15 AM
RE: Question about a simple game - Albert Chan - 04-24-2019, 02:25 PM
RE: Question about a simple game - Namir - 04-24-2019, 03:14 PM
RE: Question about a simple game - Namir - 04-24-2019, 03:10 PM
|
User(s) browsing this thread: 1 Guest(s)