Computing marginal PMF The problem is as follows:

Let  N  be a positive integer random variable with PMF of the form

$$P_N(n)=\frac{1}2*n*2^{-n},n=1,2,…. $$

Once we determine the numerical value of  N , we then draw a random variable  K  whose (conditional) PMF is uniform on the set  {1,2,…,2n}.

The joint PMF is  $$P(K=k,N=n)= \begin{cases}\frac{1}{4*2^{-n}} &amp; n \in \{1,2, ...\},k\in \{1,2,...,2n\}\\
0 &amp; \text{ otherwise } 
\end{cases}$$

Now I would like to find the marginal PMF $P_K(k)$ as a function of $k$.We only need to answer only for the case when  $k$  is an even number. I use simple example to draw out the conditional PMF $ P(K = k | N = n)$ table.

$$\begin{array}{c|c|c|} 
 &amp; \text{k=1} &amp; \text{k=2} \\ \hline
\text{n=1} &amp; 1/2 &amp; 1/2 \\ \hline
\end{array}$$

But having trouble understanding how to compute the marginal PMF function. Any guidance is appreciated!
Assume $k$ is even. 

\begin{align*}
P(K = k) &amp;= \sum_{n = 1}^\infty P(N = n, K = k)\\
&amp;= \sum_{n = 1}^{\frac{k}{2} - 1} P(N = n, K = k) + \sum_{n=\frac{k}{2}}^\infty P(N = n, K = k)\\
&amp;= \sum_{n = 1}^{\frac{k}{2} - 1} 0 + \sum_{n=\frac{k}{2}}^\infty \frac{1}{4 * 2^n}\\
&amp;= \sum_{n=\frac{k}{2}}^\infty \frac{1}{4 * 2^n}\\
&amp;= \frac{1}{2^{\frac{k}{2}+1}} 
\end{align*}

Why is $P(N = n, K = k) = 0$ for $1 \leq n \leq \frac{k}{2} - 1$? 

We know that $P(N = n, K = k) = 0$ for $k \geq 2n+1$ which is just $n \leq \frac{k}{2} - \frac{1}{2}$. 

But if we assume $k$ is even and use the fact that $n$ is an integer, $n \leq \frac{k}{2} - \frac{1}{2}$ $\implies $ $n \leq \frac{k}{2} - 1$.
How about making a table in which you have the joint distribution and then you check, what is the marginal probability for $k=2, k=4$, and the like.
For $k=2$, the marginal probability should be $1/4$
For $k=4$, the marginal probability should be $1/8$
...
This can be expressed in terms of $k$ as:
$$\dfrac  1 { 2^{1 + k/2}}$$