Originally Posted by

**bamby** 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?

Thank you!