Introduction to Computer Science and Programming Lecture 1

Jul 12, 2024

MIT OpenCourseWare: Introduction to Computer Science and Programming (Lecture 1)

Instructor Introduction

  • Professor Eric Grimson and Professor John Guttag are lecturing.
  • Both have extensive experience in Course 6 (Computer Science).
  • Emphasis on taking the course seriously to learn about computation.

Lecture Goals

  1. Administrivia: Course logistics and rules.
  2. Course Objectives: Skills and knowledge students will gain by the end.
  3. Introduction to Computational Thinking: Concepts to be covered.

Course Goals and Target Audience

Strategic Goals

  1. Prepare Freshmen and Sophomores:

    • Ensure students can easily transition into Course 6.
    • No prior programming experience needed.
    • Not everyone needs to major in Course 6.
  2. Confidence in Coding:

    • Equip all students to read and write small pieces of code.
  3. Understanding of Computation:

    • Recognize its role in solving technical problems.
  4. Competence and Confidence:

    • Ready students for internships and jobs, emphasizing computational problem-solving skills.

Tactical Goals

  1. Basic Tools of Computational Thinking:

    • Writing small-scale programs.
  2. Vocabulary of Computational Tools:

    • Ability to understand programs written by others.
    • Valuable for leveraging pre-existing code.
  3. Understand Computational Limits:

    • Know what computations are possible and their costs.
  4. Map Problems to Computational Frames:

    • Convert problems into computational terms for problem-solving.

Course Logistics

Class Structure

  • Lectures: Tuesdays and Thursdays at 11:00 AM.
  • Recitations: One hour weekly on Fridays (varied times).
  • Outside Class Work: Approx. 9 hours per week (mainly problem sets in Python).

Quizzes and Exams

  • Two Quizzes: Dates on the course website (open book/note).
  • Final Exam: Scheduled during final exams period.
  • Grading: 55% problem sets, 45% quizzes (10%, 15%, 20%).
  • Problem Set 0: Initial setup, very easy to introduce Python.

Resources

  • Problem Sets: Posted on the website.
  • Class Notes: Not provided, encourages note-taking for better learning.
  • Textbook: Optional, recommended book listed on the course site.
  • Recitation Signup: Required through the course website.

Assistance

  • TAs and Professors available for help and questions.
  • Students encouraged to ask for help rather than struggle alone.

OpenCourseWare Videotaping

  • Lectures are being recorded. Students not wanting to be recorded should sit in the back three rows.

Key Teaching Points

Computational Thinking

  • Aim: Make computers do what you want them to do through computational problem-solving.
  • Focus on computational modes of thought over memorization.

What is Computation?

  • Separation of Mechanism and Thought:
    • Computation is not just the machine but the process and method.

Knowledge Classification

  • Declarative Knowledge:
    • Statements of fact (e.g., mathematical definitions).
  • Imperative Knowledge:
    • Process of deducing information (e.g., algorithms).

Early Computers

  • Fixed-Program Computers:

    • Designed for specific tasks (e.g., calculators, early machines solving specific equations).
  • Stored-Program Computers:

    • Flexibility to execute any sequence of instructions described in a program.

Modern Computing

  • Interpreter:
    • Core of stored-program computers, enabling execution of sequences of instructions.

Architecture Overview

  • Memory, Control Unit, ALU, Program Counter:
    • Descriptions stored as instructions in memory, executed sequentially, enabling complex computations.

Fundamental Primitives

  • Alan Turing (1936): Showed with six basic primitives, any mechanical process can be described.
  • Programming Languages: Different languages suited for different tasks.
  • Python: Chosen for this course for its ease and general-purpose capabilities.
    • Emphasis on computational thinking rather than learning Python syntax.

Language Dimensions

  • High-Level vs. Low-Level: Abstraction level relative to hardware.
  • General vs. Targeted: Suitability for broad tasks vs. specific applications.
  • Interpreted vs. Compiled: Execution method (line-by-line vs. pre-compiled).

Python as a Language

  • High-Level, General-Purpose, Interpreted: Balances ease of learning and application flexibility.
  • Focus on developing skills transferable to other languages.

Python Basics

Data Types

  • Numbers: Integers, Floats.
    • int: Integer.
    • float: Real number with a decimal point.
  • Strings: Sequence of characters enclosed in quotes.

Operations

  • Arithmetic: Addition, subtraction, multiplication, division, exponentiation.
  • String Operations: Concatenation, repetition.

Variables

  • Assignment: Binding values to variable names using =.
  • Stay tuned for more next lecture.

Summary

  • Check course website for recitation sign-ups.
  • Engage with course material and ask for help when needed.