formatting pass nuclear probabilities

This commit is contained in:
NunoSempere 2023-07-23 23:54:15 +02:00
parent 8b32d2d9b6
commit b76a630d58

View File

@ -3,9 +3,8 @@
#include <stdio.h>
#include <stdlib.h>
double probability_of_dying_nuno(uint64_t* seed){
double probability_of_dying_nuno(uint64_t* seed)
{
double first_year_russian_nuclear_weapons = 1953;
double current_year = 2023;
double laplace_probability_nuclear_exchange_next_year = sample_beta(current_year - first_year_russian_nuclear_weapons, 0, seed);
@ -18,14 +17,12 @@ double probability_of_dying_nuno(uint64_t* seed){
// 0.2 to 0.8, i.e., 20% to 80%, again using the previous tool
double proportion_which_die_if_bomb_drops_in_london = sample_beta(10.00, 2.45, seed); // 60% to 95%
double probability_of_dying = laplace_probability_nuclear_exchange_next_year *
london_hit_conditional_on_russia_nuclear_weapon_usage *
informed_actor_not_able_to_escape *
proportion_which_die_if_bomb_drops_in_london;
double probability_of_dying = laplace_probability_nuclear_exchange_next_year * london_hit_conditional_on_russia_nuclear_weapon_usage * informed_actor_not_able_to_escape * proportion_which_die_if_bomb_drops_in_london;
return probability_of_dying;
}
double probability_of_dying_eli(uint64_t* seed){
double probability_of_dying_eli(uint64_t* seed)
{
double russia_nato_nuclear_exchange_in_next_month = sample_beta(1.30, 1182.99, seed); // .0001 to .003
double london_hit_conditional = sample_beta(3.47, 8.97, seed); // 0.1 to 0.5
double informed_actors_not_able_to_escape = sample_beta(2.73, 5.67, seed); // .1 to .6
@ -33,7 +30,6 @@ double probability_of_dying_eli(uint64_t* seed){
double probability_of_dying = russia_nato_nuclear_exchange_in_next_month * london_hit_conditional * informed_actors_not_able_to_escape * proportion_which_die_if_bomb_drops_in_london;
return probability_of_dying;
}
int main()
@ -42,6 +38,5 @@ int main()
uint64_t* seed = malloc(sizeof(uint64_t));
*seed = 1000; // xorshift can't start with 0
free(seed);
}