function average = expectedValueCoinTosses(num_coins, num_simulations)
% should return the average number of heads you get if you flip num_coins
% coins num_simulations times.

coins = zeros(1, num_coins);

num_heads = zeros(1,num_simulations);

for j = 1:num_simulations


for i = 1:num_coins
    coins(i) = randi(2)-1;
end
% makes a random vector of 0s and 1s.

num_heads(j) = sum(coins);

end

average = mean(num_heads);