Lecture 1: Introduction to ECS 6100L

Jun 28, 2024

Lecture 1: Introduction to ECS 6100L

Instructor Information

  • Instructor: Anna Belle (First name: Anna, Last name: Belle)
  • Department: ECS
  • Teaching Experience: 10 years

Course Overview

  • Course Number: 6100L
  • Semester: Full semester version of 6100A
  • Focus: Introduction to programming with Python
  • Materials: Download lecture slides beforehand, take notes, and run code during lectures
  • Lecture Format: Mix of teaching, interactive coding (called "Utri Breaks"), and Q&A
  • Importance of Participation: Emphasis on practice to develop programming skills

Key Goals

  1. Knowledge of Concepts: Understanding fundamental computer science concepts
  2. Programming Skill: Developing the ability to code in Python
  3. Problem-Solving Skills: Translating problems from English into computational solutions

Topics Covered

  1. Computational Thinking: Applying computation to solve problems
  2. Python Programming: Basics to advanced usage
  3. Code Organization: Structuring code for readability and modularity
  4. Basic Algorithms: Introduction to foundational algorithms
  5. Algorithmic Complexity: Assessing the efficiency and memory usage of programs

Types of Knowledge

  • Declarative Knowledge: Statements of fact (less relevant for CS)
  • Imperative Knowledge: Recipes for how to do something (crucial for programming)

Example: Finding the Square Root

  1. Declarative Statement: The square root of X is Y such that Y * Y = X
  2. Imperative Recipe: Approximate the square root using iterative guesses

What is an Algorithm?

  • Sequence of Steps: Clear, defined steps to achieve a task
  • Control Flow: Decisions and loops within the sequence (e.g., if-else, repeat-until)
  • Termination: A clear stopping point for the algorithm

Computers and Programming Languages

  • Fixed Program Computers: Hardwired for specific tasks (e.g., calculators)
  • Stored Program Computers: Can store and execute instructions as data
  • Turing Completeness: Any computable problem can be solved in any programming language
  • Python Primitives: More convenient and comprehensive than basic computational primitives

Expressions and Types

  • Expressions: Evaluated to produce a single value (e.g., 3 + 2 evaluates to 5)
  • Types: Integers, floats, Boolean values, etc.
  • Object Type Commands: Use type() to determine the type of an object
  • Type Casting: Converting objects from one type to another (e.g., float(3) gives 3.0)

Variables and Assignment

  • Variable Binding: Associating names with values for easier manipulation (e.g., pi = 3.14)
  • Assignment Operator (=): Assigns the result of an expression to a variable
  • Command Syntax: Object and command structure in Python (e.g., x = y + 1)
  • Rebinding Variables: Changing the value associated with a variable (e.g., radius = radius + 1)

Errors and Debugging

  • Syntax Errors: Errors in the structure of the code
  • Static Semantic Errors: Invalid operations given the types involved
  • Semantic Errors: Errors in the logic causing the program to produce unintended results

Function: Python Tutor

  • Use: Step-by-step visualization of code execution to help with debugging

Summary

  1. Objects and Types: Understanding and using Python's object types
  2. Expressions: Creating and evaluating expressions
  3. Variables: Using variables for storing and manipulating values
  4. Assignments: Using assignment statements to bind variables to values
  5. Control Flow Preview: Preparation for introducing decision points in future lectures

Next Steps

  • Future Lectures: Introducing control flow constructs like if-else statements