+ Reply to Thread
Results 1 to 9 of 9

Probabilities

  1. #1
    Registered User
    Join Date
    03-22-2012
    Location
    Biloxi, Ms
    MS-Off Ver
    Excel 2010
    Posts
    5

    Question Probabilities

    I am wanting to display all of the probabilities for spelling a word. For instance the word "Action". Can someone help me, I do know a little VBA?

    Thanks,
    Daxton

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Probabilities

    Provide an example. 'The probability of spelling a word' makes no sense. For example, the probability of a 1 year old child spelling "action" is close to 0, while a movie script writer is over 99%.

    Pauley
    Last edited by Pauleyb; 03-22-2012 at 10:00 AM.

  3. #3
    Registered User
    Join Date
    03-22-2012
    Location
    Biloxi, Ms
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Probabilities

    I'm sorry for the confusion. But I am wanting to display all the possibilities of a word.
    There is this scramble game in my newspaper everyday and I'm want to have all the possibilities and pick out the correct one myself. Hope this better explains what I am wanting.

    Please correct me if I'm wrong. But let's say that a word has six letters in it, doesnt it only have 36 possibilities?

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Probabilities

    methinks the possibilities should be way more than 36 - something like 6! = 1*2*3*4*5*6 = 720.

    but that still does not answer your question...

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    16,161

    Re: Probabilities

    Probability probably isn't the right word. If I understand what you are after, you are looking more for combinatorials.

    I don't know if anyone has attempted this before. Spell check dictionaries have some kind of algorithm to attempt to recognize a word intended from what you type in.

    I put something like "phonetic database" into Google and got a few possible hits. It seems to me (an engineer who has never really tried to apply a computer to the nuances of language arts) that the hardest part of a problem like this is builidng a database for all the letter combinations that result in a given sound. For example, your sample word "action" you would need a database to look up all the ways to "spell" the short a sound. then lookup how to spell the k sound, then the sh sound, then the "uh" sound, then the n sound. A word like "action" probably also wants to find the ks or x sound. Phonetics in English is fairly complex and not always consistent, so the hardest part of this kind of problem is building a database of phonetic sounds and how they are spelled.

    Once you have the database, then it is a fairly basic combinatorial problem, and I know I've seen those algorithms described on Wikipedia and other sites. Given a ways of saying "a", b ways of saying "ksh", and c ways of saying "un", find all the possible combinations.

  6. #6
    Registered User
    Join Date
    03-22-2012
    Location
    Biloxi, Ms
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Probabilities

    Thank you everyone! I will try to construct the situation in VBA.

    Daxton

  7. #7
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Probabilities

    Not sure of your VBA coding skill set, but this is probably best solved using recursion due to you not knowing the length of the word. If you do know the length, you could just do a bunch of nested for loops. In either case, you would need to check that the letters aren't used more than once.

    Pauley

  8. #8
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Probabilities

    Had some free time and this puzzle kept rolling in my mind.

    Recursion magic is the answer.

    Pauley
    Attached Files Attached Files

  9. #9
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Probabilities

    @Pauleyb:

    might you want to use Long instead of Integer so that it can go beyond 32K?

    on the other hand, the maximum that excel 2007 could do is a 9 character string... with Integer it can be up to 7 characters. not much to choose from.

    i hasten to add: wonderful program...
    Last edited by icestationzbra; 03-30-2012 at 01:33 PM.

  10. #10
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Probabilities

    Yep, your are correct. OutRng should be a Long, or I should just move the output cell so that when it hits the bottom row, it goes to the next column and continues down... Of course, I would hope most people could unscramble a word before reviewing all (word_len)! combinations.

    Error checking and support beyond 7 character words is left as an exercise for the reader

    Pauley

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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