Create a standard deck of 52 cards

suits <- c("Hearts", "Diamonds", "Clubs", "Spades")
ranks <- c("Ace", "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King")
deck <- paste(rep(ranks, times = 4), rep(suits, each = 13))

Function to draw n cards with replacement

draw_cards <- function(n) {
  sample(deck, size = n, replace = TRUE)
}

Example: Draw 20 cards with replacement

set.seed(13579)
cards_drawn <- draw_cards(20)

Show the result

cards_drawn
##  [1] "5 Hearts"    "8 Diamonds"  "4 Spades"    "3 Clubs"     "3 Hearts"   
##  [6] "5 Clubs"     "4 Clubs"     "2 Clubs"     "10 Clubs"    "2 Clubs"    
## [11] "2 Hearts"    "10 Hearts"   "7 Clubs"     "5 Diamonds"  "7 Spades"   
## [16] "King Hearts" "King Clubs"  "5 Clubs"     "6 Diamonds"  "5 Spades"

Question: what is the sample proportion of red cards among these 20 cards?

Type your answer here: There were 8 red cards drawn out of twenty, which is, 8/20, which is 0.4

Example: Draw 100 cards with replacement

draw_cards(100)
##   [1] "5 Diamonds"     "Jack Hearts"    "Jack Hearts"    "Ace Clubs"     
##   [5] "10 Hearts"      "6 Hearts"       "10 Hearts"      "2 Diamonds"    
##   [9] "4 Hearts"       "Queen Clubs"    "7 Clubs"        "8 Hearts"      
##  [13] "4 Spades"       "5 Clubs"        "2 Hearts"       "9 Clubs"       
##  [17] "7 Clubs"        "Ace Diamonds"   "Ace Hearts"     "2 Clubs"       
##  [21] "8 Hearts"       "Queen Diamonds" "3 Clubs"        "6 Spades"      
##  [25] "8 Diamonds"     "Queen Hearts"   "9 Spades"       "Jack Diamonds" 
##  [29] "9 Spades"       "3 Spades"       "Ace Clubs"      "8 Clubs"       
##  [33] "2 Clubs"        "3 Clubs"        "2 Clubs"        "7 Clubs"       
##  [37] "Queen Clubs"    "Queen Clubs"    "10 Diamonds"    "4 Spades"      
##  [41] "6 Hearts"       "3 Clubs"        "King Clubs"     "Jack Diamonds" 
##  [45] "4 Clubs"        "9 Spades"       "6 Clubs"        "4 Hearts"      
##  [49] "Queen Hearts"   "10 Diamonds"    "Ace Diamonds"   "5 Clubs"       
##  [53] "2 Clubs"        "10 Spades"      "Ace Hearts"     "5 Clubs"       
##  [57] "8 Diamonds"     "Ace Hearts"     "3 Spades"       "8 Hearts"      
##  [61] "5 Spades"       "Ace Spades"     "Ace Hearts"     "6 Hearts"      
##  [65] "7 Diamonds"     "7 Spades"       "10 Diamonds"    "10 Diamonds"   
##  [69] "Ace Diamonds"   "Ace Clubs"      "7 Clubs"        "4 Spades"      
##  [73] "4 Spades"       "Jack Hearts"    "King Hearts"    "King Diamonds" 
##  [77] "Jack Hearts"    "Ace Hearts"     "10 Spades"      "3 Diamonds"    
##  [81] "7 Hearts"       "4 Spades"       "6 Spades"       "7 Spades"      
##  [85] "Ace Diamonds"   "9 Hearts"       "9 Spades"       "6 Hearts"      
##  [89] "Queen Spades"   "Queen Diamonds" "4 Spades"       "10 Diamonds"   
##  [93] "King Diamonds"  "7 Spades"       "King Spades"    "9 Diamonds"    
##  [97] "Queen Clubs"    "9 Clubs"        "3 Clubs"        "3 Diamonds"

Question: what is the sample proportion of red cards among these 100 cards?

Type your answer here: 42 cards were red out of the 100 that were drawn, which is 42/100, which is 0.42

Question: Since we are playing with the standard deck, the population proportion of red cards is 0.5. Which sample proportion among those two above is closer to 0.5? Do you think the sample size make a difference when it comes to estimating the population proportion?

Type your answer here: The sample proportion from the 20 card draw was 0.4 and the sample proportion was 0.42. Since the 100 card draw results are closer to 0.5. I do think the sample size makes difference when estimating the population proportion. The larger the sample size that you have is going to give you more accurate estimates and help to eliminate/reduce the randomness from drawing the cards.