Notes
Essential Knowledge:
- Simulations are abstractions for complex objects or phenomena.
- They mimic real-world events with simplifications.
- Simulations are used to refine results or hypotheses.
- They may have limitations or biases.
- Examples include radar displays, RNG for simulating variability, and weather forecasting.
- Car-testing simulations assume certain conditions like driver age and seatbelt use.
Flight Simulator:
- Flight simulator is an example of a simulation.
- It allows users to simulate flying real planes, choosing the plane type and location.
- Benefits include cost savings, safety, and resource conservation.
- Simulations save money and resources but aren’t actual real-life experiences.
Vocabulary:
- Simulation Abstraction: Errors or unusual occurrences in simulations.
- Heuristic: an approach used when the best solution is impractical.
Simulations vs. Experiments:
- Simulations mock real-world items without using the actual items.
- Experiments involve real-world objects and equipment.
- Simulations are often less expensive.
- Experiments provide actual results.
- Simulations can model impractical real-world events.
- Experiments can be riskier and more invasive.
- Simulations are safer and less expensive.
Algorithmic Efficiency:
- It measures the fastest and least resource-dependent solution to a problem.
- It’s determined by the number of computations (steps) in an algorithm.
- Efficiency varies with input size.
Basic Algorithm Example:
- Sorting cards with comparisons and swaps.
- More efficient algorithms require fewer comparisons and swaps.
Algorithm Efficiency Simply Explained:
- Efficiency is measured by the number of steps.
- Algorithms need to be analyzed with different input sizes.
- Reasonable algorithms operate with polynomial efficiency.
Homework
# HW 1: 4 numbers from lowest to highest
def sort_numbers(a, b, c, d):
# Create a list of the numbers
numbers = [a, b, c, d]
# Sort the list in ascending order
numbers.sort()
# Return the sorted numbers
return numbers
# Example usage:
a = 3
b = 1
c = 4
d = 2
sorted_nums = sort_numbers(a, b, c, d)
print("Sorted numbers:", sorted_nums)
HW 2: Benefits and Negative of Using a Simulation
- Benefit - Cost-Effective: Simulations can be much more cost-effective than conducting real-world experiments, as they don’t require physical resources or expensive equipment.
- Benefit - Safety: Simulations allow for the testing of scenarios that would be dangerous or risky in the real world, ensuring the safety of participants and valuable assets.
- Benefit - Resource Conservation: Simulations reduce resource consumption, such as fuel or materials, which is important for environmental and economic reasons.
- Negative - Lack of Real-Life Accuracy: Simulations may not always accurately replicate real-world conditions, leading to potential biases and limitations. They may not provide a complete understanding of complex, real-world systems, and some details might be oversimplified or overlooked.
HW 3: Social Media that uses Simulation
- News feed algorithm - Social media platoforms like Instagram use algorithms to curate and personalize people’s feeds (For You Page). These algorithms take into account a variety of factors, such as a user’s past interactions, content preferences, and the popularity of posts, to show them content that is more relevant and engaging.