function[prob]=trial2(trialmax)

%loop through different amounts of persons
  %  for a=363:365
  
   
        %go through different amount of trials for a particular number of
        %people
        for trials=1:trialmax
        count=0;
            for i=1:365
        
            birthday(i)=ceil(365*rand);
            j=i-1;
                  if birthday(j)==birthday(i), count=count+1,break,end;
                    j=j-1;
                end
            
            %    end
            %prob(a)=count/trialmax;    
            end
       % totalcount(a)=count;
        end
       % prob(a)=totalcount(a)/trialmax;
        %end