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
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
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.
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?
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...
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.
Thank you everyone! I will try to construct the situation in VBA.
Daxton
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
Had some free time and this puzzle kept rolling in my mind.
Recursion magic is the answer.
Pauley
@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.
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks