Hello, thank you for taking the time to post your question!
This is a question that gets a lot more difficult than you might expect on the surface once you get into the full details of the setup and simplification haha, so you want to start by defining the total number of balls … for this scenario that would be
Total = Red + Blue = 5 + N
Then we have two scenarios where the balls could be the same color
P(RR) = 5/(5 + N) * 4 / (4 + N)
P(BB) = N/(5 + N) * (N – 1) / (4 + N)
Since the sum of those is 11/21 the full equation that we’re using to solve for the value of N is
5/(5 + N) * 4 / (4 + N) + N/(5 + N) * (N – 1) / (4 + N) = 11/21
If you solve that algebraically by setting up a quadratic you should end up with N = 10 and N = 2 for the value of N, meaning that the sum of all possible values is 10 + 2 = 12.
Hopefully that gets you moving in the right direction! Feel free to reach out for a lesson if you have any questions about the process to solve beyond that! :)