For performing elementary probability calculations in introductory statistic courses, we might want to simulate random games. The dataset roulette contains the standard sample space for one spin on a roulette wheel. cards contains the standard set of 52 playing cards in four colours (without Jokers). tarot does the same with a classic tarot deck.

cards
tarot
roulette

Value

cards is a data.frame with three columns named card, rank and suit

tarot is a data.frame with four columns named card, rank, suit and desc

roulette is a data.frame with seven columns named num and col, parity, highlow, dozens, column, pocketrange

See also

Examples

head(cards)
#>     card rank suit
#> 1 2-club    2 club
#> 2 3-club    3 club
#> 3 4-club    4 club
#> 4 5-club    5 club
#> 5 6-club    6 club
#> 6 7-club    7 club
head(tarot)
#>     card rank suit desc
#> 1 1-wand    1 wand <NA>
#> 2 2-wand    2 wand <NA>
#> 3 3-wand    3 wand <NA>
#> 4 4-wand    4 wand <NA>
#> 5 5-wand    5 wand <NA>
#> 6 6-wand    6 wand <NA>
head(roulette)
#>   num   col parity highlow dozens column     pocketrange
#> 1   0 green   <NA>    <NA>     NA     NA        jeu zero
#> 2  26 black   even    high      3     35        jeu zero
#> 3   3   red    odd     low      1     36        jeu zero
#> 4  35 black    odd    high      3     35        jeu zero
#> 5  12   red   even     low      1     36        jeu zero
#> 6  28 black   even    high      3     34 voisins du zero

# drawing 5 cards
sample(cards$card, 5)
#> [1] "2-spade"   "8-diamond" "5-heart"   "A-spade"   "J-spade"  

# drawing 5 cards with jokers
sample(c(cards$card, rep("Joker", 3)), 5)
#> [1] "10-diamond" "10-spade"   "9-heart"    "6-spade"    "K-heart"   

# spin the wheel by using the DescTools::Sample() for sampling
# rows from a data frame
Sample(roulette, size=1)
#>    num col parity highlow dozens column pocketrange
#> 15   1 red    odd     low      1     34   orphelins

# simulate the evening in Las Vegas with 10 games
Sample(roulette, 10, replace=TRUE)
#>     num   col parity highlow dozens column       pocketrange
#> 26   13 black    odd     low      2     34 tiers du cylindre
#> 27   27   red    odd    high      3     36 tiers du cylindre
#> 28    6 black   even     low      1     36         orphelins
#> 12   31 black    odd    high      3     34         orphelins
#> 5    12   red   even     low      1     36          jeu zero
#> 33   21   red    odd    high      2     36   voisins du zero
#> 5.1  12   red   even     low      1     36          jeu zero
#> 3     3   red    odd     low      1     36          jeu zero
#> 36   15 black    odd     low      2     36          jeu zero
#> 29   34   red   even    high      3     34         orphelins