I have a one-dimensional array of 200 elements consisting of the numbers 0, 1, 2. This array needs to be divided into 10 groups (20 items each). Then, for each group, I want to count how many of the elements 0, 1, 2 is in each of them. These findings should be stored in three arrays, n0, n1, n2: n0 containing the statistics for the zeros, n1 the statistics for the ones, n2 the statistics for the threes.
For example, one might get n0 = {3, 4, 3, 6, 8, 12, 1, 9, 15, 16, ...}, so in the first 20 elements of the original array there were 3 zeros, in the following 20 there were 4 zeros, and so on.
I have Mathematica 5.0. Please keep in mind that functions first appearing in later versions are not available to me.
Tallyis new in V6 butPartition/Count/Sow/Reapare available to you. Could you please provide a minimal example, e.g. 20 elements divided on 4 groups and a desired output. Now it is unclear what do you want to after counting them. $\endgroup$Tallywhich you can't use. But the first answer there does not use it so you can adapt it, can't you? $\endgroup$