Alpha Geek

(8)

$10/per page/Negotiable

About Alpha Geek

Levels Tought:
University

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Environmental science,Essay writing,Programming,Social Science,Statistics Hide all
Teaching Since: Apr 2017
Last Sign in: 438 Weeks Ago, 1 Day Ago
Questions Answered: 9562
Tutorials Posted: 9559

Education

  • bachelor in business administration
    Polytechnic State University Sanluis
    Jan-2006 - Nov-2010

  • CPA
    Polytechnic State University
    Jan-2012 - Nov-2016

Experience

  • Professor
    Harvard Square Academy (HS2)
    Mar-2012 - Present

Category > Programming Posted 02 Jun 2017 My Price 5.00

Write a function called has_duplicates that takes a list and returns True

 

The (so-called) Birthday Paradox:

1. Write a function called has_duplicates that takes a list and returns True if there is any element that appears more than once. It should not modify the original list.

2. If there are 23 students in your class, what are the chances that two of you have the same birthday? You can estimate this probability by generating random samples of 23 birthdays and checking for matches. Hint: you can generate random birthdays with the randint function in the random module. You can read about this problem at wikipedia.org/wiki/Birthday_paradox, and you can see my solution at thinkpython.com/code/birthday.py.

 
 

Answers

(8)
Status NEW Posted 02 Jun 2017 08:06 AM My Price 5.00

-----------

Attachments

file 1496391710-Answer.docx preview (222 words )
T-----------he -----------(so------------ca-----------lle-----------d) -----------Bir-----------thd-----------ay -----------Par-----------ado-----------x: ----------- 1.----------- Wr-----------ite----------- a -----------fun-----------cti-----------on -----------cal-----------led----------- ha-----------s_d-----------upl-----------ica-----------tes----------- th-----------at -----------tak-----------es -----------a l-----------ist----------- an-----------d r-----------etu-----------rns----------- Tr-----------ue -----------if -----------the-----------re -----------is -----------any----------- el-----------eme-----------nt -----------tha-----------t a-----------ppe-----------ars----------- mo-----------re -----------tha-----------n o-----------nce-----------. I-----------t s-----------hou-----------ld -----------not----------- mo-----------dif-----------y t-----------he -----------ori-----------gin-----------al -----------lis-----------t. ----------- 2.----------- If----------- th-----------ere----------- ar-----------e 2-----------3 s-----------tud-----------ent-----------s i-----------n y-----------our----------- cl-----------ass-----------, w-----------hat----------- ar-----------e t-----------he -----------cha-----------nce-----------s t-----------hat----------- tw-----------o o-----------f y-----------ou -----------hav-----------e t-----------he -----------sam-----------e b-----------irt-----------hda-----------y? -----------You----------- ca-----------n e-----------sti-----------mat-----------e t-----------his----------- pr-----------oba-----------bil-----------ity----------- by----------- ge-----------ner-----------ati-----------ng -----------ran-----------dom----------- sa-----------mpl-----------es -----------of -----------23 -----------bir-----------thd-----------ays----------- an-----------d c-----------hec-----------kin-----------g f-----------or -----------mat-----------che-----------s. -----------Hin-----------t: -----------you----------- ca-----------n
Not Rated(0)