for (var i:Number = 0; i < 100; i++) { var k:Number = Math.round(Math.random() * 4); b[k]++; a[Math.round(Math.random() * 4)]++; }