The conditional PMF of a random variable $X$, conditioned on a particular event $A$ with $\b{P}(A) \neq 0$, is defined by
$$P_{X|A}(x) = \b{P}(X = x | A) = \frac{ \b{P}({ X= x } \cap A)}{ \b{P}(A)}$$
and satisfies
$$\sum_{ x } p_{X|A}(x) = 1$$
If $A_1, A_2, …, A_n$ form a partition of the sample space $\Omega. \forall i, \b{P}(A_i) \neq 0$. Then
$$P_X(x) = \sum_{ i=1 }^{n}\b{P}(A_i) p_{X|A_i}(x)$$
Furthermore, for $B \subseteq \Omega$, and $\forall i, \b{P}(A_i \cap B) \neq 0 $, we have
$$P_{X|B}(x) = \sum_{ i = 1 }^{ n } \b{P}(A_i | B) p_{X|A_i \cap B}(x) $$
The conditional PMF of a random variable $X$ given $Y$, which is defined by specializing the definition of $p_{X|A}$ to events $A$ of the form $\set{Y = y}$:
$$p_{X|Y}(x|y) = \b{P}(X=x|Y=y)$$
Using the definition of conditional probabilities, we have
$$p_(X|Y)(x|y)=\frac{\b{P}(X=x,Y=y)}{\b{P}(Y=y)}=\frac{p_{X, Y}(x, y)}{p_Y(y)}$$
where $\b{P}(X,Y)$ is the joint PMF.
The conditional PMF of $X$ given $Y = y$ is related to the joint PMF by
$$p_{X, Y} (x, y) = p_Y(y) p_{X|Y} (x | y) $$
The conditional PMF of $X $ given $Y $ can be used to calculate the marginal PMF of $X$ through the formula
$$p_X(x) = \sum_{ y } p_Y(y) p_{X|Y} (x | y)$$
Let $X$ be a random variables.
The conditional expectation of $X$ given $A$ with $\b{P}(A) \neq 0$ is defined by
$$E\brac{ X|A } = \sum_{x} x p_{X|A}(x)$$
For a function $g(X)$, we have
$$E\brac{ g(X)|A } = \sum_{x} g(x) p_{X|A}(x)$$
The conditional expectation of $X$ given a value $y$ of $Y$ is defined by
$$E\brac{ X|Y=y } = \sum_{ x } x p_{X|Y} (x|y)$$
If $A_1, A_2, …, A_n $ be disjoint events that form a partition of the sample space, with $\b{P}(A_i) > 0 $ for all $i$, then
$$E\brac{ X } = \sum_{ i=1 }^{ n } \b{P}(A_i) E\brac{ X|A_i } $$
Furthermore, for any event $B$ with $\b{P}(A_i \cap B) \neq 0, \forall i$, we have
$$E\brac{ X|B } = \sum_{ i=1 }^{ n } \b{P}(A_i |B) E\brac{ X| A_i \cap B } $$
We have
$$E\brac{ X } = \sum_{ y } p_Y(y) E\brac{ X | Y = y } $$