The princess is 40 and prince is 30.

Y = age of the prince
X = Age of the princess

x = 4y/3

Really a simple algebraic equation.