How to solve a Multinomial Distribution IN MATLAB

조회 수: 1 (최근 30일)
jawaher shah
jawaher shah 2019년 4월 21일
답변: Image Analyst 2019년 4월 21일
hello, i'm trying to solve this question using Matlab
According to USA Today (March 18, 1997), of 4 million workers in the general workforce, 0.8% tested positive for drugs. Of those testing positive, 22.5% were cocaine users and 54.4% marijuana users.
(a) What is the probability that of 10 workers testing positive, 2 are cocaine users, 0 marijuana users, and 3 users of other drugs?
I solved it by hand as the following
p(2 Cocaine, 5 Marjuana, 3 Others) = 10!/2!5!3! (0.225)^2(0.544)^5(0.231)^3
but i'm not sure how to use the formula. Can you please help me and thanks in advance.

답변 (1개)

Image Analyst
Image Analyst 2019년 4월 21일
I believe that formula in MATLAB would be
p = factorial(10) / (factorial(2) * factorial(5) * factorial(3)) * (0.225)^2 * (0.544)^5 * (0.231)^3

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by