MATLAB Answers

Birthday problem with 3+ people?

4 ビュー (過去 30 日間)
scoob
scoob 2019 年 10 月 22 日
編集済み: scoob 2019 年 10 月 22 日
I would like to use Matlab to figure out the probability that at least 3 people have the same birthday in a sample size of 50 people, but am having trouble figuring out how to do the counting. A series of loops perhaps?

  0 件のコメント

サインイン to comment.

採用された回答

Jon
Jon 2019 年 10 月 22 日
Here are some ideas that you might use
To generate random birthdays for groups of 50 people - look at randi, ignoring leap years birthdays are numbers between 1 and 365
For each random sample group of 50 people you can use histcounts with 365 bins to count how many people have each birthday
with result of histcounts, you can determine if the sample has three or more people with the same birthday by taking the max and seeing if it is greater than or equal 3
do this N times and then estimate the probability as the number of times that you have 3 or more people with same birthday divided by N

  0 件のコメント

サインイン to comment.

その他の回答 (0 件)

サインイン してこの質問に回答します。


Translated by