function f = slow_fraction(num_sites,T,tau)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% INPUT
% num_sites is the number of sites in the system

% T is the temperature of the system 

% tau is the time you wait before these blocks go away

% OUTPUT
% f is the fraction of slow sites in the system (given the tempetature T,and with respect to time tau).

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

if T<.001
    error('The temperature is to low for this code to work. Increase temperature to 10^(-3).')
end


% initialize the system
p = rand(num_sites,1);
R = exp(-p./T);
slow = find(R.*tau < 1);

f = length(slow)/num_sites;

