# Find pmf given a probability function

I'm learning probability theory and I am quite new in the concept. I'm stuck with the following problem:

Consider a situation where people often get bitten by dogs (just as an example).

Let $$p_A(n)$$ be the probability that a person A is bitten on day $$n$$, given that he/she hasn't been bitten on day $$1, ..., n-1$$.

Let $$X_A$$ be the number of the day when person A is bitten for the first time.

If I know that $$p_A(n) = \frac{1}{n+1}$$, what is $$\mathbb{P}(X_A=n)$$?

I just can't really get my head around the meaning of the pmf for example. In my eyes it would look like $$\mathbb{P}(X_A=n) = \frac{1}{n+1}$$. Is this correct? If not, how am I interpreting it wrong and does anyone have a hint on what it should be?

I don't like the notation for $$p_A(n)$$, here, because it hides the fact that this is a conditional probability.

The event $$X_A=n$$ is the event that they are not bitten on days $$1,\ldots,n-1$$, but are bitten on day $$n$$. On the other hand, $$p_A(n)$$ is the probability that they are bitten on day $$n$$ ASSUMING they were not bitten previously.

Let's work out a few to point out the difference. Let $$B_i$$ be the indicator for whether or not a bite occurred on day $$i$$. Note that this means we can rewrite $$p_A(n)=P(B_n=1\mid B_1=0,B_2=0,\ldots,B_{n-1}=0)$$

Since day 1 is the first day, the two agree: $$P(X_A=1)=\frac{1}{2}$$.

Now, $$X_A=2$$ if and only if they are NOT bitten on day 1 and ARE bitten on day 2. We can write this as $$P(X_A=2)=P(B_1=0, B_2=1).$$ The only way we can compute this is by leveraging our conditional probability and the previous result: $$P(X_A=2)=P(B_1=0,B_2=1)=P(B_2=1\mid B_1=0)\cdot P(B_1=0)=p_A(2)\cdot\left(1-\frac{1}{2}\right)=\frac{1}{6}.$$

Similarly, for $$P(X_A=3)$$: $$P(X_A=3)=P(B_1=B_2=0,B_3=1)=P(B_3=1\mid B_1=B_2=0)\cdot P(B_1=B_2=0).$$ The first term is precisely $$p_A(3)=\frac{1}{4}$$; the second is precisely the probability that $$X_A\geq 3$$, which you can figure out using the above.

Can you see how to keep going? What patterns emerge?

$$\mathbb{P}(X_A=n)$$ is the probability that the person did not get bitten on days $$1, \ldots,n-1$$ but got bitten on day $$n$$.

Think of $$n=1$$. The person got bitten on day 1. This happens with probability $$p_A(1) = 1/2$$.

Think of $$n=2$$. The person did not get bitten on day 1 and got bitten on day 2. This happens with probability $$\mathbb{P}(\text{bitten on day } 2 \text{ and not bitten on day }1) = \mathbb{P}(\text{bitten on day} 2 | \text{not bitten on day } 1)\mathbb{P}(\text{not bitten on day} 1)$$ = $$p_A(2) \times {1 \over 2} = 1/6$$. The middle step followed from Baye's rule.

Continuing, you should be able to set up the recursion:

$$\mathbb{P}(X_A=n) = p_A(n)\prod_{j=1}^{n-1} \mathbb{P}(X_A=j)$$

Not sure if there is a closed form expression possible.

Refer to the diagram (where "Bn" and "B'n" denote "bitten on day n" and "not bitten on day n", respectively): For $$n=1$$: $$p_A(1)=\frac1{1+1}=\frac12, \\ \mathbb P(X_A=1)=\mathbb P(B1)=p_A(1)=\frac12.$$ For $$n=2$$: $$p_A(2)=\frac1{2+1}=\frac13,\\ \mathbb P(X_A=2)=\mathbb P(B'1)\cdot \mathbb P(B2)=(\underbrace{1-p_A(1)}_{1/2})\cdot \underbrace{p_A(2)}_{1/3}=\frac1{2\cdot 3}$$ For $$n=3$$: $$p_A(3)=\frac1{3+1}=\frac14,\\ \mathbb P(X_A=3)=\mathbb P(B'1)\cdot \mathbb P(B'2)\cdot \mathbb P(B3)=(\underbrace{1-p_A(1)}_{1/2})\cdot (\underbrace{1-p_A(2)}_{2/3})\cdot \underbrace{p_A(3)}_{1/4}=\frac1{3\cdot 4}$$

Can you generalize it for any $$n$$?

$$\mathbb P(X_A=n)=\frac{1}{n(n+1)}.$$
Thanks everyone!! It makes total sense to me now. I was indeed a bit confused by the fact that $$p_A(n)$$ is a conditional probability.