using System.Collections.Generic;
using System.Threading.Tasks;
private static Random rnd = new Random((int)DateTime.Now.Ticks & 0x0000FFFF);
private static int overflow = 1;
public static void Main()
int[] conteo = { 0, 0, 0, 0, 0, 0, 0 };
for (i = 0; i < 1000000000; i++)
int numero = RollRandom5();
if (numero > 0 && numero < 8)
for (int numero = 0; numero < 7; numero++)
double probabilidad = ((double)conteo[numero] / (double)i) * 100.00;
Console.WriteLine("El numero " + (numero + 1) + " aparecio " + conteo[numero] + " veces la probabilidad de ocurrencia fue " + probabilidad+"%");
public static int RollRandom7()
public static int RollRandom5()
int number = RollRandom7();
number = number <= 5 ? number : RemoveOverflow();
private static int RemoveOverflow()
overflow = overflow <= 4 ? overflow + 1 : 1;