1. 学习
  2. /
  3. 课程
  4. /
  5. Probability Puzzles in R

Connected

练习

Make a plot

Finally, let us construct a plot that shows the probability of a match by sample size, using the pbirthday function that we practiced using in the previous exercise.

说明

100 XP
  • Set the variable room_sizes equal to the set of integers from 1 through 50.
  • Run the pbirthday function in an sapply call with the vector of room sizes and store the result as match_probs.
  • Make a plot with room size on the x-axis and match probability on the y-axis, using the two variables that you created.