Why are these throw dice results so even?
<p>This is supposed to roll 6 dice, and keep a record of how many are unique. E.g: 1 2 3 4 5 6 = 6 unique numbers, 1 1 1 1 1 1 = 1 unique number, 1 2 3 3 3 3 = 3 unique numbers. I keep getting a very even % for each dice thrown, about 16.7%.</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;
using namespace std;

int numberGenerator()
{
int x = (rand() % 6) + 1;
return x;
}

int diceCounter()
{

int counter[6] = {0,0,0,0,0,0};

for (int i = 0; i &lt; 6; i++)
    {
    int k = numberGenerator();
        if (k == 1)
           counter[0] = 1;
        if (k == 2)
           counter[1] = 1;
        if (k == 3)
           counter[2] = 1;
        if (k == 4)
           counter[3] = 1;
        if (k == 5)
           counter[4] = 1;
        if (k == 6)
           counter[5] = 1;
     }
return counter[0]+counter[1]+counter[2]+counter[3]+counter[4]+counter[5];
}                 // returns how many unique numbers were rolled


int main()
{
srand(time(NULL));
cout &lt;&lt; diceCounter() &lt;&lt; endl;

int a1 = 0;
int a2 = 0;
int a3 = 0;
int a4 = 0;
int a5 = 0;
int a6 = 0;
int p;


for (int j = 0; j &lt; 1000000; j++)
{
p = numberGenerator();        // for number of unique numbers, it adds +1 to counter
if (p == 1)
a1 += 1;
if (p == 2)
a2 += 1;
if (p == 3)
a3 += 1;
if (p == 4)
a4 += 1;
if (p == 5)
a5 += 1;
if (p == 6)
a6 += 1;
}
cout &lt;&lt; "1 ==&gt; " &lt;&lt; (a1 / 1000000.0)*100 &lt;&lt; "%" &lt;&lt; endl;
cout &lt;&lt; "2 ==&gt; " &lt;&lt; (a2 / 1000000.0)*100 &lt;&lt; "%" &lt;&lt; endl;
cout &lt;&lt; "3 ==&gt; " &lt;&lt; (a3 / 1000000.0)*100 &lt;&lt; "%" &lt;&lt; endl;
cout &lt;&lt; "4 ==&gt; " &lt;&lt; (a4 / 1000000.0)*100 &lt;&lt; "%" &lt;&lt; endl;
cout &lt;&lt; "5 ==&gt; " &lt;&lt; (a5 / 1000000.0)*100 &lt;&lt; "%" &lt;&lt; endl;
cout &lt;&lt; "6 ==&gt; " &lt;&lt; (a6 / 1000000.0)*100 &lt;&lt; "%" &lt;&lt; endl;

                // this results in uniform 16.7% percentages
}
</code></pre>
