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

Randomness
- 11 Problems
- 19 Finishers
- Given n, create n random numbers such that their standard deviation is also n.
- Generating random matrix with given probability mass function
- Roll the Dice!
- Make a random, non-repeating vector.
- Generate a random matrix A of (1,-1)
- Create a random vector of integers with given sum
- Guess the number I'm thinking of (Part 1)
- Fibonacci Decomposition
- Cryptomath: Addition
- Break it up! Break it up!
- Balanced Ternary Numbers: Easy as |, |-, |o
Problem Recent Solvers213
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!