[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
• Status: Solved
• Priority: Medium
• Security: Public
• Views: 258

# Permutaties Combinaties, Problem

Hello,

I have solved this problem could someone please tell me if they are correct.

2) How many strings contain a bit of 12 length :
``````2^12 = 4096
``````

a) exactly three 1-bit:
``````n! / k!(n-1)   220
``````

b) at least three 1-bit
``````2^4   - 1  = 15
``````

c)an equal number of 0 - and 1-bit
``````I dont know how to solev this one

maybe so??
12! / (6! (12-9)!) = 924
``````
0
kensy11
• 9
• 4
• 3
• +2
1 Solution

Commented:
Sorry, but I don't understand any of the questions.

Are you are talking about 12-bit binary strings (0 and 1) in every case?

If so then, then 4096 is correct.

a) 220 is correct but your formula is wrong.

b) is very wrong.
At least three 1's is the same as at most three 0's.
How many ways are there to have zero 0's, one 0,, two 0's, and three 0's?  Add them up.
You could also find the number of strings that have three 1's, four 1's, ... , twelve 1's.

c)  The only way to have equal numbers of 1's and 0's is to have six of each.
0

Commented:
>>  b) is very wrong.

At least three 1's  includes and has to be bigger than Exactly three 1's
0

Author Commented:
B:  is it

``````1-(7)^3 =  342
``````
0

Commented:
a)  b)  and c) are all Combination problems.

The formula for combinations is   n! / k! * (n -k)!

For b),  there is no single formula.  You have to add up the number of combinations for several cases.
0

Author Commented:
b: = 298 ?
0

Author Commented:
c: = 1848
0

Commented:
That's close.  How are you calculating it?
I think you are missing one term.
0

Author Commented:
which one :p , so both of them are wrong ?
0

Commented:
The notation for combinations is    C( n, k)  =   n! / k! * (n -k)!

It is a built-in function on lots of calculators.  See if you have it.

>>  At least three 1's is the same as at most three 0's.

C( 12, 0)  +  C( 12, 1)  +  C( 12, 2)  +  C( 12, 3)  =  1 + 12 + 66 + 220

======================================================

C( 12, 6) is not 1848 but it is related.
0

Commented:
Sorry, bad error on my part.

Calculate the number of strings with zero 1's,  one 1,  two 1's, and three 1's.
These are strings we don't want.

C( 12, 0)  +  C( 12, 1)  +  C( 12, 2)  +  C( 12, 3)  =  1 + 12 + 66 + 220

The final answer is 4096 minus these.
0

Project Engineer, ElectricalCommented:
For C...for count of 1 to equal count of 0 then count of both must be 6.

Place 6 0s in a row 000000 (1)
That leaves 7 places to put 1st in.  x0x0x0x0x0x0x
Now you want to put any number of 1st into any of the slots.
First 1 goes into any of the xs  (7)
2nd 1 goes into any xs (7)
3rd into any (7)

Thus 1*7*6 = 42
0

Commented:
You are not close.

You have already calculated the total number of 12-bit binary strings.
It is only 4096.

The way to think of combinations and permutations:

If you have 12 different items, there are 12! ways to arrange them.

But if six of them are identical (six 1's), you have to divide that number by 6!.
If the other six are also identical (six 0's), you have to divide by 6! again.
0

Project Engineer, ElectricalCommented:
I incorrectly used power when I meant to use multiply. I edit my post to 42.  I'm assuming thats what you're looking at?
0

Commented:
I arrive at a different solution for C:
If you enumerate the zeros and the ones: 0-1,0-2,0-3,...,0-6,1-1,1-2,1-3,...,1-6 there are 12! permutations of these 12 numbers.
But in view of the question the 6! permutations of the 0-? are seen as equal and the 6! permutations of the 1-? are equal.
So in sum there are 12!/(6!*6!)=924 possibilities.
0

Commented:
>> So in sum there are 12!/(6!*6!)=924 possibilities.

That is correct for c).
0

Project Engineer, ElectricalCommented:
924 is 12C6

So there are 924 ways to arrange 6 1s into 12 slots.
So if all the rest of the slots have to be 0s, (1 choice), that makes sense.
0

Commented:
Your total is correct and rightly determined by 2^12.

which comes to 12!/3!*9! which is 12*11*10*9!/3!*9! which is
12*11*10/3*2 or 1320/6 or 220. Note here that the solution for
exactly 3 1-bit is the same as the solution for exactly 3 0-bit.

Your answers for b) are all incorrect. In order to have at least
3 1-bit strings means the same as having no more than 2 0-bit strings.
So using the same formula for answer a) we can see that the number
of 0 0-bit strings would be 12!/0!(12-0)! remembering that 0! always
equals 1, there is only 1 string that contains 0 0-bits (i.e. they're
all 1-bit). The number of 1 0-bit strings would be 12!/1!*11! or
12*11!/11! or 12. The number of 2 0-bit strings would be 12!/2!(10!)
or 12*11*10!/2*10! or 12*11/2 or 66. If we add the 1 and 12 and 66,
we get 79 strings that have no more than 2 0-bits and substracting
that from the 4096 original strings we determine that the number of
strings that have at least 3 1-bit strings is 4,017.

Your first attempt at c) provided the correct answer, but the formula
should have been 12!/6!(12-6)! = 12*11*10*9*8*7*6!/6*5*4*3*2*1*6!.
Since 6! = 720 and 8*9*10 = 720, this equation reduces to
12*11*7 = 924
0

Commented:
awking00 is correct on part c).

I incorrectly subtracted rather than included the strings with three 1's  --  C( 12, 3) = 220.
0

## Featured Post

• 9
• 4
• 3
• +2
Tackle projects and never again get stuck behind a technical roadblock.