Discover MakerZone

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

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!

Problem 1267. Calculate the probability that at least two people in a group share the same birthday.

Created by Jeremy

Calculate the probability that at least two people in a group share the same birthday. Given an integer input n, return to 0.015 (1.5%) precision the probability of this being the case. Assume that every day is equally probable as a birthday and ignore the leap year.

Example:

Input: 1
Output: 0.00
Input: 366
Output: 1.00

Problem Group

Solution Statistics

53 correct solutions 28 incorrect solutions
Last solution submitted on Jun 28, 2016