Problem 181
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.
This forum is NOT meant to discuss solution methods for a problem.
In particular don't post any code fragments or results.
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
Don't start begging others to give partial answers to problems
Don't ask for hints how to solve a problem
Don't start a new topic for a problem if there already exists one
See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
- sfabriz
- Posts: 175
- Joined: Thu Apr 06, 2006 12:18 am
- Location: London - UK
Problem 181
Hello,
about problem181: what the answer would be for BBWW ?
Would it be 9 with the following groups?
BBWW
B,BWW - BB,WW - BBW,W - BW,BW
B,B,WW - B,BW,W - BB,W,W
B,W,W,W
Cheers,
sfabriz
about problem181: what the answer would be for BBWW ?
Would it be 9 with the following groups?
BBWW
B,BWW - BB,WW - BBW,W - BW,BW
B,B,WW - B,BW,W - BB,W,W
B,W,W,W
Cheers,
sfabriz

- daniel.is.fischer
- Posts: 2400
- Joined: Sun Sep 02, 2007 11:15 pm
- Location: Bremen, Germany
Re: Problem 181
Yep.
Il faut respecter la montagne -- c'est pourquoi les gypaètes sont là.
- sfabriz
- Posts: 175
- Joined: Thu Apr 06, 2006 12:18 am
- Location: London - UK
-
Taifu
- Posts: 34
- Joined: Sun Jan 13, 2008 8:38 pm
Re: Problem 181
sfabriz,sfabriz wrote:Hello,
about problem181: what the answer would be for BBWW ?
Would it be 9 with the following groups?
BBWW
B,BWW - BB,WW - BBW,W - BW,BW
B,B,WW - B,BW,W - BB,W,W
B,W,W,W
Cheers,
sfabriz
perhaps last one is B,B,W,W ?
Ciao.
Marco.

- sfabriz
- Posts: 175
- Joined: Thu Apr 06, 2006 12:18 am
- Location: London - UK
Re: Problem 181
Yes, it is indeed. It's just a typo.Taifu wrote: sfabriz,
perhaps last one is B,B,W,W ?
Ciao.
Marco.
Ciao!

-
robheus
- Posts: 31
- Joined: Thu Jun 12, 2008 5:01 pm
Problem 181
Here is how the problem is formulated:
(summation of)
n! / ( k! * (n-k)! )
where n=N-1 and k from 0..N-1
In fact you do not need to use combinatorics equations, since it is either one of N-1 places contains a separator yes or no, which is simply the power equation:
2N-1-1
For 4 objects we have thus 3 places, and the above equation yields 7.
But this turns out to be the wrong answer as for the case of 60 B and 40 W (= 100) objects, I assumed this would be 299-1 which is 633825300114114700748351602687.
So I suppose this re-formulation is somehow wrong, but then I don't understand the problem.
In what way does the color matter???
(and perhaps I think the problem needs clearer formulation if that is the case, since the example looks like the color does not matter, just the number of objects)
Having three black objects B and one white object W they can be grouped in 7 ways like this: (BBBW) (B,BBW) (B,B,BW) (B,B,B,W) (B,BB,W) (BBB,W) (BB,BW) In how many ways can sixty black objects B and forty white objects W be thus grouped?As we can see from the example, the colors don't matter at all, and it seems the problem can be simply re-formulated like this:
In how many ways can any number (including zero) of separators be placed in any position between any two objects (objects layed out sequentially in a row) if there are N objects (so, there are N-1 positions between objects).Which is realy a simple problem, as it is the summation of placing 0 up to N-1 seperators in N-1 possible locations (each location can have at most 1 seperator), and for placing k seperators in N-1 possible positions this is the well-known formula:
(summation of)
n! / ( k! * (n-k)! )
where n=N-1 and k from 0..N-1
In fact you do not need to use combinatorics equations, since it is either one of N-1 places contains a separator yes or no, which is simply the power equation:
2N-1-1
For 4 objects we have thus 3 places, and the above equation yields 7.
But this turns out to be the wrong answer as for the case of 60 B and 40 W (= 100) objects, I assumed this would be 299-1 which is 633825300114114700748351602687.
So I suppose this re-formulation is somehow wrong, but then I don't understand the problem.
In what way does the color matter???
(and perhaps I think the problem needs clearer formulation if that is the case, since the example looks like the color does not matter, just the number of objects)
Last edited by robheus on Thu Jun 12, 2008 7:30 pm, edited 1 time in total.
- stijn263
- Posts: 1505
- Joined: Sat Sep 15, 2007 11:57 pm
- Location: Netherlands
Re: Problem 181
With B = 2 and W = 2 I get 9 ways to group:
BBWW B,BWW - BB,WW - BBW,W - BW,BW B,B,WW - B,BW,W - BB,W,W B,W,W,WAnd with B = 4 I get 5 ways to group:
BBBB B,BBB - BB,BB B,B,BB B,B,B,B
-
Doraki
- Posts: 13
- Joined: Sat Apr 19, 2008 9:59 pm
-
robheus
- Posts: 31
- Joined: Thu Jun 12, 2008 5:01 pm
Re: Problem 181
The last one I assume is incorrect and should bestijn263 wrote:With B = 2 and W = 2 I get 9 ways to group:BBWW B,BWW - BB,WW - BBW,W - BW,BW B,B,WW - B,BW,W - BB,W,W B,W,W,W
B,B,W,Wsince we use 2 B and 2 W, but that is aside of the issue.
I get the picture, I guess.And with B = 4 I get 5 ways to group:BBBB B,BBB - BB,BB B,B,BB B,B,B,B
So I guess that:
(B,B,B,W)and
(B,W,B,B) (for the original 2 B 2 W problem) designate the same grouping and count only once.
and while for the 4 B variant
(B,B,BB) is equal to
(B,BB,B)and equal to
(BB,B,B)and count as 1
in case of the 2 B 2 W variant
(B,B,WW) is different from (B,BW,W) and count as 2
Last edited by robheus on Thu Jun 12, 2008 7:38 pm, edited 2 times in total.
-
robheus
- Posts: 31
- Joined: Thu Jun 12, 2008 5:01 pm
Re: Problem 181
In the example given, there are 2 B and 2 W so there is noDoraki wrote:In that example, what about the (BB,B,W) grouping ?
(BB,B,W)group.
Edit: If referring to the original problem, the
(BB,B,W)group is already considered, but in a different ordering:
(B,BB,W).
But for this type of problem, the ordering of the elements in the group are not important.
- GenePeer
- Posts: 112
- Joined: Sat Apr 03, 2010 1:14 pm
- Contact:
Re: Problem 181
Can anyone explain to me the C code Robert_Gerbicz "translated" from posted PARI solution? I don't mean explaining what the code is doing (C is very similar to Java so I was able to implement it) but explaining its relation to the problem.
Thanks.
Thanks.

- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 181
This forum is not a place to discuss solutions.
So if someone wants to answer this question please do so in the problems forum.
It's still open and there is plenty of room there.
@GenePeer: as the problems forum is still open, the place to ask your question is there.
So if someone wants to answer this question please do so in the problems forum.
It's still open and there is plenty of room there.
@GenePeer: as the problems forum is still open, the place to ask your question is there.

War ruins the life and health of untold numbers of innocent children.
- GenePeer
- Posts: 112
- Joined: Sat Apr 03, 2010 1:14 pm
- Contact:
Re: Problem 181
Those forums seem to be active only when the problem is released. I was hoping someone who understands it would send me a PM, not discuss it here.
PS: Can there be a notification system like "View your posts" where you can see if there are new replies in forums you posted in? Maybe this could help spark activity in those threads.
PS: Can there be a notification system like "View your posts" where you can see if there are new replies in forums you posted in? Maybe this could help spark activity in those threads.

- hk
- Administrator
- Posts: 12832
- Joined: Sun Mar 26, 2006 10:34 am
- Location: Haren, Netherlands
Re: Problem 181
The correct way would have been:
post your question in the problems forum and ask here if someone is willing to answer it there.
In that way your question (and hopefully answer) would contribute to the problems forum and spark activity there.
PM-ing explanations to each other doesn't contribute to the community.
post your question in the problems forum and ask here if someone is willing to answer it there.
In that way your question (and hopefully answer) would contribute to the problems forum and spark activity there.
PM-ing explanations to each other doesn't contribute to the community.

War ruins the life and health of untold numbers of innocent children.
- GenePeer
- Posts: 112
- Joined: Sat Apr 03, 2010 1:14 pm
- Contact:
Re: Problem 181
Done.
I just posted a question on the problem's solution-thread. Can someone answer it? Thanks.
I just posted a question on the problem's solution-thread. Can someone answer it? Thanks.

-
LarryBlake
- Posts: 100
- Joined: Sat Aug 29, 2009 8:49 pm
Re: Problem 181
I get the correct answers for BBBW and BBWW.
For B(5)W(5), I get 335. Is that correct?
For B(5)W(5), I get 335. Is that correct?

- Marcus_Andrews
- Administrator
- Posts: 1637
- Joined: Wed Nov 09, 2011 5:23 pm
Re: Problem 181
I'm afraid not -- but you're close!LarryBlake wrote:I get the correct answers for BBBW and BBWW.
For B(5)W(5), I get 335. Is that correct?
-
snapey1979
- Posts: 5
- Joined: Thu Mar 01, 2012 1:11 pm
Re: Problem 181
I found the example for this problem a little confusing. In particular, as I read it, you had to keep the original "string" of Black and Whites in the same order. i.e. for BBWW, I thought the groupings were (BBWW), (B,BWW), (BB,WW), (BBW,W), (B,B,WW), (B, BW,W), (BB,B,W) and (B,B,W,W). But, crucially, not (BW,BW)
This forum explanation of groups for BBWW (i.e. (BW, BW) is valid) explained this, but without the forum I think I would have banged my head for a long time (particularly as my solution with the order of the original string preserved gives the right answers for a number of cases).
I wonder if a further example with a grouping that includes such a group might be useful. On the other hand, might just be me as many others have passed this way before...
This forum explanation of groups for BBWW (i.e. (BW, BW) is valid) explained this, but without the forum I think I would have banged my head for a long time (particularly as my solution with the order of the original string preserved gives the right answers for a number of cases).
I wonder if a further example with a grouping that includes such a group might be useful. On the other hand, might just be me as many others have passed this way before...
-
Perlkonig
- Posts: 5
- Joined: Tue Aug 21, 2012 3:31 pm
Re: Problem 181
Uhm, why is the grouping (BB,B,W) not also valid? Is that what I'm supposed to figure out? Thus the phrase "thus grouped"? If so, my suggestion would be to reword the problem to make the "riddle" aspect more explicit.