Question: Create a standard 52 card deck, using following function and answer the following questions using R function. ```{r} suit
Create a standard 52 card deck, using following function and answer the following questions using R function.
```{r}
suit<-c("Diamonds","Clubs","Hearts","Spades")
numbers<-c("Ace",seq(2,10,by=1))
facecard<-c("King","Queen","Jack")
All<-c(numbers,facecard)
All.4<-rep(All,4)
suits.13<-rep(suit,13)
Card_deck<-data.frame(All.4,suits.13)
deck<-paste(Card_deck$All.4,Card_deck$suits.13)
deck
a) Run four simulations that pull 10, 100, 1000, and 10000 cards respectively with replacement. Use the `table` function to find the distribution of suit counts. (using R)
b) What do you notice about the distribution of counts as more simulations are run? (using R)
C) Assuming a 5 card poker hand what is the probability of having four of a kind? (Hint. The probability of a 4 of a kind is equal to total number of ways to get a four of a kind divided by the total number of ways to choose 5 cards from a 52 card deck). (using R)
d) Run a simulation for Part c to answer the question. Compare the results (hint. they should be close). (using R)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
