raw Math
RAW Math Algebra Ratios and Proportions

Calculating Exact Age Ratios Between Two People

Robert Eisele

On a birthday, a natural question is whether there is one precise moment when one person is exactly twice as old as another. For a parent and child, the answer is not only yes: the doubling moment has a simple interpretation. It occurs when the child has lived for exactly as long as the parent had already lived when the child was born.

More generally, two birth instants and a desired age ratio determine a unique time through a linear equation. The calculation concerns elapsed duration, not the number printed after the last birthday. Leap years and unequal month lengths therefore belong in the conversion between dates and instants, not in the algebra itself.

Start with the Constant Age Difference

Let

The age difference never changes. If \(D=B-A\), then at time \(T\) the younger person's age is \(y=T-B\), while the older person's age is

\[ T-A=(T-B)+(B-A)=y+D. \]

For the older person to be twice as old,

\[ \frac{y+D}{y}=2. \]

Hence \(y=D\). The younger person must reach the age difference that existed at birth. At that instant, the older person has lived for \(2D\) and the younger person for \(D\).

The General Ratio Formula

Suppose the desired ratio of older age to younger age is \(m:n\), where \(m>n>0\). Measured at instant \(T\), this means

\[ \frac{T-A}{T-B}=\frac{m}{n}. \]

Cross-multiplication gives

\[ n(T-A)=m(T-B). \]

Collecting the terms containing \(T\) yields

\[ (n-m)T=nA-mB, \]

and therefore

\[ \boxed{T=\frac{nA-mB}{n-m}}. \]

The equivalent age-gap form often gives more intuition. Substituting \(D=B-A\) and \(y=T-B\) gives

\[ \boxed{y=\frac{nD}{m-n}}, \qquad \boxed{T=B+\frac{n(B-A)}{m-n}}. \]

Multiplying both ratio terms by the same nonzero factor changes nothing. The formula therefore depends on the ratio \(m/n\), not on whether the pair is written as \(2:1\), \(4:2\), or with positive real-valued terms.

When Does a Solution Exist?

For distinct birth instants with \(A<B\), the ratio after the younger person's birth is

\[ R(T)=\frac{T-A}{T-B}=1+\frac{B-A}{T-B}. \]

Immediately after \(B\), the denominator is close to zero and the ratio is arbitrarily large. As time passes, it decreases toward 1. In fact,

\[ R'(T)=\frac{A-B}{(T-B)^2}<0. \]

Consequently, every target ratio greater than 1 occurs exactly once after \(B\). A ratio below 1 never occurs while the older person remains older. If \(m=n\), the formula has a zero denominator: two people born at different instants can never have equal elapsed ages. If \(A=B\), their ages agree after birth, although the ratio at the birth instant itself is the undefined expression \(0/0\).

Worked Example: Exactly Twice as Old

Take the two dates

Treating both dates as midnight UTC, the birth instants are 9,454 days apart. For \(m:n=2:1\), the younger age at the target is

\[ y=\frac{1\cdot 9{,}454}{2-1}=9{,}454\text{ days}. \]

Adding 9,454 days to January 23, 1988 gives December 11, 2013. On 2013-12-11, the elapsed ages are therefore

\[ 18{,}908\text{ days} \quad\text{and}\quad 9{,}454\text{ days}, \]

whose ratio is exactly \(2:1\).

Calculating the Instant in JavaScript

Once dates are represented as numeric instants, the general formula translates directly. Using UTC avoids local daylight-saving transitions when the input consists of date-only values.

function momentAtAgeRatio(olderBirth, youngerBirth, m, n) {
  if (m === n) {
    throw new RangeError('The ratio must not be 1:1 for distinct birth times');
  }

  const time = (
    n * olderBirth.getTime() - m * youngerBirth.getTime()
  ) / (n - m);

  return new Date(time);
}

const olderBirth = new Date('1962-03-06T00:00:00Z');
const youngerBirth = new Date('1988-01-23T00:00:00Z');

console.log(
  momentAtAgeRatio(olderBirth, youngerBirth, 2, 1).toISOString()
);
// 2013-12-11T00:00:00.000Z

This calculation also works when exact birth times are known. With date-only inputs, midnight is an assumption; the true ratio instant may fall on a neighboring civil date if the people were born at different times of day or in different time zones.

Using MySQL for the Whole-Day Example

MySQL is useful when the birth dates already live in a table and only whole-day precision is required. For the 2:1 case, converting both dates to day ordinals makes the same affine calculation directly:

SELECT FROM_DAYS(
  2 * TO_DAYS(DATE '1988-01-23')
    - TO_DAYS(DATE '1962-03-06')
) AS ratio_date;

The result is 2013-12-11.

This query is appropriate because the 2:1 formula produces an integral day whenever both inputs are whole dates. For a general ratio, division by \(m-n\) may produce a fractional day. A DATE result would then hide the exact instant, so the application must define whether to preserve a timestamp, round, reject the value, or report the two neighboring dates.

Dates, Durations, and Calendar Age

Subtracting birth years is only an approximation because years do not all contain the same number of days. The exact calculation uses elapsed duration between instants, so leap days are included automatically. This is different from civil age in completed calendar years, which changes discontinuously on birthdays and is not suitable for an exact ratio equation.

The unit is otherwise arbitrary. Seconds preserve birth-time precision; day ordinals are sufficient for date-only questions; years can illustrate the algebra but should not be used to claim an exact civil date. What matters is that \(A\), \(B\), and \(T\) use the same linear time scale and origin.