Question

In: Statistics and Probability

Fifteen six-sided dice are placed in a cup. The cup is shaken and turned over on...

Fifteen six-sided dice are placed in a cup. The cup is shaken and turned over on a table, and the number of 1s is recorded. Use R commands to find the probabilities and histogram for the number of possible 1s. Please show the way I should set this up in R.

Solutions

Expert Solution

The possible values that 1 six sided die can land on are 1 to 6. The probability that a 6 sided die lands on a given value is 1/6

We will use the R command sample() to simulate 1 throw of 15 dice. That is we will simulate as if we are drawing a sample of size 15, with replacement from a jar which has 6 balls numbered 1 to 6

sample(1:6, size=15, prob=rep(1/6,6),replace=TRUE). The first input 1:6 says that the jar has 6 balls numbered 1 to 6. size=15 says select 15 balls from this jar which has 6 balls (so replace the ball using replace=TRUE after selecting each of the 15), prob=rep(1/6,6) says that the probability of selecting any given number from the jar is 1/6. Since there are 6 numbers, we need to set 6 values. hence rep(1/6,6) repeats the value 1/6 six times.

The R code (all statements starting with # are comments, you can remove them)

#set the random seed
set.seed(123)
#set the number of simulations
R<-1000

#initialize a variable to hols the number of 1s
y<-numeric(R)
#get 1000 samples of a throw of 15 dice
for (i in 1:R){
#throw 15 six sided fair dice and get the results
s<-sample(1:6,size=15,prob=rep(1/6,6),replace=TRUE)
#count the number of 1s and store
y[i]<-sum(s==1)
}

#print the probabilities
prob<-data.frame(table(y)/R)
colnames(prob)<-c("# of 1s","Prob")
prob
#plot a histogram
barplot(prob[,2],names.arg=prob[,1],main="Histogram of 1s",xlab="number of 1s",ylab="Probabilities")
box("plot")

#get this output

#get this plot


Related Solutions

Throw a pair of fair, six-sided dice, over and over again, until either a 6 or...
Throw a pair of fair, six-sided dice, over and over again, until either a 6 or 10 comes up. What is the probability of event E, that 6 comes up first?
An experiment consists of rolling six-sided dice twice.                                  &
An experiment consists of rolling six-sided dice twice.                                      (10) List the sample space for this experiment. Find the probability distribution for this experiment where x represents the number of even numbers in the 2 rolls. Find the mean of the probability distribution. Find the standard deviation of the probability distribution. Would it be unusual to get 2 even numbers? Why or why not? (show your work)
1. Three six-sided dice are rolled. Let X be the sum of the dice. Determine the...
1. Three six-sided dice are rolled. Let X be the sum of the dice. Determine the range of X and compute P(X = 18) and P(X ≤ 4). 2. An urn contains 5 red balls and 3 green balls. (a) Draw 3 balls with replacement. Let X be the number of red balls drawn. Determine the range of X and compute P(X = 3) and P(X 6= 1). (b) Draw 3 balls without replacement. Let Y be the number of...
Consider a six-sided fair dice. Complete the following tables for this die: Number on the dice...
Consider a six-sided fair dice. Complete the following tables for this die: Number on the dice Number of times it appears on the dice Relative frequency of seeing that number 1 2 3 4 5 6 Total This is the entire question, does not say how many times the dice is thrown
A player pays $ 13 to roll three six-sided balanced dice. If the sum of the...
A player pays $ 13 to roll three six-sided balanced dice. If the sum of the 3 dice is less than 13, then the player will receive a prize of $ 70. Otherwise, you lose the $13. a. Find the expected value of profit.
Two six-sided dice are rolled and the sum is observed. Define events A and B as...
Two six-sided dice are rolled and the sum is observed. Define events A and B as follows: Event A: The sum is odd. Event B: The sum is less than 9. Find P(A or B) Please use formula P(A) + P(B) - P(A x B) So I can understand how to use it. Thank you.
. Three Dice of a Kind Consider the following game: You roll six 6-sided dice d1,…,d6...
. Three Dice of a Kind Consider the following game: You roll six 6-sided dice d1,…,d6 and you win if some number appears 3 or more times. For example, if you roll: (3,3,5,4,6,6) then you lose. If you roll (4,1,3,6,4,4) then you win. What is the probability that you win this game?
When two fair six-sided dice are simultaneously thrown, these are two of the possible results that...
When two fair six-sided dice are simultaneously thrown, these are two of the possible results that could occur: Result 1: a 5 and a 6 are obtained in any order. result 2: a 5 is obtained on each die. Which of the following statements is correct? Explain reasoning. a. the prob. is equal b. prob of result 1 is higher c. prob of result 2 is higher
Two fair six sided dice are rolled. (i) What is the probability that the smaller value...
Two fair six sided dice are rolled. (i) What is the probability that the smaller value of the two results is 3 given that the sum of the two results is 8? (ii) What is the probability that the sum of the two results is at most 5 given that the number 2 appeared at least once? (iii) What is the probability that the sum of the two results is 7 given that exactly one of the two results is...
suppose that you are tossing two six sided dice one by one. What is the probability...
suppose that you are tossing two six sided dice one by one. What is the probability that (a) you will observe a total of 10? (b) You will observe a six on any dice? (c) You will observe a total at most of 7? (d) You will observe at least 11?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT