A permutation problem (Kinda)

434 Views Asked by At

A collection of black and white balls are to be arranged on a straight line such that each ball has at least one neighbor of different color. If there are 100 black balls, then the maximum number of white balls that allows such an arrangement is?

2

There are 2 best solutions below

4
On

$200$. easy to see you can't have more cause every black ball can be a neighbour of at most $2$ white balls. to obtain such an arrangement just put a white ball on the left and on the right of each black one, put them in a row, it's evident such an arrangement satisfies your conditions.

0
On

$200$

There can be at most two white balls between two black balls. If there were more than two white balls between some two black balls, one of the white ball ends up having two white neighbors. There can be one white ball to the left of the leftmost black ball and one white ball to the right of the rightmost black ball.