Homework Questions
- Question 1: What is parallel computing? Parallel Computing means to use multiple processors or cores to execute a single program simultaneously.
- Question 2: If there is a computer with 3 cores that can each take one task, and the tasks are 25ms, 632ms and 100ms in run time respectively, how long will the program take to run? Since the computer can technically take all 3 tasks at once, it would take as long as the slowest task. So, since the slowest task here takes a total of 632 ms, to finish all the tasks would take that same amount of time.
- Question 3: Is sequential or parallel computing more efficient, and why? Reaslitically, the average human has multiple programs and softwares running on their computer (maybe while rendering smth on a 3d modeling software your working on homework or playing a video game), and therefore would require parallel computing to have an app running the background. Sequential just is more straighforward, and is easy to resolve bugs or errors with.
- What is the term called when a network has multiple paths leading up to one destination? (Used in fault-tolerant systems) If it has multiple paths, its usually considered “redundant”, allowing it to transmit all the data it needs to in the fastest manner (by checking which way is the best to send information).
- Question 5: Using the image above, is this fault tolerant? The image above HAS a fault tolerant network. If you cut any wire, there would still be one way for the two of the wire you cut, to still comunicate. For example, if you cut a wire AE, you can stil travel from A to E, by going through B. So if line AE has faulty internet, or is corrrupted in come way, it can reroute through A to B, and B to E, as that would be faster.
import random
def get_routing_fact():
routing_facts = [
"The shortest path algorithm used in routing is Dijkstra's algorithm.",
"BGP (Border Gateway Protocol) is a key protocol used in internet routing.",
"Routing tables are used by routers to determine the best path for packet forwarding.",
"OSPF (Open Shortest Path First) is a popular interior gateway protocol for routing within a single autonomous system."
]
return random.choice(routing_facts)
def get_computing_fact():
computing_facts = [
"The first computer programmer was Ada Lovelace, who wrote the first algorithm for Charles Babbage's Analytical Engine.",
"A quantum computer uses qubits, which can exist in multiple states simultaneously due to superposition.",
"Moore's Law states that the number of transistors on a microchip doubles approximately every two years.",
"The ENIAC (Electronic Numerical Integrator and Computer) was one of the earliest general-purpose electronic digital computers."
]
return random.choice(computing_facts)
def main():
routing_fact = get_routing_fact()
computing_fact = get_computing_fact()
print("Fun Fact about Routing: {}".format(routing_fact))
print("Fun Fact about Computing: {}".format(computing_fact))
if __name__ == "__main__":
main()
Fun Fact about Routing: BGP (Border Gateway Protocol) is a key protocol used in internet routing.
Fun Fact about Computing: The first computer programmer was Ada Lovelace, who wrote the first algorithm for Charles Babbage's Analytical Engine.