3
$\begingroup$

I was recently looking at this problem: “There are a number of balls in a jar, some of them red, some of them white. The odds of picking two at random and both balls being red is 1/2. How many of the balls are red?” The given answer was 4 balls, with 3 red balls, but I ran some code because I was curious what other combinations would work. 21 balls with 15 red balls is the next working combination, 120 balls with 85 red balls the next. I was mostly curious in the sequence of total balls, which looked like this:

4, 21, 120, 697, 4060, 23661, 137904, 803761, 4684660, 27304197, 159140520… and so on. I put this into the OEIS (encyclopedia of integer sequences) to see what results it would give, and it gave me two results where the relation to the original problem weren’t immediately clear to me.

The first result gave the sequence of pythagorean triples of the form (X, X+1, Z) where the sequence was all the whole values of X+1. For example: (3,4,5) ; (20,21,29) ; (119,120,169) being the first three. The sequence of the middle values is equal to the original sequence.

The second result gave a recursive formula: k(n)=6*k(n-1)*k(n-2)-2 for n>1 and k(0)=0 and k(1)=1. The same formula applies for the sequence of red balls (with differing starting values), but I am mostly interested in the sequence of total balls.

I tried understanding the connection between these three methods of generating this same sequence, but I couldn’t figure it out. Could anyone help me find the connection?

$\endgroup$
4
  • $\begingroup$ I'm probably fooling myself in some stupid way, but isn't the probability of drawing 2 red balls equal to the probability of drawing a red ball times the probability of drawing a red ball given that you already removed a red ball? To me it seems that the scenario with 4 white balls and 3 red balls gives a probability of $(3/7)*(2/6) = 1/7$ and so an odds of $(1/7)/(6/7) = 1/6$. How would you get to odds $1/2$?? $\endgroup$ Commented Oct 3, 2024 at 12:52
  • $\begingroup$ Ehm, sometimes "odds of $X$" is also used in the meaning of "probability of $X$" rather than as "probability of $X$ divided by probability of not-$X$" as it usually used in statistics. This of course doesn't solve my problem, but it seems to be the interpretation that Iosif uses below. It is interesting that he does find the same sequence albeit for the total number of balls rather than the white balls $\endgroup$ Commented Oct 3, 2024 at 12:56
  • $\begingroup$ Aargh, I'm so sorry! I didn't mean to say 4 white balls and 3 red balls, I meant to say 4 balls where 3 are red. I'll edit this as soon as possible! Apologies for the confusion! $\endgroup$ Commented Oct 3, 2024 at 19:15
  • 1
    $\begingroup$ OEIS A046090 says "Solution to a*(a-1) = 2b*(b-1) in natural numbers" and "Place a(n) balls in an urn, of which b(n) = A011900(n) are red; draw 2 balls without replacement; 2*Probability(2 red balls) = Probability(2 balls)", both of which seem directly relevant to your question. $\endgroup$ Commented Oct 4, 2024 at 9:20

1 Answer 1

11
$\begingroup$

We will obtain simple explicit Fibonacci-like expressions for the feasible numbers of the red and white balls in the jar, which we will denote by $r$ and $w$ respectively, with $n:=r+w$.

We have $\binom r2/\binom n2=1/2$, that is, \begin{equation*} 2r(r-1)=n(n-1). \tag{10}\label{10} \end{equation*} Using substitutions \begin{equation*} r=\frac{x+y+1}2,\quad n=\frac{x+2y+1}2, \end{equation*} rewrite Diophantine equation \eqref{10} as Pell's equation \begin{equation*} x^2-2y^2=1, \tag{20}\label{20} \end{equation*} whose general solution is given by the formulas
\begin{equation*} x=x_k:=\frac{1}{2} \left(\left(1-\sqrt{2}\right)^{2 k}+\left(1+\sqrt{2}\right)^{2 k}\right), \end{equation*} \begin{equation*} y=y_k:=\frac{\left(1+\sqrt{2}\right)^{2 k}-\left(1-\sqrt{2}\right)^{2 k}}{2 \sqrt{2}} \end{equation*} for natural $k$.

So, \begin{equation*} w=n-r=w_k:=\frac{1}{8} \left(\left(3 \sqrt{2}-4\right) \left(1+\sqrt{2}\right)^{2 k}-\left(4+3 \sqrt{2}\right) \left(1-\sqrt{2}\right)^{2 k}\right), \end{equation*} \begin{equation*} n=n_k:=\frac{1}{4} \left(\left(1-\sqrt{2}\right)^{2 k}+\left(1+\sqrt{2}\right)^{2 k}\right)+\frac{1}{2}, \tag{30}\label{30} \end{equation*} \begin{equation*} (w_1,\dots,w_8)=(0, 1, 6, 35, 204, 1189, 6930, 40391), \end{equation*} \begin{equation*} (n_1,\dots,n_8)=(1, 4, 21, 120, 697, 4060, 23661, 137904). \end{equation*} (We must have $n\ge2$, so that $k\ge2$.) So, your sequence $(4, 21, 120, 697, 4060, 23661, 137904, \dots)$ seems to be that of the values of $n$, rather than $w$.


The recurrence $n_k=6n_{k-1}-n_{k-2}$ (which you copied incorrectly) follows immediately from \eqref{30}.


Concerning the identity $n_{k+1}=X_k+1$, where $(X_k,X_k+1,Z_k)$ is the Pythagorean triple $(X,X+1,Z)$ with the $k$th smallest $X$, note that then $\{X,X+1\}=\{v^2-u^2,2uv\}$ (with $Z=v^2+u^2$) for some natural $u$ and $v$ such that $v>u$. So, $$(v-u)^2-2u^2=\pm1,$$ that is, $(v-u,u)$ is a solution of the Pell equation or the negative Pell equation $$s^2-2t^2=-1.$$ The general solution of the latter equation is known and, just as the general solution of the "positive" Pell equation, is given by linear combinations of $\left(1-\sqrt{2}\right)^{2q}$ and $\left(1+\sqrt{2}\right)^{2q}$: \begin{equation*} s=s_q:=\frac{(\sqrt2-1)(1+\sqrt2)^{2q}-(1+\sqrt2)(1-\sqrt2)^{2q}}{2}, \end{equation*} \begin{equation*} t=t_q:=\frac{(1+\sqrt2)(1-\sqrt2)^{2q}+(\sqrt2-1)(1+\sqrt2)^{2q}}{2\sqrt2} \end{equation*} for $q=1,2,\dots$.

This allows us to get $n_{k+1}=X_k+1$. Specifically, here we use the "positive" Pell equation for even $k=2,4,\dots$ and the negative Pell equation for odd $k=1,3,\dots$.

$\endgroup$
2
  • $\begingroup$ Thank you for your answer! I accidentally made a mistake when writing my question, I do apologise! Rather than a number of white balls and a number of red balls, I meant to say a total number of balls where some of them are red. Again, my apologies, I was rephrasing the question from memory and got mixed up! $\endgroup$ Commented Oct 3, 2024 at 19:19
  • $\begingroup$ @ConorPillay : Are you satisfied with this answer? $\endgroup$ Commented Oct 6, 2024 at 21:39

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.