Is this a bash?

Calculus Level 5

Coach Pranjal and Coach Trevor are coaching their soccer players on the Cartesian plane. Both decide to do running exercises to get their players in shape.

Coach Pranjal calls off the numbers in the set P = ( 2 , 3 , 4 , 5 ) P=\left(2,3,4,5\right) and Coach Trevor calls off the numbers in the set T = ( 3 , 4 , 5 , 6 ) T=\left(3,4,5,6\right) . Each coach tells his players to start at the origin and run in a rectangular spiral with side lengths of 1,2,3, and 4 digit combinations of the numbers in each coach's respective set with no repeated digits.

For example, Pranjal's players would run 5432 paces east, 5423 paces north, 5342 paces west. . . . 2345 paces south, 543 paces east, 542 paces north. . . . And finally 2 paces south.

Coach Trevor tells his players to do the same, except they travel 6543 paces east, 6534 paces north. . . .

When both teams, tired beyond belief, finish their drills, they both stop to rest for a while.

Find the distance between where both teams take their rests correct to 2 decimal places.


Problem credit/inspiration by Pranjal Jain


The answer is 0.00.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Brock Brown
May 26, 2015

Python 2.7:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from itertools import permutations
from math import sqrt
def distance(x1, y1, x2, y2):
    return sqrt((x1-x2)**2+(y1-y2)**2)
turn = {'east':'north',
    'north':'west',
    'west':'south',
    'south':'east'}
def position(team_name, number):
    number = str(number)
    steps = set()
    for length in xrange(1,len(number)+1):
        for combo in permutations(number,length):
            new = int(''.join(combo))
            steps.add(new)
    steps = list(steps)
    steps.sort()
    steps = steps[::-1]
    direction = 'east'
    x = 0
    y = 0
    for step in steps:
        if direction == 'east':
            x += step
        elif direction == 'north':
            y += step
        elif direction == 'west':
            x -= step
        elif direction == 'south':
            y -= step
        direction = turn[direction]
    print "Position of team {0}: ({1}, {2})".format(team_name, x, y)
    return x, y
x1, y1 = position("Pranjal", 2345)
x2, y2 = position("Trevor", 3456)
print "Distance between teams:", distance(x1,y1,x2,y2)

Trevor Arashiro
May 9, 2015

Cool fact, this holds true for all sets of 4 consecutive single digit numbers.

Is there a similar pattern for having a common difference of 2 rather than 1?

Is there any pattern for a set without a common difference?

Does this pattern or others hold for similar circumstances with more numbers?

Does this only work in base 10?

I'd love if someone could answer these questions. Unfortunately, I'm not too good with computer science so I myself can't do this (it's probably doable by NT methods, but I haven't thought of any yet).

I had already started to write out reams of permutations before the "trick" dawned on me. :D If the sets had been P = ( 2 , 3 , 4 , 5 , 6 ) P = (2,3,4,5,6) and T = ( 3 , 4 , 5 , 6 , 7 ) T = (3,4,5,6,7) then they would have ended up 1 1 unit apart.

Do you think that this question belongs in calculus? I would have thought algebra, but I suppose series is a sub-topic for calculus so .... not sure if it matters. :P

P.S.. I've checked out all the problems you've posted (so far) and they're all great, with my answers in line with yours. "Now there's an n" and "Can I use a calculator?" are my faves. :)

Brian Charlesworth - 6 years, 1 month ago

Log in to reply

Wow, that's quite neat. I actually had a hunch that they would end up relatively close together with 6 digits, but I had no idea they they would be only 1 unit apart, That's quite neat!

Thanks for the heart felt compliment :). It means a lot that people enjoy my and others problems. Pi Han is a great problem maker. For "now there's an n" I spent a long time on that one because I doubted my answer. Thanks for confirming it. Luckily, my formula held (the one on integral square roots).

Trevor Arashiro - 6 years, 1 month ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...