Sabarkantha Posts: 5, Reputation: 1 New Member #1 Nov 9, 2013, 09:19 AM
Maths question
For a particular problem, I have arranged the letters A and B twelve by twelve : AAAAAAAAAAAA, ABBAABBAAABA, and so on. Order matters: AB is not equal to BA. Altogether there are 2 raised to 12 or 4096 pemutations giving all possible combinations of A and B, twelve by twelve. Now amongst the 4096 lines of all the combinations, I want to select just the lines which have A six times, like for instance AABBBBBAAABA. How many such lines are there amongst the 4096? I tried the formula 4096!/(4096-6)! but I am not sure that this does the job, since it does not specifically choose lines with six times A.

Thanks for the answer. It is important to me.
 ebaines Posts: 12,132, Reputation: 1307 Expert #2 Nov 9, 2013, 10:58 AM
There are $\left( \array 12\\ 6 \array \right)$ ways to place the 6 A's in the twelve letter positions. Thus:

$\left( \array 12\\ 6 \array \right) = \frac {12!/6!}{6!} = \frac {12 \times 11 \times 10 \times 9 \times 8 \times 7}{6 \times 5 \times 4 \times 3 \times 2 \times 1 } =924$

In general the number of ways that 'k' A's can be placed in a string of 'n' letter positions is:

$
\left( \array n\\ k \array \right) = \frac {n (n-1)(n-2)...(n-k+1)}{k(k-1)(k-2)...1} = \frac {n!}{k!(n-k)!}
$
 Sabarkantha Posts: 5, Reputation: 1 New Member #3 Nov 9, 2013, 06:28 PM
Originally Posted by ebaines
There are $\left( \array 12\\ 6 \array \right)$ ways to place the 6 A's in the twelve letter positions. Thus:

$\left( \array 12\\ 6 \array \right) = \frac {12!/6!}{6!} = \frac {12 \times 11 \times 10 \times 9 \times 8 \times 7}{6 \times 5 \times 4 \times 3 \times 2 \times 1 } =924$

In general the number of ways that 'k' A's can be placed in a string of 'n' letter positions is:

$
\left( \array n\\ k \array \right) = \frac {n (n-1)(n-2)...(n-k+1)}{k(k-1)(k-2)...1} = \frac {n!}{k!(n-k)!}
$
Thanks a million for your answer. I suppose that this is independent of the total sample of 4096, all the ways you can arrange A and B, twelve by twelve. Since you are very knowledgeable, I want to ask you a further question in order to solve my problem completely. Now that I have reduced my sample to 954, keeping just the lines with six A's, I want to reduce it still further by just keeping the lines where three A's come in a row, side by side: AAA. How manu such lines will there be amongst the 954? Sorry for this further bother.
 Sabarkantha Posts: 5, Reputation: 1 New Member #4 Nov 10, 2013, 12:11 AM
Originally Posted by Sabarkantha
Thanks a million for your answer. I suppose that this is independent of the total sample of 4096, all the ways you can arrange A and B, twelve by twelve. Since you are very knowledgeable, I want to ask you a further question in order to solve my problem completely. Now that I have reduced my sample to 954, keeping just the lines with six A's, I want to reduce it still further by just keeping the lines where three A's come in a row, side by side: AAA. How manu such lines will there be amongst the 954? Sorry for this further bother.
 Sabarkantha Posts: 5, Reputation: 1 New Member #5 Nov 10, 2013, 12:12 AM
 ebaines Posts: 12,132, Reputation: 1307 Expert #6 Nov 10, 2013, 08:31 AM
To clarify your question - I assume you mean that if you get 4 or more A's in a row it's counted as a fail, and if you get two groups of 3 A's each separated by at least one B it's a success.

Start by considering how the three A's are arranged relative to B's:
Case 1. You can have the three A's as the first three letters followed by a B, and you don't care how the remaining 8 letters are arranged:: AAABxxxxxxxx.
Case 2. The first N letters can be anything, followed by the pattern BAAAB, and then the remaining 7-N letters can be anything; for example if N=2: xxBAAABxxxxx. This is valid for N=0 to N=7.
Case 3. The first 8 letters can be anything, followed by BAAA for the last four letters: xxxxxxxxBAAA.

For case 1 the number of ways that the last 8 letters can be arranged, given that they consist of 3 A's and 5 B's is:

$
\left( \array 8 \\ 3 \array \right) = \frac {8 \cdot 7 \cdot 6}{3!} = 56.
$

For case 2 the number of ways that the remaining 7 letters can be arranged, given that there are 3 A's and 4 B's, is:

$
\left( \array 7 \\ 3 \array \right) = \frac {7 \cdot 6 \cdot 5}{3!} = 35.
$

Note that case 2 can occur in 8 different ways, since the starting B can be in position 1, 2, 3, 4, 5, 6, 7, or 8. Thus the total number of ways that case 2 can occur is 8 x 35 = 280.

Finally for case 3 the math is the same as for case 1, so there are 56 ways it can occur.

Thus the total number of arrangements that yield 3 A's in a row, given that you have 6 A's and 6 B's, is 2x56+280 = 392.
 Sabarkantha Posts: 5, Reputation: 1 New Member #7 Nov 10, 2013, 09:39 AM
Originally Posted by ebaines
To clarify your question - I assume you mean that if you get 4 or more A's in a row it's counted as a fail, and if you get two groups of 3 A's each separated by at least one B it's a success.

Start by considering how the three A's are arranged relative to B's:
Case 1. You can have the three A's as the first three letters followed by a B, and you don't care how the remaining 8 letters are arranged:: AAABxxxxxxxx.
Case 2. The first N letters can be anything, followed by the pattern BAAAB, and then the remaining 7-N letters can be anything; for example if N=2: xxBAAABxxxxx. This is valid for N=0 to N=7.
Case 3. The first 8 letters can be anything, followed by BAAA for the last four letters: xxxxxxxxBAAA.

For case 1 the number of ways that the last 8 letters can be arranged, given that they consist of 3 A's and 5 B's is:

$
\left( \array 8 \\ 3 \array \right) = \frac {8 \cdot 7 \cdot 6}{3!} = 56.
$

For case 2 the number of ways that the remaining 7 letters can be arranged, given that there are 3 A's and 4 B's, is:

$
\left( \array 7 \\ 3 \array \right) = \frac {7 \cdot 6 \cdot 5}{3!} = 35.
$

Note that case 2 can occur in 8 different ways, since the starting B can be in position 1, 2, 3, 4, 5, 6, 7, or 8. Thus the total number of ways that case 2 can occur is 8 x 35 = 280.

Finally for case 3 the math is the same as for case 1, so there are 56 ways it can occur.

Thus the total number of arrangements that yield 3 A's in a row, given that you have 6 A's and 6 B's, is 2x56+280 = 392.
Thanks once again for the perfectly clear answer. You have understood the problem well. I think that I can work things out myself now.

 Question Tools Search this Question Search this Question: Advanced Search

## Check out some similar questions!

Maths question [ 1 Answers ]

A child sits on a ledge about 10m above sea level.fish are swimming in the sea 30m beneath the child.at what depth are the fish swimming?

Maths Question [ 0 Answers ]

I doubled a number and keep doubling so that the original number was doubled four times.What might be the answer.

Maths question: [ 1 Answers ]

Regarding table: http://dc317.4shared.com/img/YE2kBHJo/preview_html_m13483107.png Question: In which region does the Orion Line have between 4,000 and 5,000 Small Business customers? Please explain answer...

Maths Question on Matrices [ 12 Answers ]

A. Now consider the product P = ST are S, where S is an upper triangular matrix having 0 everywhere except 1 on the main diagonal and ?1 on the first super diagonal. Write the exact form of P. B. A new algorithm is now proposed to solve the linear system Rx = b. It is in four steps: Step A. Let...

Maths important question [ 1 Answers ]

Mark's daily pocket money is 40 cents more than jee sian's. Each of them spends $1.40 a day and saves the rest. By the time Jee Sian has saved$50, Maek has saved \$20 more than Jee sian. How much is Jee Sian's daily pocket money?