Number Encoding


The idea of speculating given a set of constraints is such a common notion that you might want to try it again in a different setting.

In this puzzle, you are given several groups of 2 to 9 letters. Each group encodes an ascending consecutive run of numbers, e.g. 2, 3, 4, 5. In the simplest version of this puzzle, each letter encodes a single number between 1 and 9. Your job is to find the encoding.

Warm-Up

Assume this simplest encoding. Find the single number represented by each letter. Suppose the groups you see are:

 GDF IHEC DFBIH FBIHECA HE FBIH IHE FBIHEC BIHE EC FB

Solution to Warm-Up

Because each group represents an ascending run of numbers, FBIHEC represents a subsequence of the numbers of FBIHECA, so it doesn’t tell anything new. In general, we don’t care about any groups that are subsequences of others. This leaves us with GDF, DFBIH, and FBIHECA. Putting the first and third of these together, you get GDFBIHECA. So, G = 1, D = 2, , A = 9.

That was just a warm-up. Now consider the case where a letter can represent two numbers.

  1. Can you figure out which (up to) two numbers each letter represents?

     EDHFHI                 FDBFHI ACBEDHG                BFEBGDI HFD                    IEDH EEBGH                  EHG HGH                    FEBGH FEBF                   CBEEBF IEDBFDG                CIFD ACBFEB                 EEB CBEEHGDG               ED ACIFEHG                FEBG CIFE                   CIEEH BFDH

  2. For those who are gluttons for punishment, what are the up to three encodings for each letter given this list of groups?

     ABBDH                  DCHGEBF AFCFAE                 ADCFAEG EBFG                   IAAGIB ADCI                   HBBDB IHBID                  FCFGAII DCIHEI                 FCHGBG AFCFA                  EIDG DCFGAB                 ABBDB FCIH                   GEI HAE                    AI CFGAGF                 DCIAE EIDB                   BIIB AEB                    BIDH EBD                    AABF EGD                    EDCIHE CIHBBI                 CFABB AIF                    GDB HBID                   GIH EFCI                   HGAG HABG                   FCI BIFG                   DCHGBBDH FCHABI                 FGEGF ABID                   BIFH CFHEB

Solution to Number Encoding

  1. Can you figure out which (up to) two numbers each letter represents?

Here is the solution for the case in which a single letter may represent up to two letters.

A is 1; B is 3 or 6; C is 2; D is 5 or 8; E is 4 or 5; F is 4 or 7; G is 7 or 9; H is 6 or 8; I is 3 or 9.

  1. For those who are gluttons for punishment, what are the up to three encodings for each letter given this list of groups?

Here is a solution in the case when each single letter can represent up to three letters.

A is 1, 5, or 6; B is 6, 7, or 9; C is 3; D is 2 or 8; E is 1 or 6; F is 2, 4, or 8; G is 5, 7, or 9; H is 4, 5 or 9; I is 4, 7, or 8.




Puzzles for Programmers and Pros
Puzzles for Programmers and Pros
ISBN: 0470121688
EAN: 2147483647
Year: 2007
Pages: 81
Authors: Dennis Shasha

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net