An urn contains eight red and ten blue balls. A random batch of eight is chosen. Let $X$ denote the number of red balls in the sample. An additional ball is selected from the remaining ten balls in the urn. Let $Y$ equal $1$ if this ball is red and $0$ if it is blue. Find $E(Y|X=4),E(X|Y=1)$.
I tried doing the problem as follows,
$$\begin{aligned} &\bullet\,\, E(Y|X=4)=\sum_yyP(Y=y|X=4)=P(Y=1|X=4)=\frac{4}{10}=\frac25.\\ &\bullet\,\, E(X|Y=1)=\sum_xxP(X=x|Y=1)=P(X=1|Y=1)+2P(X=2|Y=1)+3P(X=3|Y=1)+\cdots+7P(X=7|Y=1)=629/120. \end{aligned}$$
Is this correct?
I think the part calculating $E(Y|X=4)$ is correct since if $X=4$, then we have 4 red and 6 blue balls remaining. Thus $P(Y=1|X=4)=\frac{4}{10}$ as you obtained.
For the second part, we have two experiments. The first one is drawing a batch of 8 balls, and the second is drawing a single ball. If we do not know anything about the other experiment, the order of these experiments does not matter. Thus let us first think that we draw a single ball from the urn, and then draw a batch of 8 balls. If this case if $Y=1$, then we have 7 red, 10 blue balls remaining in the urn. Thus $E(X|Y=1)=\frac{7}{17}\times 8\approx{3.29}$. Alternatively, we can calculate expected value from $P(X=x|Y=1)$ as follows: $$E(X|Y=1)=\sum_xxP(X=x|Y=1)=\sum_xx\frac{\binom{7}x\binom{10}{8-x}}{\binom{17}{8}}\approx3.29$$