# Expected value of the modified Birthday problem

If I want the expected number of triples (not pairs) out of n people that are have birthdays of within 1 day of each other

$${n \choose 3}*\frac{\text{something}}{365^2}$$

I know that the first bday is given, but how do I count the ways in which the other two can have their bdays fall within the qualified statement. I know I have 3 options for Person 2 but person 3's match depends upon person 2's match.

-

The factor $n \choose 3$ is just the number of triplets, so let us concentrate on the probability that the first three people are within one day (presumably you mean a span of two days). The first can be anything. If the second matches exactly (chance $\frac 1{365}$) the third can be any of three days (chance $\frac 3{365}$). If the second is one of the two neighboring days (chance $\frac 2{365}$) then the third has only two choices (again chance $\frac 2{365}$). So the total probability is $\frac {1\cdot 3 + 2 \cdot 2}{365^2}=\frac 7{365^2}$ Then the expected number of matches is ${n \choose 3} \frac 7{365^2}$

-

Given three people (A,B,C), and assuming that each birthday is an independent choice from the integers mod $365$, there are $7$ ways that the three birthdays could all be within one day of each other. Let's say A's birthday is on day $a$.

• three ways with B and C on the same day, which is one of $\{a-1, a, a+1\}$
• two with C one day after B, so B on $a-1$ or $a$.
• two with C one day before B, so B on $a$ or $a+1$.

So the probability that (A,B,C) have their birthdays within one day of each other is $7/365^2$. There are $n \choose 3$ unordered triples, so the expected number is ${n \choose 3} \frac{7}{365^2}$.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9460462927818298, "perplexity": 344.7557370242378}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-32/segments/1438042987034.19/warc/CC-MAIN-20150728002307-00189-ip-10-236-191-2.ec2.internal.warc.gz"}