Double rainbow all the way across the sky!

Logic Level 3

In a marathon, there are 14 runners. There are exactly of two runners that are wearing the same color shirt for each color of the rainbow.

At the finish line, their configuration is as follows:
- 1 runner between the red pairs,
- 2 runners between the orange pairs,
- 3 runners between the yellow pairs,
- 4 runners between the green pairs,
- 5 runners between the blue pairs,
- 6 runners between the indigo pairs,
- 7 runners between the violet pairs.

If we know that the first runner wore a red shirt, what is the total number of possible configuration(s) of all the runners (from fastest to slowest)?


As an explicit example, if the runners were arranged as ROYGBIVROYGBIV, then there are 6 runners between all of the colored pairs.

This is a harder version of an earlier problem .
Image Credit: Flickr Mark Mullen .


The answer is 10.

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.

4 solutions

Anton Shkrunin
Jul 29, 2015

I've coded a combinatorial Java app. If there's a good analytical solution to this one, i'd love to hear it. Meanwhile, here's the working unrefactored solution code from an online Java IDE: http://ideone.com/BnjftF

Langford's Sequences .

A few (actually quite a number of) trial and error should do the trick.

Pi Han Goh - 5 years, 10 months ago

Please post the 10 sequences so that I (we) can see which I missed!

Hugh Fletcher - 3 years, 3 months ago

Log in to reply

RGRBIVGOYBOIYV RGRIVYGBOYIOVB RBRGIVYBGOYIOV RBRIYVGBYOIGOV RBRIVOGBOYIGVY RBRVYGIBYOGVOI RIRYBVGYIOBGOV RIRVOGBOIYGVBY RVROBIOYGVBYIG RVROIGOBYVGIYB

Laszlo Kocsis - 3 years, 1 month ago

As solved by anton, i assume only programming can give solution, analytically it may take a long time.

[1, 4, 1, 5, 6, 7, 4, 2, 3, 5, 2, 6, 3, 7] [1, 4, 1, 6, 7, 3, 4, 5, 2, 3, 6, 2, 7, 5] [1, 5, 1, 4, 6, 7, 3, 5, 4, 2, 3, 6, 2, 7] [1, 5, 1, 6, 3, 7, 4, 5, 3, 2, 6, 4, 2, 7] [1, 5, 1, 6, 7, 2, 4, 5, 2, 3, 6, 4, 7, 3] [1, 5, 1, 7, 3, 4, 6, 5, 3, 2, 4, 7, 2, 6] [1, 6, 1, 3, 5, 7, 4, 3, 6, 2, 5, 4, 2, 7] [1, 6, 1, 7, 2, 4, 5, 2, 6, 3, 4, 7, 5, 3] [1, 7, 1, 2, 5, 6, 2, 3, 4, 7, 5, 3, 6, 4] [1, 7, 1, 2, 6, 4, 2, 5, 3, 7, 4, 6, 3, 5]

Abhra Gupta - 1 year, 3 months ago
Rachel Laubacher
Jan 11, 2018

I have a very very ugly, yet working solution. I'll write up an understandable psudeocode version.

I was not able to not do anything besides a slightly better (but still exponential time) brute force algorithm. Anyways, this problem appears to be NP-COMPLETE. Finding the solutions by hand appear to be mostly an exercise in frustration.

Glenn Goldsmith
Jan 16, 2019

You should make clear in the question that you are indifferent to the ordering within same colour pairs - otherwise there are 2^7=128 times more possible orderings!

Irina Herisanu
Jun 9, 2016

I got tired of trying possible solutions, so I found a way to eliminate a lot of unsuitable tries. I hope I will have time to post the solution soon :).

1 pending report

Vote up reports you agree with

×

Problem Loading...

Note Loading...

Set Loading...