function [mu,sigma2,ci] = CS_driver_medium(n,m,k,num_samps,num_trials)
% CS_driver_medium - driver function for medium consistent KBs
% On input:
%     n (int): number of atoms
%     m (int): max number of clauses
%     k (int): max number of literals in a clause
%     num_samps (int): number of KBs in a trial
%     num_trials (int): number of trials
% On output:
%     mu (float): average success rate (% solutions found per trial)
%     sigma2 (float):variance in success trials
%     ci (float): confidence interval half-length
% Call:
%     [mu,sigma2,ci] = CS_driver_medium(10,20,5,100,10);
% Author:
%     T. Henderson
%     UU
%     Fall 2022
%

t_100_0_95 = 1.66;

mu = 0;
sigma = 0;
ci = 0;

res = zeros(num_trials,1);
rng('default');

for t = 1:num_trials
    [t,num_trials]
    r = CS_EX1_medium(num_samps,1);
    res(t) = sum(r>0)/num_samps;
end

mu = mean(res);
sigma2 = var(res);
ci = t_100_0_95*sqrt(sigma2/100);
