If I have a total of $n$ balls made of $k$ red balls and $(n-k)$ green balls and I arrange them all randomly in a line, how can I calculate the probability $x$ of a group of $y$ red balls being together?
If $k=y$, the solution would be $x=\frac{k!}{n!}$, but I'm striving to find how to deal with cases where $k>y$.
Note: Going by what I believe is the intent of the question, I have made 2 assumptions:
(a) There are at least 2 green balls
(b) k < 2y
Withdraw y red balls and cushion them on each end with a green ball.
Balls remaining in the original group are (k-y) red and (n-k-2) green totalling (n-y-2) with the red placed in the group in **${n-y-2}\choose{k-y}$ ways.
You have a sequence G - y reds - G treated as a block to be placed among the gaps between the (n-y-2) balls including ends i.e. in (n-y-1) available spots.
Pr = (n-y-1)*${n-y-2}\choose{k-y}$/${n}\choose{k}$