Question
Balls and Cells If n indistinguishable balls are placed randomly into n cells, the probability that exactly one cell remains empty is calculated to
Balls and Cells If n indistinguishable balls are placed randomly into n cells, the probability that exactly one cell remains empty is calculated to be (2); n! 2nn Write a function "exactly_one_cell" takes input n, and performs one run of this experiment. Hint: the "unique" function applied to a vector gives the unique entries in a vector. You can sample a set of size n (with replacement) from 1, 2, 3, 4, 5, ..., n, and check if the number of unique entries in this set is (n-1). #define the function 'exactly_one_cell'sds #takes input number of cells, #output: true if exactly one cell is empty, else false. n <3 #balls_to_cell_exp
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started