Shaking a jar of balls A jar is filled with two types of balls, red and green. Red balls have radius $r_1$ and mass $m_1$, green balls have radius $r_2$ and mass $m_2$.
If initially the balls are randomly placed throughout the jar, and we are to shake this jar, generally one type of balls will tend to gather at the top. Why does this happen?
What are necessary conditions on $r_1$, $r_2$, $m_1$, $m_2$ such that green balls are more likely to occupy the upper part of the jar after shaking?
 A: I know about several attemps to formulate a theory for this problem (it would seem that this is commonly called the "Brazil Nut Problem" in the English literature, I'm familiar with the "Paranuss-Problem" from the German literature), see


*

*Daniel C. Hong, Paul V. Quinn, Stefan Luding: "The Reverse Brazil Nut Problem: Competition between Percolation and Condensation" (arXiv)


and 


*

*Troy Shinbrot und Fernando J. Muzzio: "Reverse Buoyancy in Shaken Granular Beds", Phys. Rev. Lett. 81, 4365–4368 (1998)

A: It turns out that larger balls tend to move up even if their density is larger than the density of smaller balls. Intuitively it happens because for the small balls on the bottom of a large ball it much more difficult to move than for the ones on the top.   
But there is no rigorous answer to your question. It is a whole area of Granular Matter physics for one to research. Models, different simulations, experiments, e.t.c.
I will also note that the separation between different balls strongly depends on many different properties -- not only sizes and masses. Friction, air flows, boundaries, way of shaking can strongly influence the phenomenon, while there is no  understanding why this is happening.  
