Answer:
import random
def calc_birthday_probability(num_people):
num_tries = 1e6
num_duplicates = 0
tries = 0
while tries < num_tries:
total_birthday = {}
for i in range(1, 366):
total_birthday[i] = 0
for count in range(num_people):
birthday = random.randint(1, 365)
if total_birthday[birthday] != 0:
num_duplicates += 1
break
total_birthday[birthday] += 1
tries += 1
return num_duplicates/num_tries
def main():
num_people = 10
p = calc_birthday_probability (num_people)
print(p)
num_people = 20
p = calc_birthday_probability (num_people)
print(p)
return
if __name__ == "__main__":
random.seed(2020)
main()
Explanation:
-
Run the loop until the value of tries is less than num_tries to do number of trials.
- Run the loop to create the desired number of birthdays by generating random numbers.
- Increase the num_duplicates variable by 1, if the birthday has already occurred.
- Lastly define and then call the main function.
Answer:
rotate text is the correct answer
Answer:
Types of Hybrid Computers:
1. Large Electronic Hybrid Computer
2. General-Purpose Hybrid Computers
3. Special-Purpose Hybrid Computers
Examples of Hybrid Computers
1. Gasoline Station
2. Electrocardiogram Machine
3. Ultrasound Machine
4. Monitoring Machine
5. Research and Production Industries
6. Forensic
7. Defence
Types of Analogue Computers
1. Slide Rules
2. Differential Analysers
3. Castle Clock
4. Electronic Analogue Computers
5. Mechanical Analogue Computers
Examples of Analogue Computers
1. Thermometer
2. Speedometer
3. Analogue Clock
4. Seismometer
5. Voltmeter
6. Flight Simulators
7. Tide Predictors
Types of Digital Computers
1. Micro Computer
2. Mini Computer
3. Mainframe Computer
4. Super Computer
Examples of Digital Computers
1. Calculator
2. Digital Clock
3. Automobiles
4. Weighing Machine
5. Consumer Electronic Equipments
6. Smart Phones
7. Laptop/Personal Computer
8. ATM
Skype isn't a cloud based system. Cloud based systems are online storage systems. Google Drive, Dropbox, and SkyDrive are all pieces of software which allow you to store data on a remote server over the internet. Skype is just a program.