How do I find the probability of some elements being together inside a randomly arranged set? 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$.

Not an answer in closed form, but it might be useful. I am preassuming that your conditions are also met if there are more than $y$ red balls together.
Let $E_{n,k}$ denote the event that by arranging $k$ red balls and
$n-k$ green balls there will be a consecutive row of at least $y$
red balls. 
Let $R+1$ denote the spot of the first green ball. 
Evidently
$r\geq y$ implies that $P\left(E_{n,k}\mid R=r\right)=1$ and $r<y$
implies $P\left(E_{n,k}\mid R=r\right)=P\left(E_{n-r-1,k-r}\right)$.
Next to that we have $P\left(R=r\right)=\frac{k}{n}\frac{k-1}{n-1}\cdots\frac{k-r+1}{n-r+1}\frac{n-k}{n-r}$
for $r=0,1,\dots,k$. 
There is a recursive relation: $$P\left(E_{n,k}\right)=P\left(R\geq y\right)+\sum_{r=0}^{y-1}P\left(E_{n-r-1,k-r}\right)P\left(R=r\right)$$
Btw, there is some resemblance with this question that deals with "with replacement".
