Consider an apple tee. If the weather is good, it produces $x$ apples with probability $p(x|g)$. If the weather is bad, you get $x$ apples with probability $p(x|b)$. Here, g and b stand for good and bad respectively.
Out of the $x$ apples, if the weather is good, $y$ apples are sweet and $x-y$ apples are not sweet. $y$ happens with probability $q(y|x,g)$. Similarly, if the weather is bad, $y$ follows a pmf $q(y|x,b)$.
What I want to find is the probability of the good weather when I found $y$ sweet apples among $x$ apples, i.e., $P[g|x,y]$.
How do I compute this conditional probability that depends on two variables that one is somehow related to the other?