{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"birthday-problem"},"result":{"entity_type":"calculator","id":"birthday-problem","calculator_id":"birthday-problem","canonical_url":"https://tttkmbb.com/statistics/birthday-problem","name":"Birthday Problem Calculator","title":"Birthday Problem Calculator – Probability that Two People in a Group Share a Birthday","category":"statistics","category_name":"Statistics & Probability","tool_name":"calculate_birthday_problem_probability","featured_mcp_tool":false,"description":"Computes the probability that at least two of n people share a birthday in a year of a given length (365 days by default), the complementary probability that all birthdays differ, the expected number of matching pairs, and the group sizes at which the chance reaches 50 % and 99 %.","use_when":"You want the classic birthday-paradox probability for a group, or the same collision probability for any set of equally likely categories (hash values, PINs, tokens).","do_not_use_when":"You want the probability that someone shares a specific person's birthday (that is 1 − (364/365)^(n−1), a different question), or birthdays are far from uniform.","inputs":[{"name":"people","label":"Number of people","type":"integer","required":true,"min":1,"max":100000,"description":"Size of the group.","example":23},{"name":"days","label":"Days in the year (categories)","type":"integer","required":false,"default":365,"min":1,"max":1000000,"description":"Number of equally likely birthdays or categories (365 ignores leap days; use 366 to include them).","example":365}],"outputs":[{"name":"probability_shared","label":"P(at least one shared birthday)","type":"number","decimals":6,"description":"1 − P(all different)."},{"name":"probability_shared_percent","label":"P(shared)","type":"number","unit":"%","decimals":2,"description":"Same probability in percent."},{"name":"probability_all_different","label":"P(all different)","type":"number","decimals":6,"description":"Π_{i=0}^{n−1} (1 − i/days)."},{"name":"expected_matching_pairs","label":"Expected matching pairs","type":"number","decimals":4,"description":"C(n, 2) / days: expected number of pairs sharing a birthday."},{"name":"people_for_50_percent","label":"People needed for 50 %","type":"integer","decimals":4,"description":"Smallest group with at least a 50 % chance of a shared birthday."},{"name":"people_for_99_percent","label":"People needed for 99 %","type":"integer","decimals":4,"description":"Smallest group with at least a 99 % chance."}],"input_schema":{"type":"object","properties":{"people":{"description":"Size of the group.","type":"integer","minimum":1,"maximum":100000,"examples":[23]},"days":{"description":"Number of equally likely birthdays or categories (365 ignores leap days; use 366 to include them).","type":"integer","minimum":1,"maximum":1000000,"default":365,"examples":[365]}},"additionalProperties":false,"required":["people"]},"output_schema":{"type":"object","properties":{"probability_shared":{"description":"1 − P(all different).","type":"number"},"probability_shared_percent":{"description":"Same probability in percent. Unit: %.","type":"number","x-unit":"%"},"probability_all_different":{"description":"Π_{i=0}^{n−1} (1 − i/days).","type":"number"},"expected_matching_pairs":{"description":"C(n, 2) / days: expected number of pairs sharing a birthday.","type":"number"},"people_for_50_percent":{"description":"Smallest group with at least a 50 % chance of a shared birthday.","type":"integer"},"people_for_99_percent":{"description":"Smallest group with at least a 99 % chance.","type":"integer"}}},"formula":"P(all different) = Π_{i=0}^{people−1} (1 − i/days) = days! / ((days − people)! · days^people); P(shared) = 1 − P(all different); expected pairs = people·(people − 1) / (2·days)","method":"Assumes birthdays are independent and uniformly distributed over the days. With more people than days the probability is exactly 1 (pigeonhole principle). Real birthdays are slightly non-uniform, which raises the probability marginally.","sources":[{"name":"Wikipedia – Birthday problem","url":"https://en.wikipedia.org/wiki/Birthday_problem","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wolfram MathWorld – Birthday Problem","url":"https://mathworld.wolfram.com/BirthdayProblem.html","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"23 people","inputs":{"people":23},"expected":{"probability_shared":0.507297,"probability_shared_percent":50.73,"probability_all_different":0.492703,"expected_matching_pairs":0.6932,"people_for_50_percent":23,"people_for_99_percent":57},"url":"https://tttkmbb.com/api/v1/calculate/birthday-problem?people=23"},{"name":"30 people","inputs":{"people":30,"days":365},"expected":{"probability_shared":0.706316,"probability_shared_percent":70.63,"expected_matching_pairs":1.1918},"url":"https://tttkmbb.com/api/v1/calculate/birthday-problem?people=30&days=365"}],"faq":[{"q":"Why only 23 people for a 50 % chance?","a":"There are C(23, 2) = 253 pairs of people, and each pair has a 1/365 chance of matching; it is the number of pairs, not the number of people, that grows quickly."},{"q":"What about leap years?","a":"Set days = 366 to include 29 February as an equally likely day; the effect on the probability is tiny (50.63 % instead of 50.73 % for 23 people)."}],"tags":["birthday problem","birthday paradox","shared birthday probability","collision probability","same birthday"],"related":[{"calculator_id":"probability-of-events","reason":"Combine probabilities of two events."},{"calculator_id":"combinations-permutations","reason":"Count the pairs C(n, 2) behind the paradox."}],"links":{"html":"https://tttkmbb.com/statistics/birthday-problem","markdown":"https://tttkmbb.com/statistics/birthday-problem.md","json":"https://tttkmbb.com/statistics/birthday-problem.json","api":"https://tttkmbb.com/api/v1/calculate/birthday-problem","schema":"https://tttkmbb.com/api/v1/calculators/birthday-problem","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T01:46:04Z","next_actions":[{"tool":"run_calculator","calculator_id":"birthday-problem","reason":"Run Birthday Problem Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/statistics/birthday-problem.md"}}