• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Jane Street Jan 2023 puzzle

Joined
5/2/06
Messages
11,954
Points
273
lesses-more.png


Assign four nonnegative integers to the corners of a square, which we designate the active square. During a step, for each side of the active square, the absolute difference between the numbers on that side’s endpoints is assigned to its midpoint. Then these four new midpoints are connected into a new square (tilted 45 degrees from the previous). This new smaller square becomes the active square. Continue these steps until the active square has all zeroes on its corners.

Define f(a, b, c, d) to be the total number of squares drawn during this process when beginning with the numbers (a, b, c, d) written on the starting square in clockwise order. For example, given a starting arrangement of (10, 6, 3, 1), we would get the sequence of

(4, 3, 2, 9)

(1, 1, 7, 5)

(0, 6, 2, 4)

(6, 4, 2, 4)

(2, 2, 2, 2)

(0, 0, 0, 0)

where the game ends (pictured above). So f(10, 6, 3, 1) = 7. And trivially, f(0, 0, 0, 0) = 1.

Consider the set S = {(a, b, c, d) | a, b, c, and d are all integers with 0 <= a, b, c, d <= 10,000,000}. Let M be the maximum value f obtains on S. Find (a, b, c, d) in S with minimum sum (a+b+c+d) where f(a, b, c, d) = M. Enter your answer as a semicolon-separated list, 10;6;3;1 for example.
 

Attachments

  • lesses-more.png
    lesses-more.png
    1.8 MB · Views: 58
My solution can be found in the attached images. Please give the feedbacks
 

Attachments

  • IMG_2430.JPG
    IMG_2430.JPG
    1.2 MB · Views: 306
  • IMG_2431.JPG
    IMG_2431.JPG
    1.1 MB · Views: 306
Back
Top