Minimising the probability of two people having the same birthday?
$begingroup$
I was asked a particularly weird question at an interview today:
Suppose Alice and Bob live on a universe in which a year has $k$ days. What probability distribution of birthdays would you choose to a) maximise; and b) minimise the probability of the two of them to have the same birthday?
For a), I said Dirac delta, which was correct. For b), my interviewer said it should be a uniform probability distribution. I can’t see why at all. Is there a mathematical proof of this? Not too sure how to even begin. Thank you!
probability probability-distributions birthday
$endgroup$
add a comment |
$begingroup$
I was asked a particularly weird question at an interview today:
Suppose Alice and Bob live on a universe in which a year has $k$ days. What probability distribution of birthdays would you choose to a) maximise; and b) minimise the probability of the two of them to have the same birthday?
For a), I said Dirac delta, which was correct. For b), my interviewer said it should be a uniform probability distribution. I can’t see why at all. Is there a mathematical proof of this? Not too sure how to even begin. Thank you!
probability probability-distributions birthday
$endgroup$
$begingroup$
Start with $k=2$. How do you minimise the probability of Alice and Bob sharing a birthday in this case?
$endgroup$
– postmortes
Jan 25 at 13:52
add a comment |
$begingroup$
I was asked a particularly weird question at an interview today:
Suppose Alice and Bob live on a universe in which a year has $k$ days. What probability distribution of birthdays would you choose to a) maximise; and b) minimise the probability of the two of them to have the same birthday?
For a), I said Dirac delta, which was correct. For b), my interviewer said it should be a uniform probability distribution. I can’t see why at all. Is there a mathematical proof of this? Not too sure how to even begin. Thank you!
probability probability-distributions birthday
$endgroup$
I was asked a particularly weird question at an interview today:
Suppose Alice and Bob live on a universe in which a year has $k$ days. What probability distribution of birthdays would you choose to a) maximise; and b) minimise the probability of the two of them to have the same birthday?
For a), I said Dirac delta, which was correct. For b), my interviewer said it should be a uniform probability distribution. I can’t see why at all. Is there a mathematical proof of this? Not too sure how to even begin. Thank you!
probability probability-distributions birthday
probability probability-distributions birthday
asked Jan 25 at 13:44
user107224user107224
463314
463314
$begingroup$
Start with $k=2$. How do you minimise the probability of Alice and Bob sharing a birthday in this case?
$endgroup$
– postmortes
Jan 25 at 13:52
add a comment |
$begingroup$
Start with $k=2$. How do you minimise the probability of Alice and Bob sharing a birthday in this case?
$endgroup$
– postmortes
Jan 25 at 13:52
$begingroup$
Start with $k=2$. How do you minimise the probability of Alice and Bob sharing a birthday in this case?
$endgroup$
– postmortes
Jan 25 at 13:52
$begingroup$
Start with $k=2$. How do you minimise the probability of Alice and Bob sharing a birthday in this case?
$endgroup$
– postmortes
Jan 25 at 13:52
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
This is how you do that formally:
Let $P_1,....,P_k$ be the probabilities of being born in day $1,...,k$.
Then the probability that Alice and Bob were born the same day is
$$sum_{i=1}^k P_i^2$$ where $P_i^2$ is the probability that Alice and Bob were born in day $i$.
Hence you want to minimize $sum_{i=1}^k P_i^2$ given that $P_1+...+P_k=1$. Using Lagrange multipliers you can show that the minimum is achieved where $P_i=frac{1}{k}$ (If you want to be completely rigorous then see my comment to my answer below).
Indeed let $f(P_1,...,P_k):=sum_{i=1}^k P_i^2$ and $g(P_1,...,P_k)=sum_{i=1}^k P_i -1$ Let $L(P_1,...,P_k,lambda) = f(P_1,....,P_k)-lambda g(P_1,...,P_k)$ We compute the partial derivatives
$$partial_{P_i} L = 2P_i -lambda P_i$$ and $$partial_{lambda} L = g(P_1,...,P_k)$$
Hence we have $2P_i-lambda = 0$ and so $lambda = 2P_i$ this implies that all $P_i$ are equal. Since $g(P_1,...,P_k)=0$ we have that $P_i=frac{1}{k}$ for all $i$.
The intuition behind this is that if the probability to be born in one day is higher than the others it is more likely that Alice and Bob will be born in this day (the extreme case, as you mentioned is the dirac measure which means that the probability to be born at the $i$'th day is $1$, hence Alice and Bob have to be born at the same day).
$endgroup$
$begingroup$
I should note that in order to be completely rigorous one needs to show that a minimum exists before applying the Lagrange multipliers. However this is easy because ${P_1,...,P_k : g(P_1,...,P_k)=0}$ is compact and $f$ a continuous function.
$endgroup$
– Yanko
Jan 25 at 14:04
$begingroup$
Brilliant, thank you!
$endgroup$
– user107224
Jan 25 at 17:07
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "69"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3087112%2fminimising-the-probability-of-two-people-having-the-same-birthday%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
This is how you do that formally:
Let $P_1,....,P_k$ be the probabilities of being born in day $1,...,k$.
Then the probability that Alice and Bob were born the same day is
$$sum_{i=1}^k P_i^2$$ where $P_i^2$ is the probability that Alice and Bob were born in day $i$.
Hence you want to minimize $sum_{i=1}^k P_i^2$ given that $P_1+...+P_k=1$. Using Lagrange multipliers you can show that the minimum is achieved where $P_i=frac{1}{k}$ (If you want to be completely rigorous then see my comment to my answer below).
Indeed let $f(P_1,...,P_k):=sum_{i=1}^k P_i^2$ and $g(P_1,...,P_k)=sum_{i=1}^k P_i -1$ Let $L(P_1,...,P_k,lambda) = f(P_1,....,P_k)-lambda g(P_1,...,P_k)$ We compute the partial derivatives
$$partial_{P_i} L = 2P_i -lambda P_i$$ and $$partial_{lambda} L = g(P_1,...,P_k)$$
Hence we have $2P_i-lambda = 0$ and so $lambda = 2P_i$ this implies that all $P_i$ are equal. Since $g(P_1,...,P_k)=0$ we have that $P_i=frac{1}{k}$ for all $i$.
The intuition behind this is that if the probability to be born in one day is higher than the others it is more likely that Alice and Bob will be born in this day (the extreme case, as you mentioned is the dirac measure which means that the probability to be born at the $i$'th day is $1$, hence Alice and Bob have to be born at the same day).
$endgroup$
$begingroup$
I should note that in order to be completely rigorous one needs to show that a minimum exists before applying the Lagrange multipliers. However this is easy because ${P_1,...,P_k : g(P_1,...,P_k)=0}$ is compact and $f$ a continuous function.
$endgroup$
– Yanko
Jan 25 at 14:04
$begingroup$
Brilliant, thank you!
$endgroup$
– user107224
Jan 25 at 17:07
add a comment |
$begingroup$
This is how you do that formally:
Let $P_1,....,P_k$ be the probabilities of being born in day $1,...,k$.
Then the probability that Alice and Bob were born the same day is
$$sum_{i=1}^k P_i^2$$ where $P_i^2$ is the probability that Alice and Bob were born in day $i$.
Hence you want to minimize $sum_{i=1}^k P_i^2$ given that $P_1+...+P_k=1$. Using Lagrange multipliers you can show that the minimum is achieved where $P_i=frac{1}{k}$ (If you want to be completely rigorous then see my comment to my answer below).
Indeed let $f(P_1,...,P_k):=sum_{i=1}^k P_i^2$ and $g(P_1,...,P_k)=sum_{i=1}^k P_i -1$ Let $L(P_1,...,P_k,lambda) = f(P_1,....,P_k)-lambda g(P_1,...,P_k)$ We compute the partial derivatives
$$partial_{P_i} L = 2P_i -lambda P_i$$ and $$partial_{lambda} L = g(P_1,...,P_k)$$
Hence we have $2P_i-lambda = 0$ and so $lambda = 2P_i$ this implies that all $P_i$ are equal. Since $g(P_1,...,P_k)=0$ we have that $P_i=frac{1}{k}$ for all $i$.
The intuition behind this is that if the probability to be born in one day is higher than the others it is more likely that Alice and Bob will be born in this day (the extreme case, as you mentioned is the dirac measure which means that the probability to be born at the $i$'th day is $1$, hence Alice and Bob have to be born at the same day).
$endgroup$
$begingroup$
I should note that in order to be completely rigorous one needs to show that a minimum exists before applying the Lagrange multipliers. However this is easy because ${P_1,...,P_k : g(P_1,...,P_k)=0}$ is compact and $f$ a continuous function.
$endgroup$
– Yanko
Jan 25 at 14:04
$begingroup$
Brilliant, thank you!
$endgroup$
– user107224
Jan 25 at 17:07
add a comment |
$begingroup$
This is how you do that formally:
Let $P_1,....,P_k$ be the probabilities of being born in day $1,...,k$.
Then the probability that Alice and Bob were born the same day is
$$sum_{i=1}^k P_i^2$$ where $P_i^2$ is the probability that Alice and Bob were born in day $i$.
Hence you want to minimize $sum_{i=1}^k P_i^2$ given that $P_1+...+P_k=1$. Using Lagrange multipliers you can show that the minimum is achieved where $P_i=frac{1}{k}$ (If you want to be completely rigorous then see my comment to my answer below).
Indeed let $f(P_1,...,P_k):=sum_{i=1}^k P_i^2$ and $g(P_1,...,P_k)=sum_{i=1}^k P_i -1$ Let $L(P_1,...,P_k,lambda) = f(P_1,....,P_k)-lambda g(P_1,...,P_k)$ We compute the partial derivatives
$$partial_{P_i} L = 2P_i -lambda P_i$$ and $$partial_{lambda} L = g(P_1,...,P_k)$$
Hence we have $2P_i-lambda = 0$ and so $lambda = 2P_i$ this implies that all $P_i$ are equal. Since $g(P_1,...,P_k)=0$ we have that $P_i=frac{1}{k}$ for all $i$.
The intuition behind this is that if the probability to be born in one day is higher than the others it is more likely that Alice and Bob will be born in this day (the extreme case, as you mentioned is the dirac measure which means that the probability to be born at the $i$'th day is $1$, hence Alice and Bob have to be born at the same day).
$endgroup$
This is how you do that formally:
Let $P_1,....,P_k$ be the probabilities of being born in day $1,...,k$.
Then the probability that Alice and Bob were born the same day is
$$sum_{i=1}^k P_i^2$$ where $P_i^2$ is the probability that Alice and Bob were born in day $i$.
Hence you want to minimize $sum_{i=1}^k P_i^2$ given that $P_1+...+P_k=1$. Using Lagrange multipliers you can show that the minimum is achieved where $P_i=frac{1}{k}$ (If you want to be completely rigorous then see my comment to my answer below).
Indeed let $f(P_1,...,P_k):=sum_{i=1}^k P_i^2$ and $g(P_1,...,P_k)=sum_{i=1}^k P_i -1$ Let $L(P_1,...,P_k,lambda) = f(P_1,....,P_k)-lambda g(P_1,...,P_k)$ We compute the partial derivatives
$$partial_{P_i} L = 2P_i -lambda P_i$$ and $$partial_{lambda} L = g(P_1,...,P_k)$$
Hence we have $2P_i-lambda = 0$ and so $lambda = 2P_i$ this implies that all $P_i$ are equal. Since $g(P_1,...,P_k)=0$ we have that $P_i=frac{1}{k}$ for all $i$.
The intuition behind this is that if the probability to be born in one day is higher than the others it is more likely that Alice and Bob will be born in this day (the extreme case, as you mentioned is the dirac measure which means that the probability to be born at the $i$'th day is $1$, hence Alice and Bob have to be born at the same day).
edited Jan 25 at 14:05
answered Jan 25 at 13:56
YankoYanko
7,8801830
7,8801830
$begingroup$
I should note that in order to be completely rigorous one needs to show that a minimum exists before applying the Lagrange multipliers. However this is easy because ${P_1,...,P_k : g(P_1,...,P_k)=0}$ is compact and $f$ a continuous function.
$endgroup$
– Yanko
Jan 25 at 14:04
$begingroup$
Brilliant, thank you!
$endgroup$
– user107224
Jan 25 at 17:07
add a comment |
$begingroup$
I should note that in order to be completely rigorous one needs to show that a minimum exists before applying the Lagrange multipliers. However this is easy because ${P_1,...,P_k : g(P_1,...,P_k)=0}$ is compact and $f$ a continuous function.
$endgroup$
– Yanko
Jan 25 at 14:04
$begingroup$
Brilliant, thank you!
$endgroup$
– user107224
Jan 25 at 17:07
$begingroup$
I should note that in order to be completely rigorous one needs to show that a minimum exists before applying the Lagrange multipliers. However this is easy because ${P_1,...,P_k : g(P_1,...,P_k)=0}$ is compact and $f$ a continuous function.
$endgroup$
– Yanko
Jan 25 at 14:04
$begingroup$
I should note that in order to be completely rigorous one needs to show that a minimum exists before applying the Lagrange multipliers. However this is easy because ${P_1,...,P_k : g(P_1,...,P_k)=0}$ is compact and $f$ a continuous function.
$endgroup$
– Yanko
Jan 25 at 14:04
$begingroup$
Brilliant, thank you!
$endgroup$
– user107224
Jan 25 at 17:07
$begingroup$
Brilliant, thank you!
$endgroup$
– user107224
Jan 25 at 17:07
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3087112%2fminimising-the-probability-of-two-people-having-the-same-birthday%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
$begingroup$
Start with $k=2$. How do you minimise the probability of Alice and Bob sharing a birthday in this case?
$endgroup$
– postmortes
Jan 25 at 13:52