0% found this document useful (0 votes)
2 views

Introduction to Algorithms – Foundations of Computing

Uploaded by

barofluttter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Introduction to Algorithms – Foundations of Computing

Uploaded by

barofluttter
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Introduction to Algorithms – Foundations of Computing

- Instructor Name
- Date

Agenda
1. Introduction and Context
2. What is an Algorithm?
3. Historical Context
4. Algorithms Predate Computers
5. Algorithms as the Soul of Computing
6. Why Study Algorithms?
7. Formal Definition of an Algorithm
8. Example – Euclid’s Algorithm for GCD

9. Characteristics of a Good Algorithm


10. Real-Life Examples of Algorithms
11. Algorithms in Computing
12. Types of Algorithms in Computing
13. Pseudocode and Flowcharts
14. Importance of Algorithms in Problem Solving and Computing
15. Summary and Q&A

Introduction and Context


- Welcome to the course on algorithms
- Goals for today:
- Understand the central role of algorithms in computing
- Appreciate that algorithms are more than just code
- Situate algorithms historically and contextually

What is an Algorithm?
- Definition: A finite sequence of well-defined, unambiguous instructions or steps that can be
executed in a finite amount of time to solve a specific problem or perform a computation.
- Algorithms are abstract models of computation—blueprints for solving problems.

Historical Context
- The word “algorithm” has its roots in the name of a 9th-century Persian mathematician:
Muhammad ibn Musa al-Khwarizmi.
- His Latinized name, Algoritmi, became synonymous with the rules of performing arithmetic
using Hindu-Arabic numerals.

Algorithms Predate Computers


- Algorithms existed long before the first digital computer.
- Examples:
- Euclid’s algorithm (circa 300 BCE) for finding the greatest common divisor of two numbers
- Recipes in cooking
- Navigational charts used by sailors
- Legal procedures and judicial processes

Algorithms as the Soul of Computing


- Computers are essentially passive tools; algorithms give them purpose and direction.
- Every piece of software is driven by algorithms.

Why Study Algorithms?


- Studying algorithms helps us answer critical questions:
- How can we solve a problem efficiently?
- Can we prove that our solution works correctly for all possible inputs?
- Are there better ways to approach the same problem?
- How do different algorithms compare in terms of performance and scalability?

Formal Definition of an Algorithm


- An algorithm is a finite, well-defined, and effective sequence of instructions to solve a specific
problem or perform a computational task.
- Five essential properties:
1. Input
2. Output
3. Definiteness
4. Finiteness
5. Effectiveness

Example – Euclid’s Algorithm for GCD


- Given two positive integers `a` and `b`, where `a > b`:
```text
While b ≠ 0:
Replace a with b
Replace b with a mod b
When b = 0, return a as the GCD
```
- Example: GCD(48, 18)
- Step 1: 48 mod 18 = 12 → Now compute GCD(18, 12)
- Step 2: 18 mod 12 = 6 → Now compute GCD(12, 6)
- Step 3: 12 mod 6 = 0 → Return 6 as GCD

Characteristics of a Good Algorithm


- Correctness: Solves the intended problem accurately
- Efficiency: Uses minimal time and memory
- Finiteness: Terminates in finite time
- Definiteness: Steps are clear and unambiguous
- Input/Output: Clearly defines what goes in and comes out
- Generality: Works for a wide range of inputs

Real-Life Examples of Algorithms


- Baking a cake
- GPS navigation instructions
- Long division
- Logging into your email
- Tying your shoelaces

Algorithms in Computing
- Searching: Binary Search
- Sorting: Merge Sort, Quick Sort
- AI / ML: Backpropagation, Decision Trees
- Networking: Dijkstra’s Algorithm
- Databases: Query Optimization Algorithms
- Security: RSA, AES

Types of Algorithms in Computing


- Brute Force: Try all possibilities
- Divide and Conquer: Split, solve, combine
- Greedy: Choose best local option
- Dynamic Programming: Remember previous results
- Backtracking: Try and retract
- Recursive: Self-calling function
- Graph Algorithms: Work on graph structures

Pseudocode and Flowcharts


- Pseudocode: Simplified, high-level description of an algorithm
- Flowcharts: Visual representation of an algorithm

Importance of Algorithms in Problem Solving and Computing


- Algorithms are the blueprint of software
- They enable efficiency, scalability, and performance
- Central to computational thinking and automation
- Power modern technologies like AI, networking, and security

What is an Algorithm? (Detailed)


- Definition: A finite sequence of well-defined, unambiguous instructions or steps that can be
executed in a finite amount of time to solve a specific problem or perform a computation.
- Algorithms are abstract models of computation—blueprints for solving problems.
Historical Context (Detailed)
- The word “algorithm” has its roots in the name of a 9th-century Persian mathematician:
Muhammad ibn Musa al-Khwarizmi.
- His Latinized name, Algoritmi, became synonymous with the rules of performing arithmetic
using Hindu-Arabic numerals.

Algorithms Predate Computers (Detailed)


- Algorithms existed long before the first digital computer.
- Examples:
- Euclid’s algorithm (circa 300 BCE) for finding the greatest common divisor of two numbers
- Recipes in cooking
- Navigational charts used by sailors
- Legal procedures and judicial processes

Algorithms as the Soul of Computing (Detailed)


- Computers are essentially passive tools; algorithms give them purpose and direction.
- Every piece of software is driven by algorithms.

Why Study Algorithms? (Detailed)


- Studying algorithms helps us answer critical questions:
- How can we solve a problem efficiently?
- Can we prove that our solution works correctly for all possible inputs?
- Are there better ways to approach the same problem?
- How do different algorithms compare in terms of performance and scalability?

Formal Definition of an Algorithm (Detailed)


- An algorithm is a finite, well-defined, and effective sequence of instructions to solve a specific
problem or perform a computational task.
- Five essential properties:
1. Input
2. Output
3. Definiteness
4. Finiteness
5. Effectiveness

Example – Euclid’s Algorithm for GCD (Detailed)


- Given two positive integers `a` and `b`, where `a > b`:
```text
While b ≠ 0:
Replace a with b
Replace b with a mod b
When b = 0, return a as the GCD
```
- Example: GCD(48, 18)
- Step 1: 48 mod 18 = 12 → Now compute GCD(18, 12)
- Step 2: 18 mod 12 = 6 → Now compute GCD(12, 6)
- Step 3: 12 mod 6 = 0 → Return 6 as GCD

Characteristics of a Good Algorithm (Detailed)


- Correctness: Solves the intended problem accurately
- Efficiency: Uses minimal time and memory
- Finiteness: Terminates in finite time
- Definiteness: Steps are clear and unambiguous
- Input/Output: Clearly defines what goes in and comes out
- Generality: Works for a wide range of inputs

Real-Life Examples of Algorithms (Detailed)


- Baking a cake
- GPS navigation instructions
- Long division
- Logging into your email
- Tying your shoelaces

Algorithms in Computing (Detailed)


- Searching: Binary Search
- Sorting: Merge Sort, Quick Sort
- AI / ML: Backpropagation, Decision Trees
- Networking: Dijkstra’s Algorithm
- Databases: Query Optimization Algorithms
- Security: RSA, AES

Types of Algorithms in Computing (Detailed)


- Brute Force: Try all possibilities
- Divide and Conquer: Split, solve, combine
- Greedy: Choose best local option
- Dynamic Programming: Remember previous results
- Backtracking: Try and retract
- Recursive: Self-calling function
- Graph Algorithms: Work on graph structures

Pseudocode and Flowcharts (Detailed)


- Pseudocode: Simplified, high-level description of an algorithm
- Flowcharts: Visual representation of an algorithm

Importance of Algorithms in Problem Solving and Computing (Detailed)


- Algorithms are the blueprint of software
- They enable efficiency, scalability, and performance
- Central to computational thinking and automation
- Power modern technologies like AI, networking, and security

Summary
- Algorithms are foundational to computing
- They are not just lines of code but logical structures
- Understanding algorithms empowers us to harness the full potential of computing systems

You might also like