There is a tough mistake in your code example: you wrote 150/208 and 190/209 . This is integer division, and both results result in zero . You should have written: 150.0/208 and 190.0/209 to instruct the compiler to separate them as double integers.
Edit:
Assuming the RNG system is flat and that your table looks like this:
[item] [amount] 0 3 000 000 25 1 500 000 50 2 000 000 75 300 000 100 10 000 150 10 000 (no typo) sum = 6820000
Then your randomizer might look like this:
int randomItemNumber = Random.Next(6820000); // 0..6819999 if(randomItemNumber < 3000000) Console.WriteLine("Aah, you've won the Item type #0\n"); else if(randomItemNumber < 3000000+1500000) Console.WriteLine("Aah, you've won the Item type #1\n"); else if(randomItemNumber < 3000000+1500000+2000000) Console.WriteLine("Aah, you've won the Item type #2\n"); else if(randomItemNumber < 3000000+1500000+2000000+300000) Console.WriteLine("Aah, you've won the Item type #3\n"); else if(randomItemNumber < 3000000+1500000+2000000+300000+10000) Console.WriteLine("Aah, you've won the Item type #4\n"); else if(randomItemNumber < 3000000+1500000+2000000+300000+10000+10000) Console.WriteLine("Aah, you've won the Item type #5\n"); else Console.WriteLine("Oops, somehow you won nothing, the code is broken!\n");
The idea is that you put all the items in the looong line one by one, but you keep them in your groups. So, at launch, there are three million of the first grade, then the millionth half of the second type, and so on. In total there are 6820000 items in the line. Now you randomly select a number from 1 to 6820000 (or from 0 to 6819999) and use it as the item NUMBER in LINE.
Since the elements are present in the line with their correct statistical distribution, then if the randomization 1-6820000 was FLAT, then the final "lottery" will have the distribution exactly as you wanted.
The only trick to explain is how to guess which item was selected. This is why we saved items in groups. The first part of 3,000,000 elements is the first type, so if the number was less than 3,000,000, we fell into the first type. If more than that, but below the next 1,500,000 (below 4,500,000), then the second type appears .. etc.