Calculate the probability that at least two people in a group share the same birthday. - MATLAB Cody - MATLAB Central

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

Difficulty:Rate

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

Solution Stats

44.94% Correct | 55.06% Incorrect
Last Solution submitted on May 03, 2025

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Group

CodeCrunch 1 Image
CodeCrunch 1
  • 11 Problems
  • 10 Finishers

Problem Recent Solvers94

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!