0

Does anyone know how I could use matlab to calculate the probability of throwing 10 balls at 3 buckets? Bucket 1 has a 1/4 chance, bucket 2 has a 1/2 chance and bucket 3 has a 1/4 chance. So how would I use MATLAB to calculate the probability of getting 2 in bucket 1, 5 in bucket 2 and 3 in bucket 3. There are over 59,000 outcomes in the sample space so trying to use MATLAB but can't think how.

Edward
  • 1
  • 2
    I would compute it as $$\binom{10}{2,5,3}\left(\frac{1}{4}\right)^2\left(\frac{1}{2}\right)^5 \left(\frac{1}{4}\right)^3=\frac{315}{4096}.$$ This raises the question of what you mean by "calculate": do you want to estimate the probability by simulation, compute it by means of exhaustive enumeration, or derive and apply a formula? – whuber Mar 19 '15 at 15:22
  • I guess he means simulate? Maybe not. – snoram Mar 19 '15 at 16:21
  • I meant simulate over many times using rand() somehow? – Edward Mar 19 '15 at 20:06
  • This may help: http://stackoverflow.com/questions/13914066/generate-random-number-with-given-probability-matlab – jeff Sep 19 '15 at 23:13

0 Answers0