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

M3 Challenge Problem Group
- 20 Problems
- 21 Finishers
- Add two numbers
- Return area of square
- Make the vector [1 2 3 4 5 6 7 8 9 10]
- Calculate Amount of Cake Frosting
- Sum all integers from 1 to 2^n
- Reverse the vector
- Magic is simple (for beginners)
- Solve a System of Linear Equations
- Roll the Dice!
- Chess probability
- Throwing Dice - Will You Be Eaten By The Dragon?
- The Birthday Phenomenon
- Fibonacci sequence
- Monte-Carlo integration
- Make a Plot with Functions
- Differential equations I
- Numerical Integration
- Create initial basic feasible solution for transportation problems - North-West Corner Method
- Create initial basic feasible solution for transportation problems -Minimum Cost Method
- There are 10 types of people in the world
Problem Recent Solvers218
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!