Question

(a) Ten cards labelled 1,2,3, ..., 10 are shuffled and turned over one-by-one. Each time the...

(a) Ten cards labelled 1,2,3, ..., 10 are shuffled and turned over one-by-one. Each time the ith card shows the number i it is considered a "hit". So if the second card turned shows "2" it is a "hit" otherwise not. Let the random variable X = the total number of "hits". Use simulations to estimate E[X]. in R

Homework Answers

Answer #1

R code with comments

--------

#set the random seed
set.seed(123)

#set the number of simulations
R<-1000

#initialize the variable to hold number of hits
x<-numeric(R)
#do the simulations
for (i in 1:R) {
   #flip the 10 cards
   s<-sample(1:10,size=10,replace=FALSE)
   #find the number of hits
   x[i]<-sum(s==1:10)
}
#print the estimate of E(X)
sprintf('The estimated E(X)=%.4f',mean(x))

------

Get this

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
A standard deck of cards will be shuffled and then the cards will be turned over...
A standard deck of cards will be shuffled and then the cards will be turned over one at a time until the first ace is revealed. Let B be the event that the next card in the deck will also be an ace. (a) Intuitively, how do you think P(B) compares in size with 1/13 (the overall proportion of aces in a deck of cards)? Explain your intuition. (Give an intuitive discussion rather than a mathematical calculation; the goal here...
We draw one card at a time without replacement from the top of a shuffled standard...
We draw one card at a time without replacement from the top of a shuffled standard deck of cards and stop when we draw a Jack of any suit. Let X be the number of cards we have drawn. What is P( X = 8 ) ? Round to two decimals.
Decide whether the experiment is a binomial experiment. Explain. Selecting ten cards, one at a time...
Decide whether the experiment is a binomial experiment. Explain. Selecting ten cards, one at a time with replacement and reshuffled from a standard deck of cards. The random variable is the number of blue cards obtained. Condition 1: Condition 2: Condition 3: Condition 4:
Cards are drawn from a standard 52 card deck. After each card is drawn, it is...
Cards are drawn from a standard 52 card deck. After each card is drawn, it is put back in the deck and the cards are reshuffled so that each card drawn is independent of all others. Let N be the random variable that represents the number of cards that are drawn before the second appearance of an Ace. For example, if the sequence of cards drawn was {2, 5, K, 7, A, 5, 3, J, A, ...} then N would...
1.Suppose that you randomly draw one card from a standard deck of 52 cards. After writing...
1.Suppose that you randomly draw one card from a standard deck of 52 cards. After writing down which card was drawn, you replace the card, and draw another card. You repeat this process until you have drawn 18 cards in all. What is the probability of drawing at least 5 diamonds? 2.For the experiment above, let ? X denote the number of diamonds that are drawn. For this random variable, find its expected value and standard deviation. ?(?)= σ =
JAVA Exercise_Pick a Card Write a program that simulates the action of picking of a card...
JAVA Exercise_Pick a Card Write a program that simulates the action of picking of a card from a deck of 52 cards. Your program will display the rank and suit of the card, such as “King of Diamonds” or “Ten of Clubs”. You will need: • To generate a random number between 0 and 51 • To define two String variables: a. The first String should be defined for the card Suit (“Spades”, “Hearts”, “Diamonds”, “Clubs”) b. The second String...
Python Blackjack Game Here are some special cases to consider. If the Dealer goes over 21,...
Python Blackjack Game Here are some special cases to consider. If the Dealer goes over 21, all players who are still standing win. But the players that are not standing have already lost. If the Dealer does not go over 21 but stands on say 19 points then all players having points greater than 19 win. All players having points less than 19 lose. All players having points equal to 19 tie. The program should stop asking to hit if...
The percent of fat calories that a person in America consumes each day is normally distributed...
The percent of fat calories that a person in America consumes each day is normally distributed with a mean of about   45   and a standard deviation of   7.5 . Suppose that one individual is randomly chosen. Let   X=   percent of fat calories. In each appropriate box you are to enter either a rational number in "p/q" format or a decimal value accurate to the nearest   0.01 . (.25)   X∼    (pick one) UBNE   (    ,    ) . (.25) The probability that a person consumes...
Laboratory 4: Black Jack! Java API ArrayList Lab 04 Documentation Included matrix package "external" documentation Included...
Laboratory 4: Black Jack! Java API ArrayList Lab 04 Documentation Included matrix package "external" documentation Included Download Lab04.zip for all of the additional supporting files that you will need to compile and run. Extract the files into your working directory You can find the rules of blackjack all over the Internet. To get an idea of what you are trying to accomplish in this lab, I’ll demonstrate the final solution. The dealer stands on all 17s. Doubling after splitting is...
A government health organization publishes information on AIDS in a weekly report. During one​ year, the...
A government health organization publishes information on AIDS in a weekly report. During one​ year, the number of provisional cases of AIDS for each of 50 regions is as shown below. Solve parts​ (a) through​ (d) below. 5656 2424 1212 590590 107107 650650 64676467 10251025 15531553 778778 599599 11561156 652652 193193 131131 7070 320320 55 1212 4444 9797 193193 14341434 894894 8686 989989 720720 13471347 47914791 195195 158158 464464 465465 190190 577577 220220 48714871 1313 2323 88 360360 118118 686686...