Skip to main content
Post Closed as "off topic" by fedja, Gjergji Zaimi, Douglas Zare, Benoît Kloeckner, Tony Huynh
added 140 characters in body
Source Link

I was asked this question during my interview recently and despite how much I think about itthe amount of thinking i put into this, I am yet to figure it out:


Given $n$ balls which are painted by $k$ colors. Let $s_i$ number of balls painted color $i$, $\sum(s_i)=n$. If we go from left to right, what is the expected number of color change?

Example: for ($n$=8, $k$=3), this configuration $(1,1,1,2,2,2,3,3)$ has $3$$2$ color changes. (previously I typed $3$ instead of $2$). Another configuration, $(1,2,3,1,3,2,2,1)$ has 6

Updated: It was $2$ instead of $3$

I was asked this question during my interview recently and despite how much I think about it, I am yet to figure it out:


Given $n$ balls which are painted by $k$ colors. Let $s_i$ number of balls painted color $i$, $\sum(s_i)=n$. If we go from left to right, what is the expected number of color change?

Example: for ($n$=8, $k$=3), this configuration $(1,1,1,2,2,2,3,3)$ has $3$ color changes.

I was asked this question during my interview recently and despite the amount of thinking i put into this, I am yet to figure it out:


Given $n$ balls which are painted by $k$ colors. Let $s_i$ number of balls painted color $i$, $\sum(s_i)=n$. If we go from left to right, what is the expected number of color change?

Example: for ($n$=8, $k$=3), this configuration $(1,1,1,2,2,2,3,3)$ has $2$ color changes. (previously I typed $3$ instead of $2$). Another configuration, $(1,2,3,1,3,2,2,1)$ has 6

Updated: It was $2$ instead of $3$

Source Link

n balls, k colors, expected color change problem

I was asked this question during my interview recently and despite how much I think about it, I am yet to figure it out:


Given $n$ balls which are painted by $k$ colors. Let $s_i$ number of balls painted color $i$, $\sum(s_i)=n$. If we go from left to right, what is the expected number of color change?

Example: for ($n$=8, $k$=3), this configuration $(1,1,1,2,2,2,3,3)$ has $3$ color changes.