Session Ready
Exercise

Function to simulate one round with betting

Now let us write a function that simulates one round under the von Neumann model, with betting incorporated.

Player B will observe their value, and decide whether to bet $1 or not. If the decision to bet is made, then the two players compare values and the higher value wins. Note that if Player B bets and wins, the result is positive 1; if they bet and lose, the result is negative 1. If Player B decides not to bet, then no money is won or lost by either player.

Here, we will assume that Player B has a fixed strategy: if their value is above a certain cutoff, then they will bet. This cutoff, bet_cutoff, will be the argument to the function.

Instructions
100 XP
  • Determine whether Player B will decide to bet.
  • If they do bet, return the result of the bet using the ifelse function.