Enigmatic Code

Programming Enigma Puzzles

Enigma 1391: Platonic puzzle

From New Scientist #2551, 13th May 2006

For homework Penny had to make an icosahedron from 20 equilateral triangles. Each triangle had to be numbered 1, 2, 3, 4 or 5 and at each vertex of the icosahedron the five triangular faces that met there all had to be different numbers.

Joe and Penny each made a model satisfying these requirements and in both cases the faces round the “top” vertex were 1 2 3 4 & 5 clockwise.

Although the overall arrangements of the numbers were different for both models, the orders of the numbers around the “bottom” vertex (diametrically opposite the top vertex) were the same.

Looking at the bottom vertex, what was that order, clockwise starting at 1?

[enigma1391]

Advertisements

One response to “Enigma 1391: Platonic puzzle

  1. Jim Randell 17 September 2013 at 9:22 am

    This Python program runs in 33ms.

    #   /\    /\    /\    /\    /\
    #  / 0\  / 1\  / 2\  / 3\  / 4\
    # /____\/____\/____\/____\/____\
    # \    /\    /\    /\    /\    /\
    #  \ 5/10\ 6/11\ 7/12\ 8/13\ 9/14\ 
    #   \/____\/____\/____\/____\/____\
    #    \    /\    /\    /\    /\    /
    #     \15/  \16/  \17/  \18/  \19/
    #      \/    \/    \/    \/    \/
    
    from enigma import printf
    
    # the faces (clockwise around each vertex)
    v2f = [
      # "top" vertex
      (0, 4, 3, 2, 1),
      # vertices surrounding "top"
      (0, 1, 6, 10, 5),
      (1, 2, 7, 11, 6),
      (2, 3, 8, 12, 7),
      (3, 4, 9, 13, 8),
      (4, 0, 5, 14, 9),
      # vertices surrounding "bottom"
      (5, 10, 15, 19, 14),
      (6, 11, 16, 15, 10),
      (7, 12, 17, 16, 11),
      (8, 13, 18, 17, 12),
      (9, 14, 19, 18, 13),
      # "bottom" vertex
      (15, 16, 17, 18, 19),
    ]
    
    # colours
    colours = list('12345')
    
    # return an updated list
    def update(cs, i, c):
      cs = list(cs)
      cs[i] = c
      return cs
    
    # colour the icosohedron
    def solve(cs):
      # find an uncoloured face
      try:
        i = cs.index(None)
      except ValueError:
        # if there are none, so we're done
        printf("[{cs}]", cs=' '.join(cs))
        # find the colouring around the bottom vertex
        r = list(cs[i] for i in v2f[-1])
        # and rotate it until 1 is at the start
        while r[0] != '1': r.insert(0, r.pop())
        print(' '.join(r))
      else:
        # colour it such that no vertex has duplicate colours
        for c in colours:
          if any(c in (cs[i] for i in f) for f in v2f if i in f): continue
          solve(update(cs, i, c))
    
    # initial configuration
    cs = [None] * 20
    for (i, c) in zip(v2f[0], colours):
      cs[i] = c
    
    solve(cs)
    

    Solution: The numbers surrounding the bottom vertex are: 1, 5, 4, 3, 2 (in clockwise order).

Leave a Comment

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: