Problem 597. The Birthday Phenomenon
First off, leap years are not being considered for this. In fact the year that people are born shouldn't be taken into consideration, for simplicity.
The basic question is given an input, a single integer representing the number of people in the room (X >= 1). Return the probability that 2 or more people share the same birthday.
The return from the function should be a value between 0 and 1, inclusive. It should also be rounded out to the 10 thousandth decimal point (4 after the decimal point). There should be no trailing zeros included.
Solution Stats
Problem Comments
-
6 Comments
The problem should state truncate at the 10 thousandth point. n=50 is .97037 so the correct rounded answer is .9704 not .9703.
Instruction is to round, but correct answers are truncated (.9703 vs .9704)
I've used the function floor instead of round, because of the issue mentioned above and it worked.
Solution Comments
Show commentsProblem Recent Solvers211
Suggested Problems
-
Sum all integers from 1 to 2^n
15744 Solvers
-
Back to basics 12 - Input Arguments
602 Solvers
-
595 Solvers
-
736 Solvers
-
ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
564 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!