How to handle dependence in a probabilistic ball problem? I am learning about how to handle dependence when doing probabilistic calculations and I came across this problem I don't understand how to solve.
I am given $10$ colored balls painted either red or blue or neither. The balls are also numbered from $1$ to $10$ so you can tell which is which.  I choose a uniformly selected random subset $S$ of the integers $\{1,\dots,10\}$ and look at the corresponding balls and their colors.   
Let $r$ be the proportion of the balls that are red and $b$ be the proportion of the first ten balls that are blue.  Therefore we have that $r+b \leq 1$ as a ball can be neither red nor blue. The probability that I have chosen the same number of blue balls as red is 
The number of red balls chosen is a binomial random variable $B(10,r)$ and the number of blue balls chosen is a binomial random variable $B(10,b)$ so $x$ is the probability that these two random variables are equal.
(Added from Xoff's answer.) The number of red balls will follow a binomial distribution of cardinality $R=10r$ and probability $\frac{1}{2}$, and the same for the blue balls with $B=10b$. Hence
$$x=\frac{1}{2^{R+B}}\sum_{i=0}^{10}\binom{R}{i}\binom{B}{i}$$
I then increase all the values in $S$ by $1$, remove any number over $10$ and finally with probability $1/2$ add the number $1$ to the set to get a new set of integers $S'$. I look at those corresponding balls.    The probability that this new selection has an equal number of red and blue balls is also $x$ I believe.
How can you compute the probability that $S$ gives an equal number of red and blue balls and $S'$ gives an equal number of red and blue balls ? The sets $S$ and $S'$ are clearly highly dependent on each other so we can't just multiply the probabilities to get $x^2$.

@Xoff answers the question and says that the answer depends on exactly which balls have which color.  For a fixed number of red and blue balls (and fixed $n$), is it possible to determine the maximum and minimum probability?
 A: Let $N$ be the number of ball (here $N=10$), let $R$ be the number of red balls among them (so $R=Nr$) and let $B$ be the number of blue balls (so $B=Nb$).
you choose each ball with probability $\frac{1}{2}$. The number of red balls will follow a binomial distribution of cardinality $R$ and probability $\frac{1}{2}$, and the same for the blue balls with $B$. Hence
$$x=\frac{1}{2^{R+B}}\sum_{i=0}^{10}\binom{R}{i}\binom{B}{i}$$
But there is no answer to your question, because it does not only depends of $B$, $R$ and $N$, but also of how the balls are numbered. Example
Let $N=4$ and balls are $R,R,B,B$ (Balls $1$ and $2$ are red, balls $3$ and $4$ are blue).
There are $6$ subsets $S$ with equals numbers of blue and red :


*

*$S=\emptyset$, then $S'=\emptyset$ is OK

*$S=\{1,3\}$ then $S'=\{2,4\}$ is OK

*$S=\{1,4\}$ but no valid $S'$ 

*$S=\{2,3\}$ but no valid $S'$

*$S=\{2,4\}$ then $S'=\{1,3\}$ is OK

*$S=\{1,2,3,4\}$ then $S'=\{1,2,3,4\}$ is OK


Each set $S$ can be obtained with probability $\frac{1}{2^4}$, and each $S'$ can then be obtained with $p=\frac{1}{2}$. So the probability of having both $S$ and $S'$ with equal red and blue is $\frac{4}{2^4.2}=\frac{1}{8}$
Other example, same numbers, but balls are $R,B,R,B$


*

*$S=\emptyset$, then $S'=\emptyset$ is OK

*$S=\{1,2\}$ then $S'=\{2,3\}$ is OK

*$S=\{1,4\}$ then $S'=\{1,2\}$ is OK

*$S=\{2,3\}$ then $S'=\{3,4\}$ is OK

*$S=\{3,4\}$ then $S'=\{1,4\}$ is OK

*$S=\{1,2,3,4\}$ then $S'=\{1,2,3,4\}$ is OK


But here all subsets $S$ can lead to a valid $S'$ and so the probability of having both $S$ and $S'$ with equal colors will be $\frac{3}{16}$
As you can see, the probability you are looking for does not depend only of $N$, $r$ and $b$.
A: The numbers of red $N_r$, blue $N_b$ and unpainted $N_u$ balls in your size $\mathcal{S}$ sample are not independent, as you realized. Each number individually follows a binomial distribution, but jointly they follow multinomial distribution:
$$
    (N_r,N_b,N_u) \sim \operatorname{Mult}\left(\mathcal{S}, \{p_r,p_b,p_u\}\right)
$$
here $p_r+p_b+p_u=1$, and they denote the fraction of balls of corresponding colors in the urn.
The probability mass function of the multinomial distribution, i.e. the probability of getting prescribed outcome of the sampling:
$$
  \Pr(N_r=n_r, N_b=n_b,N_u=n_u) = \frac{(n_r+n_b+n_u)!}{n_r! \cdot n_b! \cdot n_u!} p_r^{n_r} p_b^{n_b} p_u^{n_u} \left[ n_r + n_b + n_u = \mathcal{S} \right] 
$$
The probability of interest then reads
$$\begin{eqnarray}
  \Pr(N_r = N_b) &=&  \sum_{n_r=0}^{\left\lfloor\frac{\mathcal{S}}{2} \right\rfloor} \sum_{n_u=0}^{\mathcal{S}-2 n_r} \Pr(N_r=n_r, N_b=n_r,N_u=n_u) \\ &=&  \sum_{n_r=0}^{\left\lfloor\frac{\mathcal{S}}{2} \right\rfloor} \sum_{n_u=0}^{\mathcal{S}-2 n_r} \frac{(2 n_r+n_u)!}{n_r!^2  \cdot n_u!} (p_b p_r)^{n_r} p_u^{n_u}
\end{eqnarray}
$$
Here are probabilities for samples of different size in case of having two red, three blue and five unpainted balls in the urn, computed in Mathematica:
In[89]:= With[{pr = 2/10, pb = 3/10, pu = 5/10}, Table[
  Probability[Equal[k1, k2], 
   Distributed[{k1, k2, k3}, 
    MultinomialDistribution[s, {pr, pb, pu}]]], {s, 1, 10}]]

Out[89]= {1/2, 37/100, 61/200, 2641/10000, 941/4000, 42689/200000, \
78473/400000, 3641069/20000000, 6807821/40000000, \
1600472677/10000000000}

