Using R to calculate probability of rolling 2 numbers in 20 throws [closed]Using R for dice probabilitiesHow to calculate the probability of the outcome of this convoluted dice rolling mechanic?How to find the cumulative probability of a multinomial?Probability of throwing n different numbers in m throws of a diceNumber of rolls to get my desired result with a set probabilityminimum number of rolls necessary to determine how many sides a die hasRolling one die after anotherProbability of a specific event when rolling a 6 sided die five timesRolling a $6$ Sided DieHow many times must I roll a die to confidently assess its fairness?
Is there a DSLR/mirorless camera with minimal options like a classic, simple SLR?
Why was this person allowed to become Grand Maester?
A word that means "blending into a community too much"
My boss want to get rid of me - what should I do?
How to learn Linux system internals
Can a human be transformed into a Mind Flayer?
Is an entry level DSLR going to shoot nice portrait pictures?
Is it expected that a reader will skip parts of what you write?
How do free-speech protections in the United States apply in public to corporate misrepresentations?
How can I deal with uncomfortable silence from my partner?
Why not invest in precious metals?
Reactive Programming
How can I make 12 tone and atonal melodies sound interesting?
Ability To Change Root User Password (Vulnerability?)
Non-aqueous eyes?
I have a problematic assistant manager, but I can't fire him
Why can I traceroute to this IP address, but not ping?
Should I put programming books I wrote a few years ago on my resume?
Did Apple bundle a specific monitor with the Apple II+ for schools?
Can the removal of a duty-free sales trolley result in a measurable reduction in emissions?
Increase speed altering column on large table to NON NULL
Why did Intel abandon unified CPU cache?
What does 思ってやっている mean?
With Ubuntu 18.04, how can I have a hot corner that locks the computer?
Using R to calculate probability of rolling 2 numbers in 20 throws [closed]
Using R for dice probabilitiesHow to calculate the probability of the outcome of this convoluted dice rolling mechanic?How to find the cumulative probability of a multinomial?Probability of throwing n different numbers in m throws of a diceNumber of rolls to get my desired result with a set probabilityminimum number of rolls necessary to determine how many sides a die hasRolling one die after anotherProbability of a specific event when rolling a 6 sided die five timesRolling a $6$ Sided DieHow many times must I roll a die to confidently assess its fairness?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
$begingroup$
We have an 8-sided die. Throwing it 20 times,
what is the probability of rolling a number larger than 6 at least 12 times and at most 16 times?
If you know of an efficient program to write so that I won't have to type in the maths manually, I would be so happy.
r probability dice
New contributor
$endgroup$
closed as off-topic by COOLSerdash, mkt, Siong Thye Goh, mdewey, Glen_b♦ Jun 2 at 16:24
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – COOLSerdash, mkt, Siong Thye Goh, mdewey, Glen_b
add a comment |
$begingroup$
We have an 8-sided die. Throwing it 20 times,
what is the probability of rolling a number larger than 6 at least 12 times and at most 16 times?
If you know of an efficient program to write so that I won't have to type in the maths manually, I would be so happy.
r probability dice
New contributor
$endgroup$
closed as off-topic by COOLSerdash, mkt, Siong Thye Goh, mdewey, Glen_b♦ Jun 2 at 16:24
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – COOLSerdash, mkt, Siong Thye Goh, mdewey, Glen_b
add a comment |
$begingroup$
We have an 8-sided die. Throwing it 20 times,
what is the probability of rolling a number larger than 6 at least 12 times and at most 16 times?
If you know of an efficient program to write so that I won't have to type in the maths manually, I would be so happy.
r probability dice
New contributor
$endgroup$
We have an 8-sided die. Throwing it 20 times,
what is the probability of rolling a number larger than 6 at least 12 times and at most 16 times?
If you know of an efficient program to write so that I won't have to type in the maths manually, I would be so happy.
r probability dice
r probability dice
New contributor
New contributor
New contributor
asked Jun 2 at 6:41
Fluffy WombatFluffy Wombat
182
182
New contributor
New contributor
closed as off-topic by COOLSerdash, mkt, Siong Thye Goh, mdewey, Glen_b♦ Jun 2 at 16:24
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – COOLSerdash, mkt, Siong Thye Goh, mdewey, Glen_b
closed as off-topic by COOLSerdash, mkt, Siong Thye Goh, mdewey, Glen_b♦ Jun 2 at 16:24
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "This question appears to be off-topic because EITHER it is not about statistics, machine learning, data analysis, data mining, or data visualization, OR it focuses on programming, debugging, or performing routine operations within a statistical computing platform. If the latter, you could try the support links we maintain." – COOLSerdash, mkt, Siong Thye Goh, mdewey, Glen_b
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
$begingroup$
The answer by CoolSerdash shows you how to simulate the probability of interest. Here is a direct probability calculation without simulation:
sides <- 8 # Number of sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Cut-off value (must roll above this)
n_lower <- 12 # Lower bound
n_upper <- 16 # Upper bound
prob <- (sides - no_cut)/sides;
pbinom(n_upper, throws, prob) - pbinom(n_lower-1, throws, prob);
[1] 0.000935362
$endgroup$
add a comment |
$begingroup$
Here is a quick implementation. I'm sure there are more efficient ways.
d <- 8 # Sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Number at least on die
n_lower <- 12 # Lower cutoff
n_upper <- 16 # Upper cutoff
n_sim <- 1000000 # Number of simulations
res <- NULL
res <- replicate(n_sim,
x <- sample.int(d, size = throws, replace = TRUE)
s <- sum(x > no_cut)
(s >= n_lower && s <= n_upper)
)
sum(res)/n_sim # simulated probability
$endgroup$
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
The answer by CoolSerdash shows you how to simulate the probability of interest. Here is a direct probability calculation without simulation:
sides <- 8 # Number of sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Cut-off value (must roll above this)
n_lower <- 12 # Lower bound
n_upper <- 16 # Upper bound
prob <- (sides - no_cut)/sides;
pbinom(n_upper, throws, prob) - pbinom(n_lower-1, throws, prob);
[1] 0.000935362
$endgroup$
add a comment |
$begingroup$
The answer by CoolSerdash shows you how to simulate the probability of interest. Here is a direct probability calculation without simulation:
sides <- 8 # Number of sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Cut-off value (must roll above this)
n_lower <- 12 # Lower bound
n_upper <- 16 # Upper bound
prob <- (sides - no_cut)/sides;
pbinom(n_upper, throws, prob) - pbinom(n_lower-1, throws, prob);
[1] 0.000935362
$endgroup$
add a comment |
$begingroup$
The answer by CoolSerdash shows you how to simulate the probability of interest. Here is a direct probability calculation without simulation:
sides <- 8 # Number of sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Cut-off value (must roll above this)
n_lower <- 12 # Lower bound
n_upper <- 16 # Upper bound
prob <- (sides - no_cut)/sides;
pbinom(n_upper, throws, prob) - pbinom(n_lower-1, throws, prob);
[1] 0.000935362
$endgroup$
The answer by CoolSerdash shows you how to simulate the probability of interest. Here is a direct probability calculation without simulation:
sides <- 8 # Number of sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Cut-off value (must roll above this)
n_lower <- 12 # Lower bound
n_upper <- 16 # Upper bound
prob <- (sides - no_cut)/sides;
pbinom(n_upper, throws, prob) - pbinom(n_lower-1, throws, prob);
[1] 0.000935362
answered Jun 2 at 7:52
BenBen
31.6k236137
31.6k236137
add a comment |
add a comment |
$begingroup$
Here is a quick implementation. I'm sure there are more efficient ways.
d <- 8 # Sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Number at least on die
n_lower <- 12 # Lower cutoff
n_upper <- 16 # Upper cutoff
n_sim <- 1000000 # Number of simulations
res <- NULL
res <- replicate(n_sim,
x <- sample.int(d, size = throws, replace = TRUE)
s <- sum(x > no_cut)
(s >= n_lower && s <= n_upper)
)
sum(res)/n_sim # simulated probability
$endgroup$
add a comment |
$begingroup$
Here is a quick implementation. I'm sure there are more efficient ways.
d <- 8 # Sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Number at least on die
n_lower <- 12 # Lower cutoff
n_upper <- 16 # Upper cutoff
n_sim <- 1000000 # Number of simulations
res <- NULL
res <- replicate(n_sim,
x <- sample.int(d, size = throws, replace = TRUE)
s <- sum(x > no_cut)
(s >= n_lower && s <= n_upper)
)
sum(res)/n_sim # simulated probability
$endgroup$
add a comment |
$begingroup$
Here is a quick implementation. I'm sure there are more efficient ways.
d <- 8 # Sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Number at least on die
n_lower <- 12 # Lower cutoff
n_upper <- 16 # Upper cutoff
n_sim <- 1000000 # Number of simulations
res <- NULL
res <- replicate(n_sim,
x <- sample.int(d, size = throws, replace = TRUE)
s <- sum(x > no_cut)
(s >= n_lower && s <= n_upper)
)
sum(res)/n_sim # simulated probability
$endgroup$
Here is a quick implementation. I'm sure there are more efficient ways.
d <- 8 # Sides of the die
throws <- 20 # Number of throws
no_cut <- 6 # Number at least on die
n_lower <- 12 # Lower cutoff
n_upper <- 16 # Upper cutoff
n_sim <- 1000000 # Number of simulations
res <- NULL
res <- replicate(n_sim,
x <- sample.int(d, size = throws, replace = TRUE)
s <- sum(x > no_cut)
(s >= n_lower && s <= n_upper)
)
sum(res)/n_sim # simulated probability
answered Jun 2 at 7:00
COOLSerdashCOOLSerdash
16.8k75395
16.8k75395
add a comment |
add a comment |