|
Supongamos que tenemos una lotería que tiene los siguientes pagos 1,2,5,6,9,10,16. El organizador espera un beneficio del 4% de la lotería. Escribí un código PHP que simula esto, pero no soy bueno en probabilidades, por lo que obtengo resultados incorrectos.
para ($i = 0; $i < 10000; $i++) {
$rand principal = rand(1100);
$pagar = 0;
if($principal > 96 && $principal <=100){
$pagar = 0;
}
si($principal > 90 && $principal <=96){
$pago = 16;
}
si($principal > 81 && $principal <=90){
$pago = 10;
}
if($principal > 72 && $principal <=81){
$pago = 9;
}
if($principal > 60 && $principal <=72){
$pago = 6;
}
if($principal > 48 && $principal <=60){
$pago = 5;
}
if($principal > 24 && $principal <=48){
$pagar = 2;
}
si($principal > 0 && $principal <=24){
$pagar = 1;
}
$dinero += $pagar;
}
eco $dinero;
Espero que el dinero en dólares esté muy cerca de 9600, pero está muy lejos. La lógica en este código era calcular la probabilidad de obtener, digamos, un pago de 16 veces de 96 resultados posibles https://loteriasdehoycolombia.co/, y así sucesivamente, reduciendo cada probabilidad de los resultados. Aumento el número generado aleatoriamente a aprox. 450 y todo llega a su lugar pero quiero entender la lógica. Los pagos y el margen de beneficio se pueden cambiar, por lo que sería maravilloso si alguien pudiera ayudarme a comprender la lógica (algoritmo) de que esto se pueda contar.
Posted:
Friday, October 27, 2023 12:55 PM
|
Swish Limo rental in houston being the most reliable service in town not only offers a number of features which makes it better than others but also provides everything under the affordability range. Delays are not witnessed as such because the chauffeur is already informed about all the weather and traffic conditions prior to this. Also, chauffeurs are very well-mannered and highly trained and exhibit extremely kind and gentle behaviour. Wedding limo services Houston typically offer a range of luxury vehicles, including limousines, sedans, SUVs, and even party buses.
Posted:
Tuesday, March 21, 2023 2:40 PM
|
If you are visiting the Houston Medical Center for medical treatment, it's important to have reliable and comfortable transportation to get you there and back safely. Fortunately, there are several transportation services available in the Houston area that specialize in providing transportation to and from the Houston Medical Center.Swish Limo offers luxury transportation services in Houston, including medical transportation to and from the Houston Medical Center. They have a fleet of luxurious vehicles, including sedans, SUVs, and limousines, that can provide a comfortable and stylish ride.
Posted:
Wednesday, March 15, 2023 2:32 PM
|
To enable/disable multiple RDP sessions in Windows Server 2012, follow these steps:
- Open the Server Manager
- Click on "Local Server"
- Go to "Remote Desktop" and turn on/off " like we enable/disable dark mode in whatsappgb Allow Remote Connections to this Computer".
Posted:
Sunday, February 05, 2023 1:25 PM
|
How do I get the apk file from an android device? Or how do I transfer the Gb whastsapp apk file from device to system?
Posted:
Saturday, December 31, 2022 11:55 AM
|