• space
  • New to Blogin'?
  • Contact
  • Sign In
  • reset page

This Cluster

  • av0id ¦ How I Got Here
  • Behind the Sceanic
  • My Bits ¦ elf
  • eLf ¦ Updates on the land
  • vOw ¦ Vegan Organic Wholefood
  • b2Evo ¦ Blog techie stuff

Red Shifted

  • 1996 Site
  • Old Search Site

Space Has NumbersUpdated: March 22nd, 2022

Created: 22/03/22
import random def birthdayMatched(members): numYearDa ys = 365 # Number of days s = range(numYearDays) matched = False membersList=[None] * members for i in range(members): membersList[i] = random.choice(s) if len(set(membersList)) < members : matched = True return matched def sim_birthdayMatched(numTrials): numMatches = 0 numPeopleInParty = 23 for i in range(numTrials): if birthdayMatched(numPeopleInParty): numMatches += 1 return numMatches/numTrials Call: The function takes the number of people as an input sim_birthdayMatched(10000) Output: 0.5077
  roger
print   Print     
 
  •  Paged Index of 89 Posts

  • Contents

    • Odd Bits
    • This Starship
    • Alice and the Rabbit
    • The Elon Gated Zoo
    • Space Has Numbers
    • The Ticket
    • Evil Has no Soul
    • Your Alcohol Has Arrived
    • Lies for Sale, For Free
    • The Traffic
    • Sharing
    • Preparations for Conflict
    • Here is Whence I Am
    • TOTT
    • OK Last Night
    • Can't Save The Future
    • Random Places
    • Awareness and Conciousness
    • Assertion, Conflict and Appeasement.
    • Admin, Bullying and the Cold
  • Search This Blog


Valid HTML 5.0    ubuntu link    duckduckgo link    b2evolution link    firefox link    Creative Commons Licence    Valid CSS!