Matlab Help needed
I have to white a code which simulates a game.
The game is:
We have 2 oponents whith whom you alternate play. Whenever you play with A you win with probability pa; whenever you play with B you win with probability pb, where pb>pa.
Your objective is to minimize the number of games you need to play to win 2 games in a row. Should you start with A or B?
I can use some random numbers for pa and pb.
My question is how to simulate a game.
What should I sum or derive in Matlab code?
The core of the program is a loop that loops over games using a random number to determine the result and stopping when you win two in a row and returning the number of games simulated.
Originally Posted by bamby