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

Simulate one game

Let us now simulate one game of Settlers of Catan, under the assumption that a game lasts for 60 rolls of the two dice.

Here, we will use the replicate function to run the game, and the table function to display the results. Within this task, the roll_dice function from previous exercises is available for you to do each roll.

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

Probability Puzzles in R

Kursa Göz Atın

Egzersiz talimatları

  • Use the replicate function to do 60 replications of rolling two dice.
  • Use the table function to display the results.

Uygulamalı etkileşimli egzersiz

Bu egzersizi bu örnek kodu tamamlayarak deneyin.

set.seed(1)

# Simulate one game (60 rolls) and store the result
rolls <- ___

# Display the result
Kodu Düzenle ve Çalıştır