Minimising the probability of two people having the same birthday?












1












$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!










share|cite|improve this question









$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
















1












$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!










share|cite|improve this question









$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














1












1








1





$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!










share|cite|improve this question









$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






share|cite|improve this question













share|cite|improve this question











share|cite|improve this question




share|cite|improve this question










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


















  • $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










1 Answer
1






active

oldest

votes


















2












$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).






share|cite|improve this answer











$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











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
});


}
});














draft saved

draft discarded


















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









2












$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).






share|cite|improve this answer











$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
















2












$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).






share|cite|improve this answer











$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














2












2








2





$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).






share|cite|improve this answer











$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).







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








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


















  • $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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

'app-layout' is not a known element: how to share Component with different Modules

android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

WPF add header to Image with URL pettitions [duplicate]