Exercise 1. Probability of cyan - generalized
In the edX exercises for this section, we calculated some probabilities by hand. Now we'll calculate those probabilities using R.
One ball will be drawn at random from a box containing: 3 cyan balls, 5 magenta balls, and 7 yellow balls.
What is the probability that the ball will be cyan?
This exercise is part of the course
HarvardX Data Science - Probability (PH125.3x)
Exercise instructions
- Define a variable
p
as the probability of choosing a cyan ball from the box. - Print the value of
p
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
cyan <- 3
magenta <- 5
yellow <- 7
# Assign a variable `p` as the probability of choosing a cyan ball from the box
# Print the variable `p` to the console