Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose we choose a random number n from 0..100.Y and X are discrete random independent variables that have uniform distribution with 0...n.If Y+X equals to 15 what is expectancy of n?

share|cite|improve this question
Only integer values allowed, I suppose? – Raskolnikov Feb 12 '11 at 12:56
yes it is a discrete distribution – Yakov Feb 12 '11 at 13:00
up vote 2 down vote accepted

Following up Henry's answer and comment, if we assume than $n$ is a fixed but unknown number and $X$ and $Y$ are independent discrete random variables uniformly distributed on $\{0, 1, \ldots, n\}$, then $$P\{X + Y = i\} = \begin{cases} (i+1)/(n+1)^2, & 0 \leq i \leq n,\\ (2n+1-i)/(n+1)^2, & n+1 \leq i \leq 2n,\end{cases}$$ with a maximum value of $(n+1)^{-1}$ at $i = n$. Given $X + Y = 15$, we know that $n$ must be at least $8$. Furthermore, the likelihood of the observation $X + Y = 15$ is $0$ for $0 \leq n < 8$,$2/9^2$ when $n = 8$, $4/10^2$ when $n = 9$, etc., peaking at $1/16$ when $n = 15$/ Thus, as Henry suspected, the maximum-likelihood estimate of $n$ is $15. But the question asked by the OP is

If $Y+X = 15$, what is expectancy of n?

which seems to imply that the OP wants the conditional expected value of $n$ given $X + Y = 15$, presumably under the assumption that the prior distribution of $n$ is uniform on $\{0, 1, \ldots, 100\}$. So now we need to compute $$P\{n = m \mid X+Y = 15\} = \frac{\frac{1}{101}P\{X+Y = 15 \mid n = m\}}{ \frac{1}{101}\sum_{i = 0}^{100}P\{X+Y = 15 \mid n = i\} }$$ which presumably leads to the conditional median of $n$ being 32 and the conditional mean being over 39.5. I wonder what the Bayesian or maximum aposteriori probability estimate of $n$ is?

share|cite|improve this answer

It is probably worth starting by working out the answer to: If $Y$ and $X$ are discrete random independent variables that have uniform distribution on the integers $0,\ldots...n$, then what is the probability that $Y+X=15$.

You could then use these probabilities as likelihoods in your original question.

share|cite|improve this answer
I did it.E(X+Y)=n==>n=15? (the answer for the question is 14) – Yakov Feb 12 '11 at 14:56
It is true that $E[X+Y] = n$ but that does not help with your original question as stated. Given that $X+Y=15$, I suspect the maximum likelihood estimate of $n$ is $15$, the median estimate is $32$ and the expectation of $n$ is over $39.5$. If the answer is 14, then you may have misstated the question. – Henry Feb 12 '11 at 15:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.