Damsel And Suitor

April 21, 2017

Chris Smith tweets mathematical curiosities at @aap03102. This one caught my eye the other day:

This is from 1779: a time when puzzles were written in poetry, solutions were assumed to be integers and answers could be a bit creepy:

Questions proposed in 1779, and answered in 1780.

I. QUESTION 742, by Mr. John Penberthy.

I’m in love with a damsel, the pride of the plain,
Have courted and talk’d in Ovidian strain;
But vain is the rhetoric us’d by my tongue,
She says I’m too old and that she is too young:
From the foll’wing equations, dear ladies, unfold;
If she be too young, or if I be too old.

x3 + xy2 = 4640y
x2yy3 = 537.6x

Where x represents my age, and y the damsel’s.

Your task is to compute the ages of the damsel and her suitor. When you are finished, you are welcome to read or run a suggested solution, or to post your own solution or discuss the exercise in the comments below.

Advertisement

Pages: 1 2

13 Responses to “Damsel And Suitor”

  1. If you multiply the two left hand equations and the two right hand equations this reduces to: x^4-y^4 = 2494464 or x^4 = y^4 + 2494464

    using this we can re can loop through values of y from 1..100 and look for results for which x is an integer…

    print
      map { "@{$_}\n" }
      grep { $_->[0]!~/[.]/ } ## OK a bit of a hack here!
      map { [sqrt sqrt ( $_**4 + 2494464 ). $_] }
      1..100;
    
  2. matthew said

    Solving it 1779 style: the second equation tells us that that x is a multiple of 5, the first, for a given value of x, is just a quadratic in y with the relevant solution being 2320 – sqrt(5382400 – x^4))/x, Mr Napier’s logarithms tell us that the 4th root of 5382400 is 48.1 or thereabouts, so the oldest the man can be is 45. This doesn’t give a correct value for y, so we try the next one down and find that 40 satisfies both equations and gives 16 for the young lady’s age. Smaller values of x rapidly become increasingly unplausible.

  3. Milbrae said

    Since both persons are most likely between 10 and 100 years of age…. here’s a simple brute-force way

    from __future__ import division
    
    #
    if __name__ == "__main__":
    
        for x in range(10, 100+1):
            for y in range(10, 100+1):
                e1 = (x**3 + x * y**2) / y
                e2 = (x**2 * y - y**3) / x
                if (e1 == 4640) and (e2 == 537.6):
                    print ("x = %d\ny = %d" % (x, y))
    

    x = 40
    y = 16

  4. Paul said

    Using the same logic as James Curtis-Smith, the minimum value of x and y are as below. These values turn out to be the solution.

    from math import ceil
    Z = round(4640 * 537.6)
    x = ceil(Z**0.25)  # minimum possible value for x
    y = ceil(x**4 - Z)**0.25 # minimum possible value for y
    print(x,y)  # --> 40, 16
    
  5. Jan Van lent said

    It is convenient to substitute x=a*y. Excluding the possibility y=0, we can divide through by y. Both equations now only have y^2, which can be eliminated to give the equation
    84*a^4-641*a^2+725=0.
    This can be solved for a^2 using the quadratic formula. There are two positive solutions for a. Substituting the rational one (a=5/2) into one of the previous equations gives y^2=256 or y=16 and x=40.
    The other solution gives y=40*(1.074276)^(1/4), x=y*(1+8/21)^(1/2) or approximately y=40.7 and x=47.8.
    The latter ages are not integer, but not creepy.

  6. john said

    Several solutions. Mathematica:


    Solve[
      {
           x^3 + x y^2 == 4640 y,
        10 x^2 y - 10 y^3 == 5376 x
      },
      {x, y}
    ] ~ Cases ~ {
      x -> xi_Integer /; xi > 0,
      y -> yi_Integer /; yi > 0
    }

    C11:


    #include <iso646.h>
    #include <stdbool.h>
    #include <stdint.h>
    #include <stdio.h>
    #include <stdlib.h>

    int main(int argc, char **argv) {
      const uint32_t maxAge = 200;

      puts("Solutions:");
      for (uint32_t x = 1; x < maxAge; ++x) {
        for (uint32_t y = 1; y < x; ++y) {
          if (x*x*x + x*y*y == 4640*y and
    10*x*x*y - 10*y*y*y == 5376*x) {
    printf(" [ x = %d y = %d ]\n", x, y);
          }
        }
      }

      exit(0);
    }

  7. matthew said

    @Jan: nice solution. Here is the original (from “The Ladies’ Diary”) on Google books:

    https://books.google.co.uk/books?id=VPQ3AAAAMAAJ&pg=PA45

    The second solution, from Mr. Wm. Reynolds, is like yours. The solution from Mr. Tho. Truswell I don’t entirely follow.

  8. fisherro said

    I just brute forced it. In C++.

    #include <iostream>
    
    int eq1(int x, int y)
    {
        return ((x * x * x) + (x * y * y)) - (4640 * y);
    }
    
    int eq2(int x, int y)
    {
        return ((x * x * y) - (y * y * y)) - (537.6 * x);
    }
    
    int main()
    {
        //Just brute forcing it.
        bool found = false;
        for (int x = 1; x < 100; ++x) {
            for (int y = 1; y < 100; ++y) {
                if ((0 == eq1(x, y)) and (0 == eq2(x, y))) {
                    std::cout << "x = " << x << " & y = " << y << '\n';
                    found = true;
                }
            }
        }
        if (!found) std::cout << "No solution found!\n";
    }
    

    Which gave:
    x = 40 & y = 16

  9. Steve said

    Can’t find lisp/scheme which has list-of and range.

  10. programmingpraxis said

    @Steve: The list-of macro is in my Standard Prelude, and also included in the code on ideone.com.

  11. Steve said

    eqa::{(x^3)+(x*(y^2))-(4640*y)}

    eqb::{((x^2)*y)-(y^3)+(537.6*x)}

    result::{[a list]; a::x; list::y; {:[eqa(a;x)=0; :[eqb(a;x)=0; :[~list?a,x; list::list,,a,x; “”]; “”]; “”]}’1+!100; list}

    solve::{[list]; list::[]; {list::result(x;list)}’1+!100; list}

    solve()
    [[40 16]]

  12. Shorter Klong version:

    eqa::{(x^3)+(x*(y^2))-(4640*y)}

    eqb::{((x^2)*y)-(y^3)+(537.6*x)}

    result::{[a list]; a::x; list::y; {:[eqa(a;x)=0; :[eqb(a;x)=0; list::list,,a,x; “”]; “”]}’1+!100; list}

    solve::{[list]; list::[]; {list::result(x;list)}’1+!100; list}

    solve()
    [[40 16]]

  13. From Cache for Windows (x86-64) 2016.2.1 (Build…)

    USER>zl damsel zp
    damsel ;New routine
    ;
    ; n suitor,damsel
    f suitor=1:1:100 d
    . f damsel=1:1:100 d
    . . i ((suitor**3)+(suitor*(damsel**2))-(4640*damsel))=0 d
    . . . s e=((suitor**2)*damsel)
    . . . s e2=(damsel**3)
    . . . s e3=(537.6*suitor)
    . . . i (e-e2-e3)=0 d
    . . . . w !,suitor,” “,damsel
    q

    USER>d ^damsel
    40 16

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: