• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Math question

agnitrate

Diamond Member
I'm working on a simple discrete math question that should be pretty easy but I'm doing something wrong in my method.

I have a question where I'm supposed to count the number of strings of length 6 that contain the letters A and B. My professor showed us the correct way to do it, but I'm not sure what I'm overcounting by doing it my way.

Process 1 :

S = total number of strings of length 6 with letters and repitition allowed
|S| = 26^6
A = number of strings of length 6 without A
|A| = 25^6
B = number of strings without B
|B| = 25^6
A intersect B = The number of strings without A and without B
|A intersect B| = 24^6

What I'm looking for is S - ( A union B ) since that would be :

Total strings = Strings that have A and B + Strings without a and without b
S = answer + (A union B )

answer = S - (A union B)
answer = 26^6 - ( |A| + |B| - |A intersect B| )
answer = 26^6 - ( 2(25^6) - 24^6 )
answer = 26^6 - 2( 25^6 ) + 24^6 = 11,737,502

My process of though :

My string has to have at least 1 and b. So why don't I just choose 2 spots for a and b and then choose the rest of the letters. P(6,2) = 6! / 4! ways to place "a" and "b" in the string of length 6 = 30 ways. I then have 4 empty spaces where I can put any letters I want so P(26,4) = 26! / 4!

My answer = 30 * 26! / 4! = 10,764,000

11737502 - 10764000 = 973502

¿Que? If anybody can see what I'm not counting I would greatly appreciate it. I'm going to try and study the rest of this junk.

Thanks for checking it out.

-silver
 
Doing a binomial choice of P(26,4) is not just 26!/4!. It's 26!/((26-4)!*4!). That should solve your problem, I think.

EDIT: I had one of my !s in the wrong place. Sorry. 😱
 
Originally posted by: raptor13
Doing a binomial choice of P(26,4) is not just 26!/4!. It's 26!/((26-4)!*4!). That should solve your problem, I think.

EDIT: I had one of my !s in the wrong place. Sorry. 😱

You're thinking of combinations which would actually make my answer smaller. Combinations don't care about order and I do want to consider order since choosing a before b in my string is different from choosing b before a. My method deals with permutations.

-silver
 
I've been through discrete math you need to be more discreet with your problems and they become easier. That and I can't remember any of it.
 
Originally posted by: AyashiKaibutsu
I've been through discrete math you need to be more discreet with your problems and they become easier. That and I can't remember any of it.

😛

-silver
 
Originally posted by: agnitrate
Originally posted by: raptor13
Doing a binomial choice of P(26,4) is not just 26!/4!. It's 26!/((26-4)!*4!). That should solve your problem, I think.

EDIT: I had one of my !s in the wrong place. Sorry. 😱

You're thinking of combinations which would actually make my answer smaller. Combinations don't care about order and I do want to consider order since choosing a before b in my string is different from choosing b before a. My method deals with permutations.

-silver

Bah. I took that class like a year and half ago. What do you expect? 😛

Maybe I'll remember something in a minute. Probably not though since my buddy just called me about going to a bar. :beer:
 
Originally posted by: raptor13
Originally posted by: agnitrate
Originally posted by: raptor13
Doing a binomial choice of P(26,4) is not just 26!/4!. It's 26!/((26-4)!*4!). That should solve your problem, I think.

EDIT: I had one of my !s in the wrong place. Sorry. 😱

You're thinking of combinations which would actually make my answer smaller. Combinations don't care about order and I do want to consider order since choosing a before b in my string is different from choosing b before a. My method deals with permutations.

-silver

Bah. I took that class like a year and half ago. What do you expect? 😛

Maybe I'll remember something in a minute. Probably not though since my buddy just called me about going to a bar. :beer:

What are you waiting for? Go have a beer and remember you don't have to deal with anything like this! Alcohol beats math in any situation.

-silver
 
Back
Top