BaşlayınÜcretsiz başlayın

Simulate many iterations of von Neumann model

Now, let us use the one_round function that we wrote in the previous exercise to simulate 10000 iterations, when Player B's strategy is to bet if and only if their value is greater than 0.5. Our goal will be to estimate Player B's expected value under this strategy.

Bu egzersiz, kursun bir parçasıdır

Probability Puzzles in R

Kursa Göz Atın

Egzersiz talimatları

  • Fill in the line to run one iteration with Player B choosing to bet if their value is greater than 0.5, and store the value into b_win
  • Calculate and display the expected value for Player B under this strategy.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

b_win <- rep(NA, 10000)

for(i in 1:10000){
  # Run one and store result
  
}

# Print expected value
Kodu Düzenle ve Çalıştır