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 commentsGroup

Programování - Cody
- 12 Problems
- 466 Finishers
- Find the sum of all the numbers of the input vector
- Maximum value in a matrix
- Make the vector [1 2 3 4 5 6 7 8 9 10]
- Return area of square
- Select every other element of a vector
- Triangle Numbers
- Check if number exists in vector
- Create times-tables
- Determine whether a vector is monotonically increasing
- Roll the Dice!
- Verify Law of Large Numbers
- Solve a System of Linear Equations
Problem Recent Solvers213
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!