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] "Q-spade"   "9-diamond" "3-heart"   "Q-diamond" "4-club"   

# drawing 5 cards with jokers
sample(c(cards$card, rep("Joker", 3)), 5)
#> [1] "8-club" "Joker"  "K-club" "2-club" "3-club"

# 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
#> 11   9 red    odd     low      1     36   orphelins

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