<jupyter_start><jupyter_text>Project P5**There is a famous problem in statistics that concerns a room full of people: Same Birthday!**An instructor offers a prize of $20.00 to anyone who thinks that two people in the room have the same birthday.Your assignment is to build a Monte Carlo simulation to tell the instructor how many people need to be in the room to give him/her a better than 50% chance of winning the $20.That is to say how many people need to be in a room in order for the probability of two of them having the same birthday is greater than 50%. Do the same for 95% and 99%.<jupyter_code>import numpy as np

# # Create funtion to run simulations
import numpy as np

def simulation_birthday(prop): 
   #365 days in the year                
    for people in range(1,365):
        # simulation of the Array
        semulation = np.array([])  
        # matches result                       
        matches= 0                                        
        # Range of people = 5000
        for i in range(5000):

           #  Random birthday                            
            birthdays = np.random.randint(0,365, people)

            #If the simulation matches to birthday or not
            if len(np.unique(birthdays)) != len(birthdays): 

                semulation = np.append(semulation,1)
            else:                                               
                semulation = np.append(semulation,0)

        # matches probability        
        matches =(np.mean(semulation) * 100)
        
        if matches >= prop:
            break
        
         
      

    print("{} Number of people in a room".format(people))
    print("{}% of two people having the same birthday".format(matches))




# Run simulations

simulation_birthday(99)
simulation_birthday(95)
simulation_birthday(50)<jupyter_output>57 Number of people in a room
99.1% of two people having the same birthday
46 Number of people in a room
95.04% of two people having the same birthday
24 Number of people in a room
53.68000000000001% of two people having the same birthday
{'fraction_non_alphanumeric': 0.05799151343705799, 'fraction_numerical': 0.03536067892503536, 'mean_word_length': 1.943134535367545, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '653848', 'license': 'Apache-2.0', 'n_tokens_mistral': 608, 'n_tokens_neox': 515, 'n_words': 241, 'path': 'Weekend_project.ipynb', 'repo_name': 'SarahAlhugail/intro_to_python-', 'size': '2121'}