+ Reply to Thread
Results 1 to 3 of 3

Solving a problem where letters are assigned numbers

  1. #1
    Registered User
    Join Date
    07-04-2015
    Location
    Reykjavik
    MS-Off Ver
    2010
    Posts
    9

    Solving a problem where letters are assigned numbers

    Hi

    So i have a problem were i have 10 letters (C,H,O,L......) and each is assigned a number 0-9 (that i do not know).
    5 of these letters + 4 letters gives me = 5 letters
    f.x. (not the real problem)
    HELLO
    + JOHN
    =MELON

    I was thinking that if i give the letters numerical value in excel, it would be easier to figure out the answer. H=3, E=2 etc...

    Is there a simple way to do this?

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,653

    Re: Solving a problem where letters are assigned numbers

    Provided there is a solution (in your sample case - not*) you could try to use Solver for that.

    See attachment
    - all letters listed in P3:P12 with initial assigned numbers listed in column Q
    - words in column B (B2:B4) are spllitted into letters with formula in L2 (I assumed tham max length is 10 letters) with formula (and copy down/left):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    - then letters are converted into digits with formula in L6 (and again copied dowm and left):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    - then "school alike" summing of each decimal position in L10 and possible "in memory" in F11 (and copy left):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    - measure of misfit between row 8 (representation of "sum world") and row 10 (sum of representations of both "added words") in B13 (will be used as goal to be minimized by solver):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    - helper column to check if each digit has been used only once in R3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Solver settings:
    - goal as mentioned above,
    - changed cells Q3:Q12,
    - constraints for these cells >=0 and <=9 and integer, for R3:R12 =1
    - model - evolutionary (available since excel 2010)

    *)
    1) HELLO
    + JOHN
    =MELON
    So we know O = 0
    HELLO
    + JOHN
    =MELON
    As O=0, we know L+H = 10 and in next to left column will use +1 from "the rest in memory"
    1
    HELLO
    + JOHN
    =MELON
    1+L+0=L so L=L+1 -> impossible!

    (I know that you mentioned that it is just an idea - not a real problem, but always it is easier to look for solution once you know there is at least one :-) )

    PS. Final idea: one can use brute force method, and try all possible assignments - there is less than 4 millions of possible permutations of 10 letters - shall be possible to calculate in reasonable time.
    Attached Files Attached Files
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,653

    Re: Solving a problem where letters are assigned numbers

    PS. It is not alvays easy, and depending on solver settings sometimes it needs few runs of solver
    For instance I could find that

    kaper
    + smile
    = miami

    can be obtained with such assignment:
    k 2
    a 8
    p 1
    e 4
    r 3
    s 6
    m 9
    i 7
    l 5
    0

    after 3 runs.

    So probably "bryte force" approach would be a better one.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 13
    Last Post: 07-30-2014, 12:03 PM
  2. [SOLVED] INDEX/MATCH problem when looking up data with various prefixes (letters and numbers)...
    By bcd-at-work in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-23-2014, 08:18 PM
  3. [SOLVED] Quick problem - string mix of letters & numbers - increment by one
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 26
    Last Post: 06-25-2013, 02:15 PM
  4. [SOLVED] Change letters,characters and moves to an assigned number
    By sherryp5165 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-04-2013, 04:59 PM
  5. Replies: 2
    Last Post: 12-01-2010, 02:29 PM
  6. solving for all possible combinations of a set of numbers
    By Tom Ogilvy in forum Excel Formulas & Functions
    Replies: 20
    Last Post: 09-06-2005, 06:05 AM
  7. [SOLVED] solving for all possible combinations of a set of numbers
    By tradersm in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1