Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 597. The Birthday Phenomenon

Created by Ben Ausdenmoore

First off, leap years are not being considered for this. In fact the year that people are born shouln't be taken into consideration, for simplicity =P.

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.

*Side note: being my first problem I'm certainly open to critques as far as setting it up, clarity and of course the test suite.

Tags

Problem Group

Solution Statistics

35 correct solutions 97 incorrect solutions
Last solution submitted on Jul 11, 2014

Problem Comments