Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 10;
- allocations = RandomChoice[Range[n], n + 1];
- endx = {};
- Do[
- endx = Append[endx,
- Length[Select[allocations[[i ;;]], # == allocations[[i]] &]]]
- , {i, n + 1}];
- Manipulate[ Graphics[Join[
- Table[{ColorData["DarkBands"][i/(n + 1)],
- Disk[{0, i} + t ({7 - 0.5 endx[[i]], allocations[[i]]} - {0, i}),
- 0.25]}, {i, 1, n + 1}],
- {Red, PointSize[Medium]},
- Table[Point[{0, i}], {i, n + 1}],
- {Blue},
- Table[Point[{7, i}], {i, n}]
- ], PlotRange -> {{-1, 8}, {0, n + 2}}],
- {t,0,1} ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement