%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

data_a = load('a_delayed.txt');
data_b = load('b_delayed.txt');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

singles_a_index = 3;
coin_a_index = 6;

singles_a_mean = mean(data_a(:, singles_a_index));
singles_a_std = std(data_a(:, singles_a_index));

coin_a_mean = mean(data_a(:, coin_a_index));
coin_a_std = std(data_a(:, coin_a_index));

flash_prob_a_mean = coin_a_mean/singles_a_mean;
flash_prob_a_std = flash_prob_a_mean*sqrt((coin_a_std/coin_a_mean)^2 +...
                                          (singles_a_std/singles_a_mean)^2);

[flash_prob_a_mean, flash_prob_a_std]
                                      
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

singles_b_index = 3;
coin_b_index = 6;

singles_b_mean = mean(data_b(:, singles_b_index));
singles_b_std = std(data_b(:, singles_b_index));

coin_b_mean = mean(data_b(:, coin_b_index));
coin_b_std = std(data_b(:, coin_b_index));

flash_prob_b_mean = coin_b_mean/singles_b_mean;
flash_prob_b_std = flash_prob_b_mean*sqrt((coin_b_std/coin_b_mean)^2 +...
                                          (singles_b_std/singles_b_mean)^2);

[flash_prob_b_mean, flash_prob_b_std]

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
