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:
umm... you did not discribe the anwsers, i cannot help you
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
Answer:
Spyware
Explanation:
Spyware is the software which is used to track the online movements, it also track the user action on the computer they are also called sneakware or stealthware
- This software is used in the business purpose which it may be used in the office to track the record of employee in the working hours .
- Spyware software is used to track the information without knowing the user.
In a polling-based network receives, the operating system keeps checking the status register after a fixed time interval to see whether a device needs hardware attention or not. CPU gradually checks the status of receive bit after a defined time interval of a clock and if the value of receive bit is true then data is moved from the RX register to the memory. In interrupt-based networks, whenever a device needs hardware processing then an interrupt is raised to inform the CPU for device attention. The data of the device is transferred to memory from the network card.
Polling is a protocol, not a hardware mechanism where the device gets attention by CPU. An interrupt is a hardware mechanism, not a protocol where the device gets attention by the interrupt handler. In polling, during receiving, parts of received data need to transfer to memory but in case of interrupts, whole data is transferred at once after receiving is done. An interrupt is a heavy operation as compared to pooling because hardware involves in it. For large amounts of data, Polling becomes an inefficient method. In polling, CPU gradually checks devices at regular intervals whereas the Interrupt handler can send interrupt at any time. Each device has its own Command ready bit which indicates whether the device requires servicing or not. In polling, CPU wastes numerous clock cycles by repetitively checking the command-ready little bit of each device. In Interrupt based network, the interrupt request line indicates whether the device requires servicing or not. In interrupt-based network, CPU cycles not wasted but CPU is disturbed only when device send interrupt signals.
Relative performance between programmed I/O and DMA:
For determining the relative performance between programmed I/O and DMA, important factors are:
1. Size of data
2. Frequency of operations