Question

In: Statistics and Probability

A standard deck of cards has 52 cards, four each of 2,3,4,5,6,7,8,9,10,J,Q,K,A. In blackjack, a player...

  1. A standard deck of cards has 52 cards, four each of 2,3,4,5,6,7,8,9,10,J,Q,K,A. In blackjack, a player gets two cards and adds their values. Cards count as their usual numbers, except Aces are 11 (or 1), while K, Q, J are all 10.
    1. “Blackjack” means getting an Ace and a value ten card. What is probability of getting a blackjack?
    2. What is probability of getting 19? (The probability that the sum of your cards is 19, using Ace as 11)

    Use R to simulate dealing two cards, and compute these probabilities experimentally.

Solutions

Expert Solution

solution:

ptm <- proc.time()
deck<-rep(c("A", "K", "Q", "J", "10", "9", "8", "7", "6", "5", "4", "3", "2"), 4)
prob_blk<-c()
prob_19<-c()
for (i in 1:500) {
draw<-matrix(, nrow = 5000, ncol = 2, byrow = T)
countblk=0
count19=0
for(j in 1:5000) {
draw[j,]<-sample(deck, 2)
ifelse((draw[j, 1] == "A" & draw[j, 2] == "10") | (draw[j, 1] == "10" & draw[j, 2] == "A") | (draw[j, 1] == "A" & draw[j, 2] == "K") | (draw[j, 1] == "K" & draw[j, 2] == "A") | (draw[j, 1] == "A" & draw[j, 2] == "Q") | (draw[j, 1] == "Q" & draw[j, 2] == "A") | (draw[j, 1] == "A" & draw[j, 2] == "J") | (draw[j, 1] == "J" & draw[j, 2] == "A"), countblk <- countblk + 1, ifelse((draw[j, 1] == "A" & draw[j,2] == "8") | (draw[j, 1] == "8" & draw[j, 2] == "A") | (draw[j, 1] == "9" & draw[j, 2] == "10") | (draw[j, 1] == "10" & draw[j, 2] == "9") | (draw[j, 1] == "9" & draw[j, 2] == "K") | (draw[j, 1] == "K" & draw[j, 2] == "9") | (draw[j, 1] == "9" & draw[j,2] == "Q") | (draw[j, 1] == "Q" & draw[j, 2] == "9") | (draw[j, 1] == "9" & draw[j, 2] == "J") | (draw[j, 1] == "J" & draw[j, 2] == "9"), count19 <- count19 + 1, count19))
  
}
prob_blk[i] = countblk/5000
prob_19[i] = count19/5000
}
mean(prob_blk)
mean(prob_19)
proc.time() - ptm

please give me thumb up


Related Solutions

Problem 3. A standard deck of cards contains 52 cards: 13 Ranks: A,2,3,4,5,6,7,8,9,10,J,Q,K 4 Suits: Clubs,...
Problem 3. A standard deck of cards contains 52 cards: 13 Ranks: A,2,3,4,5,6,7,8,9,10,J,Q,K 4 Suits: Clubs, Diamonds, Hearts, Spades Suppose you draw a hand of 5 cards from the deck. Consider the following possible hands of cards. For each part, explain how you derive your solutions. 3(a) How many different hands of 5 cards exist? 3(b) How many ways can you draw a single pair? A single pair means that there are exactly two cards with the same rank (no...
Consider a standard deck of cards. Consider A,K,Q,J as face cards; the others are even or...
Consider a standard deck of cards. Consider A,K,Q,J as face cards; the others are even or odd. What is the probability that a card drawn at random is a. A king if it is black b. A king if it is a face card c. an even card if it is not a face card d. a face card if it not an even card e. the king of spades assuming it is red f. a black card given that...
Four cards are drawn at random from a standard deck of 52 cards. a. What’s the...
Four cards are drawn at random from a standard deck of 52 cards. a. What’s the probability that at least one card is a 7? b. What’s the probability that 3 of the 4 cards are the same suit? c. What’s the probability that they are all the same suit?
Cards are: Black A, K, Q, J Red    A, K, Q, J A K Q J...
Cards are: Black A, K, Q, J Red    A, K, Q, J A K Q J A K Q J 1.) The probability of picking a numeric card if you pick two cards randomly 2.) The probability of Picking K and Q if you pick two cards randomly. It does not matter which color. However, K needs to be in your left and Q needs to be in your right hand. 3.) The probability of Picking K and Q if...
Cards are: Black A, K, Q, J Red    A, K, Q, J A K Q J...
Cards are: Black A, K, Q, J Red    A, K, Q, J A K Q J A K Q J 1.) The probability of picking a numeric card if you pick two cards randomly 2.) The probability of Picking K and Q if you pick two cards randomly. It does not matter which color. However, K needs to be in your left and Q needs to be in your right hand. 3.) The probability of Picking K and Q if...
task A normal deck of cards has 52 cards, consisting of 13 each of four suits:...
task A normal deck of cards has 52 cards, consisting of 13 each of four suits: spades, hearts, diamonds, and clubs. Hearts and diamonds are red, while spades and clubs are black. Each suit has an ace, nine cards numbered 2 through 10, and three face cards. The face cards are a jack, a queen, and a king. Answer the following questions for a single card drawn at random from a well-shuffled deck of cards. a. What is the probability...
Play a blackjack. Write a Java program that starts from a deck of 52 cards and...
Play a blackjack. Write a Java program that starts from a deck of 52 cards and one player plays again a dealer. Use a simple rule explained here. Ace can be counted as 1 only for simplicity. Jack, Queen, King are counted as 10. At the beginning, player receives two cards. Dealer receives two cards, but shows one and hides one. Program asks player if player wants to receive another card or not. (player can continue to receive new cards...
In a standard deck of 52 cards, there are four suits (clubs, hearts, diamonds and spades)...
In a standard deck of 52 cards, there are four suits (clubs, hearts, diamonds and spades) and 13 cards of each suit. What is the probability of randomly selecting two cards, which turn out to be the same suit? (Answer to 2 digits after the decimal point.)
consider a standard deck of playing cards... 52 cards, 4 suits of 13 cards each, 3...
consider a standard deck of playing cards... 52 cards, 4 suits of 13 cards each, 3 cards of each suit are face cards, 2 suits are black (clubs and spades) and 2 are red (hearts and diamond) a) Let event A be drawing a random card that is a diamond. What is a trial for this scenario? What is the sample space? Is A a simple event? What is P(A)? What is A¯, the complement of A? What is P(A¯)?...
A standard poker deck of 52 cards has four suits, (symbols C, H, S, and D)...
A standard poker deck of 52 cards has four suits, (symbols C, H, S, and D) and thirteen ranks (symbols A, 2, 3, 4, 5, 6, 7, 8, 9, T, J, Q, and K). Every card in the deck has both a value and a suit.1 A poker hand is any set of 5 cards from the standard poker deck. There are some special hands in poker, and these have ranks (i.e. some are better, some are worse). From best...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT