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

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

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

Open in new window


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

Open in new window



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

Open in new window


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

maybe so??
12! / (6! (12-9)!) = 924

Open in new window

0
kensy11
Asked:
kensy11
  • 9
  • 4
  • 3
  • +2
1 Solution
 
d-glitchCommented:
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
 
d-glitchCommented:
>>  b) is very wrong.  

At least three 1's  includes and has to be bigger than Exactly three 1's
0
 
kensy11Author Commented:
B:  is it

1-(7)^3 =  342

Open in new window

0
Technology Partners: 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!

 
d-glitchCommented:
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
 
kensy11Author Commented:
b: = 298 ?
0
 
kensy11Author Commented:
c: = 1848
0
 
d-glitchCommented:
That's close.  How are you calculating it?
I think you are missing one term.
0
 
kensy11Author Commented:
which one :p , so both of them are wrong ?
0
 
d-glitchCommented:
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
 
d-glitchCommented:
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
 
RyanProject 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
 
d-glitchCommented:
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
 
RyanProject 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
 
abbrightCommented:
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
 
d-glitchCommented:
>> So in sum there are 12!/(6!*6!)=924 possibilities.

That is correct for c).
0
 
RyanProject 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
 
awking00Commented:
Your total is correct and rightly determined by 2^12.

Your answer for a) is correct but the formula is n!/k!(n-k)!
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
 
d-glitchCommented:
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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