Solved

Calculate Possible Combinations of Five Letters

Posted on 2014-09-29
16
186 Views
Last Modified: 2014-09-29
I need to calculate all the possible combinations of the letters A, B, C, D, E.

I think there is a formula for this, but I can recall it.

In other words...  My output would be something like this:

A B C D E
A C D E
A D E
A E
A
A B D E
A B E
A C
A D
A E
B C D E
B D E
B E
B
C D E
C E
C

Hopefully you get the idea.

Thanks in advance!
0
Comment
Question by:Senniger1
  • 5
  • 4
  • 2
  • +2
16 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 350 total points
ID: 40349789
The links above only show for a particular length/sample pair.

You would need to repeat it for each length 1-N where N is the length of the string.

C(5,5) + C(5,4) + C(5,3) + C(5,2) + C(5,1) = 1 + 5 + 10 + 10 + 5 = 31
0
 

Author Comment

by:Senniger1
ID: 40349804
Thank you for the response, but I saw all that stuff when I did a google search.  Of those, I didn't see any that showed the output where sometimes there's a 5 letter combination, sometimes a 4 letter combination, sometimes there's a 3 letter combination, etc.

I need someone to show me the calculations with my letters and show me the answer.

Many thanks!
0
 

Author Comment

by:Senniger1
ID: 40349810
That was what I was looking for.  Thank you so much!
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 24

Expert Comment

by:aadih
ID: 40349835
He asked for a formula. I gave a website that has the formula. No blind link. Sorry (to disagree).
0
 
LVL 84

Assisted Solution

by:ozo
ozo earned 100 total points
ID: 40349860
2^5-1
(assuming you're not counting the combination with no letters)
0
 
LVL 24

Expert Comment

by:aadih
ID: 40349877
Again, I disagree -- respectfully -- in this particular instance.

Thanks. Regards.
0
 
LVL 27

Assisted Solution

by:d-glitch
d-glitch earned 50 total points
ID: 40349925
You are essentially asking for all the subsets of [A B C D E]

One way to think about the problem is count in binary from

00000  = 0  ==> None/Empty Set
00001  = 1  ==> E     If there is a 1 in a position, include the letter
00010  = 2  ==> D
00011  = 3  ==> DE
    :
    :
11110  = 30  ==> ABCD
11111  = 31  ==> ABCDE

This is the same result as ozo's formula.
0
 
LVL 24

Expert Comment

by:aadih
ID: 40349946
Nice explanation, d-glitch. Thanks.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 40349960
Senniger1,

I concur, with ozo's and d-glitch's posts.

While I showed how the individual combination counts sum to produce the number you're looking for, and do produce the correct answer,  I left out the next obvious step of showing the simplification.

Using the exponentiation is the much more efficient means of getting the result.

As a TA I can reopen the question so you can split points to her if you'd like.
0
 
LVL 24

Expert Comment

by:aadih
ID: 40349973
I believe points are not that important -- at least for me. (Individuals may differ.) But the satisfaction (that comes) in providing help or trying to help.  :-)
0
 

Author Comment

by:Senniger1
ID: 40349994
If you want to reopen the questions I will split some of the points as I deem fair since you answered my question as to what I needed.
0
 
LVL 24

Expert Comment

by:aadih
ID: 40350006
Nice Charitable.  :-)
0
 

Author Closing Comment

by:Senniger1
ID: 40350049
I based the points on the first response which completely answered my question and the detail which was most useful to me.

Many thanks to all!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Frequency distribution 6 51
Best, Average or Worst ? 12 96
Honda Vezel hybrid vs Honda Shuttle hybrid 2 279
Understanding factorial 4 31
We are taking giant steps in technological advances in the field of wireless telephony. At just 10 years since the advent of smartphones, it is crucial to examine the benefits and disadvantages that have been report to us.
When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa‚Ķ

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question