Find the sigma algebra and conditional expectation. Consider a deck with three cards number 1, 2, and 3. Furthermore, assume that 1 and 2
cards are colored green (G) and the 3 card is colored blue (B). Two of the cards are drawn without replacement. Let $M_{1}$ be the first card drawn and $M_{2}$ be the second card drawn. Let $S$ be the sum of (the numbers written on) the two cards drawn and let $N$ be the number of green cards
drawn.
$\textbf{Part a})$ Write down the $\sigma-$algebra of all possible events on this probability space. 
$\textbf{My attempt}:$ The sample space is $\Omega = \{\{12\},\{13\},\{23\},\{21\},\{31\},\{32\},\{GG\},\{GB\},\{BG\}\}$. The $\sigma-$algebra will be the $\sigma-$algebra generated by this $\Omega$. 
$\textbf{Part b})$ What is the $\sigma-$algebra of events generated by $S$?
$\textbf{My attempt}:$ The sample space is $\Omega = \{3,4,5\}$. So, $\sigma(S) = \{\phi, \Omega, \{3\},\{4\},\{5\}\} = \{\phi, \Omega, \{12,21\}, \{13,22,31\}, \{23,32\}\}$. 
$\textbf{Part c})$ What is the $\sigma-$algebra of events generated by $N$?
$\textbf{My attempt}:$ The sample space is $\Omega = \{1,2\}$. So, $\sigma(N) = \{\phi, \Omega, \{1\},\{2\}\} = \{\phi, \Omega, \{13,31\}, \{12,21\}\}$. 
$\textbf{Part d})$ Is $S$ measurable with respect to $\sigma(N)$?
$\textbf{My attempt}:$ No, S is not measurable with to $\sigma(N)$. This is because the information about the number of green cards does not give us all the information about the sum of the cards. For example, if the number of green cards are 1, the both the sums of $4$ and $5$ are possible. 
$\textbf{Part e})$ Is $N$ measurable with respect to $\sigma(S)$?
$\textbf{My attempt}:$ Yes, N is measurable with to $\sigma(S)$. This is because the all information about the sum of cards of the draw gives us all the information about the color of the cards.
$\textbf{Part f})$ Calculate $\mathbb{E}(S|\sigma(N))$
$\textbf{My attempt}:$ I could use a little help in this one. I know I can split it in to disjoint events and calculate the individual expectations. 
$\textbf{My questions}$
1) I am not sure about part a). 
2) Can I write parts (b-e) more formally?
3) How to go about part f)?
 A: hint:
You have three cards and drawn two cards so
$$\Omega = \{(1,2),(1,3),(2,3),(2,1),(3,1),(3,2)\}$$ but for  make easy 
to understand 
$$\Omega = \{(1_g,2_g),(1_g,3_b),(2_g,3_b),(2_g,1_g),(3_b,1_g),(3_b,2_g)\}$$
so 
\begin{eqnarray}
\begin{array}{c|ccc}
\omega    &  (1_g ,2_g) & (1_g,3_b)& (2_g,3_b)& (2_g,1_g)& (3_b,1_g)&(3_b,2_g)   \\ \hline 
S   &  3  &  4  &  5  &  3   &  4 & 5  \\
N     &  2  &  1  &  1  &  2   & 1 &1   \\
\end{array}
\end{eqnarray}
$$\sigma(S)=\sigma\left(\color{red}{\Bigg\{} \bigg\{(1_g ,2_g) , (2_g,1_g) \bigg\} , 
\bigg\{(1_g,3_b) , (3_b,1_g) \bigg\}  ,\bigg\{(2_g,3_b) ,(3_b,2_g)  \bigg\} \color{red}{\Bigg\}} \right)$$
$$\sigma(N)=\sigma \left( \color{red}{\Bigg\{}  \bigg\{(1_g ,2_g) , (2_g,1_g) \bigg\} , 
\bigg\{(1_g,3_b) , (3_b,1_g)   ,(2_g,3_b) ,(3_b,2_g)  \bigg\} \color{red}{\Bigg\}} \right)$$
For part "f"
These links may help you
conditional-expectation-example-and-sigma-algebra
conditional-expectations-when-conditioning-on-a-discrete-sigma-algebra
$$E(S|\sigma(N))=
E(S|A_1)1_{A_1}+E(S|A_2)1_{A_2}$$
when $A_1= \bigg\{(1_g ,2_g) , (2_g,1_g) \bigg\}$ and 
$A_2=\bigg\{(1_g,3_b) , (3_b,1_g)   ,(2_g,3_b) ,(3_b,2_g)  \bigg\}$
you can calculate $E(S|A_1)$ by 
$E(X|B)=\frac{E(X1_B)}{P(B)}$
Conditional_expectation_with_respect_to_an_event
A: Since order does not matter you can do with a smaller outcome set $\Omega$.
Let $\Omega:=\left\{ \left\{ 1,2\right\} ,\left\{ 1,3\right\} ,\left\{ 2,3\right\} \right\} $
 be equipped with $\sigma$-algebra $\mathcal{P}\left(\Omega\right)$.
The probability measure $\mathcal{P}\left(\Omega\right)\to\mathbb{R}$
is prescribed by $E\mapsto\frac{1}{3}\left|E\right|$.
Random variable $S$ is prescribed by $\left\{ i,j\right\} \mapsto i+j$
and its range is $\left\{ 3,4,5\right\} $.
Note that $S$ is an injective function which implies that $\sigma\left(S\right)=\mathcal{P}\left(\Omega\right)$.
Random variable $N$ is prescribed by $\left\{ i,j\right\} \mapsto\chi_{\left\{ 1,2\right\} }\left(i\right)+\chi_{\left\{ 1,2\right\} }\left(j\right)$
and its range is $\left\{ 1,2\right\} $.
$$\sigma\left(N\right)=\left\{ N^{-1}\left(A\right)\mid A\subseteq\left\{ 1,2\right\} \right\} =\left\{ \varnothing,N^{-1}\left(\left\{ 1\right\} \right),N^{-1}\left(\left\{ 2\right\} \right),N^{-1}\left(\left\{ 1,2\right\} \right)\right\} =$$$$\left\{ \varnothing,\left\{ \left\{ 1,3\right\} ,\left\{ 2,3\right\} \right\} ,\Omega\right\} $$
Evidently $S$ is not measurable wrt $\sigma\left(N\right)$ and $N$
is measurable wrt $\sigma\left(S\right)$.


*

*$P\left[S=3\mid N=1\right]=0$

*$P\left[S=4\mid N=1\right]=\frac{1}{2}$

*$P\left[S=5\mid N=1\right]=\frac{1}{2}$
From this we conclude: $$\mathbb{E}\left[S\mid N=1\right]=0\cdot3+\frac12\cdot4+\frac12\cdot5=\frac{9}{2}$$


*

*$P\left[S=3\mid N=2\right]=1$

*$P\left[S=4\mid N=2\right]=0$

*$P\left[S=5\mid N=2\right]=0$
From this we conclude: $$\mathbb{E}\left[S\mid N=2\right]=1\cdot3+0\cdot4+0\cdot5=3$$
Then apparantly: $$\mathbb{E}\left[S\mid N=n\right]=\frac{12-3n}{2}$$ and consequently:$$\mathbb{E}\left[S\mid\sigma(N)\right]=\mathbb{E}\left[S\mid N\right]=\frac{12-3N}{2}$$
