[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.4

Phone Number Mnemonic

Asked by lunarbeach in C++ Programming Language

Tags: number, word, phone

Homework:

Given a 7 digit phone number input, determine the word possibilities.  Input will not use 0 or 1 since they have no letters associated so the phone number input cannot contain either digit;  only digits 2 - 9 are permitted in the phone number sequence.

I know one method (algorithm).  Are there others ?  Is mine correct ?  A better way with STL ?  

Here is one way:  The number of possible words is equal to 3^7 or 2187.   I can build an array called word of strings with each element being a 7 char string.  There would be 2187 elements in the array.  2187 / 3 = 729.   If the first digit in the phone number were 5, (using a c-string in this model) elements word1[0] thru word728[0] = J while word729[0] thru word1457[0] = K and from word1458[0] to 2187[0] = L .

the second element in the c-string will be assumed to be in accord with the digit 2.  So going down the list, I will repeat it 243 times for each of the 3 letters.  There will be 9 repitition blocks of each letter, whereas in the first element there were 3 repetition blocks across the entire 2187 words.

In the third element, word1[2] etc, there will be 27 repitition blocks  so each of the three letters will be written consecutively 2187 /27 = 81 times.  If the digit were 3 then the letter D would be written 81 times, then E would be recoreded in the 3rd element 81 times and then F would be written 81 times.  This procedure would loop 9 times (3 x 9 = 27 repitition blocks total) to fill the 2187 words with a third element possibility.

In a 7 digit phone number where there are 3 alpha characters >>
-----------------------------------------------------------------------------
 count    c                    1      2      3    4      5       6        7    

 element  e                  0      1      2     3      4       5        6        

 loops      3^e              1      3      9     27    81    243     729                    

 writes  2187/ (3^c)  729   243   81    27      9      3         1
 
------------------------------------------------------------------------------

In the last sequence, each letter would be written once and the the set of three would again be repeated:  729 loops in all to fill out the array of 2187 strings.

Finally, the array could be sorted by alpha.

There must be a more eloqent means.

Considering permutations of 24 elements taken 7 at a time won't apply here since only 3 letters are used to fill each of 7 digits.  

Please advise.  I am new to STL so there may be something of use there that I am unaware of beyond the power algorithm and the variety of sort options there.  Thank you.
 





 

[+][-]05/03/06 01:05 PM, ID: 16599815Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: C++ Programming Language
Tags: number, word, phone
Sign Up Now!
Solution Provided By: grg99
Participating Experts: 4
Solution Grade: A
 
[+][-]05/03/06 01:07 PM, ID: 16599853Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05/03/06 07:27 PM, ID: 16602265Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]05/03/06 07:45 PM, ID: 16602358Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/04/06 04:44 AM, ID: 16604485Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/04/06 07:07 AM, ID: 16605710Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/04/06 07:34 AM, ID: 16606029Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/05/06 02:32 PM, ID: 16618457Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/05/06 09:42 PM, ID: 16620047Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/06/06 10:10 PM, ID: 16623839Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/07/06 07:12 PM, ID: 16627501Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/07/06 07:33 PM, ID: 16627561Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/07/06 07:40 PM, ID: 16627577Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/07/06 07:45 PM, ID: 16627587Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/08/06 04:08 PM, ID: 16635215Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/08/06 10:38 PM, ID: 16636690Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/09/06 08:41 AM, ID: 16640263Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/09/06 08:50 AM, ID: 16640347Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/13/06 02:42 PM, ID: 16675353Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/13/06 05:03 PM, ID: 16675859Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/13/06 08:37 PM, ID: 16676307Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05/15/06 12:19 AM, ID: 16680302Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05/15/06 07:13 AM, ID: 16682506Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/11/06 04:52 AM, ID: 16880468Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06/11/06 08:15 AM, ID: 16881138Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/11/06 02:20 PM, ID: 16882050Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/11/06 02:27 PM, ID: 16882075Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/15/06 01:29 PM, ID: 16915372Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92