Lecture 0 Slides - What is Computation? + Course Logistics

1 of 62

Welcome!

COMP_SCI 111

2 of 62

About Me - Prof. Connor Bain

Undergrad at the University of South Carolina in Computer Science, Math, and Music

MS/PhD from Northwestern University in Computer Science and Learning Sciences

I'm the Faculty Chair at Willard Residential College

Other classes I teach:

CS 110 - Introduction to Computer Programming

CS 212 - Mathematical Foundations of Computer Science

CS 396 - Communicating Computer Science

CS 397/497 - Pedagogical Design in CS

My research focuses on the idea of computational literacy (both from a design and a cognitive perspective). My office is Tech L374.

3 of 62

The goal of this class is not to manufacture expert programmers. Our goal is to build your computational literacy–your ability to see the world as computable. We'll do this by learning how to reason about and design computer programs.

4 of 62

  1. No showing off.
  2. Ask questions.
  3. Respect and help others.
  4. Read carefully.

Course Tenets

This is a learning community

5 of 62

Lecture 0

What is computation? + Course Overview

6 of 62

Plan for Today

  1. What is Computation?
  2. Logistics and Course Policies
  3. Reminders for Next Time

7 of 62

What’s the information revolution?

  • The shift of certain forms of intellectual labor from humans to machines
  • Including the programming of the machines
    • Increased productivity
    • Certain kinds of intellectual tasks easier and/or cheaper
    • Increases access to knowledge and power (but often not equitably)
    • Enables new kinds of endeavors
    • Eliminates other tasks through economic pressure

8 of 62

9 of 62

10 of 62

The first tool that strengthened the power of his brain rather than his arm.

  • Capt. Grace Hopper

11 of 62

Cultural changes?

  • Too early to tell if information revolution will have the same kinds of long-term unanticipated impact, but …
    • Cell phones, social media, etc., are now major modes of social interaction
    • Facebook is the major news source for 40% of the US population, and that’s changed the dynamics of US elections
    • TikTok has become a major source of knowledge for younger people
    • The video game industry has largely killed the toy industry
    • Almost nobody used libraries for research, but everyone uses google
    • When was the last time you brought a physical music album?
    • Social groups both good and bad all use the internet for recruiting and fundraising
    • Anyone can find out who you know, where you’ve been, and what you do.

12 of 62

but what is computing?

13 of 62

The functional model of computation

A computation

  • Takes a set of inputs
    • Information encoded in some representation(s)
  • Does some stuff (computes)
  • Generates an output
    • Again, information encoded in some representation
  • Stops

input(s)

output

COMPUTE

14 of 62

The functional model

  • A computational problem specifies an output for every possible combination of inputs
    • Essentially, it’s a mathematical function

f(input) = output

  • A computation solves the problem if and only if
    • It always generates the specified output
    • For any given set of inputs
  • The only relevant behavior of a computation is its output
  • We teach the computer how to compute via programs

15 of 62

Question answering

Q: What’s seven plus three?

Pretty much everyone agrees that this is a case of computation

    • I present you with numbers to add
    • You use a mental function to add them
    • You present me with a number (the sum)

A: Ten

16 of 62

What’s <really-big-number>�plus <other-really-big-number>?

17 of 62

What’s different here?

  • I present you with some numbers in spoken English
  • You represent them
    • In a different representation (Arabic numerals)
    • And a different medium (patterns of graphite on paper)
  • And then use a different function to add them
    • It’s now a physical procedure, not just a mental one
  • Translate the answer back into spoken English

18 of 62

Behavioral equivalence

  • It doesn’t matter what representation we use internally
    • English, Arabic numerals, Roman numerals
  • Or what function we use
  • Or where it occurs
    • In the head, on paper, in a computer
  • All that matters is whether we generate the right behavior

speech

speech

writing

writing

add1

add2

write

read

19 of 62

What do we compute with?

20 of 62

Everything in this lecture is data

  • This is a good time to realize that everything you’ve seen so far is data
    • The pictures
    • The text
    • Even actions or functions like add
  • The last one is the really important one: functions are data
  • And programs are made up of functions, which means programs are data too!

21 of 62

Programmability

  • Computers are program interpreters
    • They read a stream of imperatives
    • And do what they say

  • This programmability allows a single device to perform many different tasks
    • Without it, you’d need separate machines for email and word processing
    • Computers wouldn’t be economically feasible

22 of 62

Who can program?

23 of 62

Course Overview

  1. Why should I take this course?
  2. What am I going to learn?
  3. How am I going to learn it?

24 of 62

COMP_SCI 111

Intro programming sequence

  • 111: basic concepts, functional, imperative, and object-oriented programming
  • 150: more on imperative programming & object-oriented programming in Python
  • 214: data structures and algorithms
  • 211: statically typed languages with manual memory management, explicit pointers in C and C++

By the end, you’ll know all the basics of CS as well as have experience with a number of different programming languages.

This course

  • No previous experience expected
  • Core concepts of computer science
  • Practice of Programming and debugging
  • Uses Racket’s Intermediate Student Languagea dialect of the Scheme programming language
    • Low barrier to entry
    • Level playing field
    • Formally more powerful than more conventional languages

25 of 62

Functional programming

  • For the first part of the class, we’ll focus on a style of programming called functional programming, that’s based on the functional model of computation
  • FP is a paradigm of programming in which you avoid imperatives
    • This mostly means programming without assignment statements
      • Can’t do the equivalent of a = a + 1
      • Or a.field = a.field + 1
      • That means you also can’t have for loops or while loops
    • For those of you without programming experience, you've got an advantage here!
  • Functional programming is good to start with because it rules out certain classes of bugs that learners find very difficult to fix

26 of 62

What if I’m interested in CS but I don’t want to major in it?

There are several other formal options for you to consider:

27 of 62

big course ideas

28 of 62

Computation is a tool

Computation is a medium of expression

Computation is language for biology

Computation is language for art

Computation is language for psychology

Computation is language for…

Computation is a playground

29 of 62

Major course themes

  • Programming as com/position
    • Both in the sense of placing elements together
    • And of writing and communication
  • Computer Science as a psychological discipline
    • Humans are the scarcest resource in software development
  • Computer Science as a social discipline
    • Large programs are beyond the capacity of individuals
  • Computer Science as an aesthetic discipline
    • Aesthetics has functional consequences

30 of 62

Aesthetic values in program design

  • Clarity
    • Systems should be easily understood by humans
  • Compositionality
    • Elements should combine cleanly and predictably
  • Generativity
    • A small set of basic elements should be able to create a large range of behaviors
  • Modularity
    • Interactions between elements should be limited, clear, and easily understood

31 of 62

Programming as com/position

  • Function composition
    • Linking outputs to inputs
  • Data composition
    • Primitives
    • Lists and records (tuples)
    • Inductive structures
  • Imperative composition
    • Sequencing changes in time
  • Composing code with data
    • Object-oriented programming
  • Interaction composition
    • Networks, events, and agents

32 of 62

33 of 62

34 of 62

35 of 62

36 of 62

37 of 62

38 of 62

39 of 62

40 of 62

https://youtu.be/BC7P89dw9HQ?si=x1I6PcHaAAuNhHQ9

41 of 62

Skill Building

  1. Composing new programs
  2. Decomposing/debugging existing programs
  3. Communicating about programs.

42 of 62

1. composing programs

43 of 62

44 of 62

45 of 62

2. decomposing / debugging programs

46 of 62

47 of 62

48 of 62

49 of 62

3. communicating about programs

50 of 62

51 of 62

administrative stuff

52 of 62

Class Rhythm

Partially flipped classroom

  • Mondays - Normal Lecture (nothing to prepare)
  • Wednesdays - Tutorial Days (watch a pre-recorded lecture BEFORE class; complete an assignment in class)
    • Recorded Lecture has a Short Multiple-Choice Component
  • Fridays - Practice+ (focused on reinforcing the stuff from earlier in the week).
    • In-Class Participation via a "Mini-Quiz"
  • There will be roughly one Exercise (HW) due each week.

Note, there are a few exceptions to this rhythm as noted on the Course Schedule on Canvas.

53 of 62

Tutorial Sessions

  • Purpose: practice writing and communicating about programs with your peers in a low-stakes environment.
  • Starting next Wednesday in-class
  • Small groups of up to 8 students with one instructor
  • No late Tutorials will be accepted.

54 of 62

Homework Exercises

  • Purpose: practice writing larger programs using the ideas we learn in class
  • Due each week generally on Fridays via Canvas
  • Must be completed on your own
  • These exercises will be graded via an autograder (computerized grading machine) as well as checked for plagiarism against other students’ (including from past quarters) solutions, online solutions, a large database of course content, and for markers of code generation.
  • You may submit the assignments up to 48 hours late subject to a late penalty.

55 of 62

Ethics Modules

  • Purpose: start to think about the context of computing in the real world.
  • Starting next Week
  • 3 Required Modules
    • Module 1 (asynchronous) on Social Media Networks (Week 2) - Required for everyone
    • You'll choose one topics module to attend an in-person discussion section (Week 3 to Week 9)
    • Module 9 (asynchronous) which is a reflection (Week 12) - Required for everyone

56 of 62

Mini-Quizzes

  • Purpose: a check of your participation in the course.
  • Two flavors - 1. Out-of-class; 2. In-Class
  • Out-of-class – Pre-recorded lectures will have multiple choice questions embedded into them (one MQ per lecture).
  • In-Class – We'll do "MQ Days" (announced 48 hours in advance) where we'll use PollEverywhere.

57 of 62

Quizzes

  • Purpose: These allow you to demonstrate your ability to read, evaluate, and fix already existing programs on your own.
  • These are in-class assessments designed to be completed in 50 minutes (if you have testing accommodations through ANU, please register for your accommodations and expect an email from me 1 week before each quiz).

  • Tentative dates are listed on the course schedule.

Quiz

Focus Topic

Q1

Fundamentals

Q2

Recursion

Q3

Imperatives

Q4

Summative

58 of 62

Academic Integrity

  • You are encouraged to ask one another questions about assignments, but you must do your own work.
  • Easy way to avoid: do not look at anyone's code other than mine or your own.
  • We will consider the following to be academic violations:
    • Turning in someone else’s file
    • Reading and reproducing someone else’s code for a problem
    • Cutting, pasting, transcribing, etc. someone else’s code, in whole or in part
    • Allowing anyone else to type or edit your code other than someone on the course staff
    • Giving your code to someone else or posting your code in any public location
    • Using any tools to generate code.
  • Everything you submit in this class is subject to an in-person audit by course staff.

59 of 62

Attendance

  • Attendance is not mandatory for lectures but will be incentivized (very high correlation between attendance and final grade in the course).
  • For In-class Mini-Quizzes (1st this Friday) and Tutorials (1st next Wednesday).
    • If you attend and put forth a good faith effort (as defined by the course staff), you will receive full credit.
    • If you choose not to attend and instead submit remotely, your work will be evaluated for both completeness and correctness.
  • Attendance is mandatory for your chosen Ethics Module.
  • All Quizzes are in-person and cannot be moved/rescheduled/made-up.

60 of 62

Other Class Resources

  • We’ll be following the slides and lecture notes, rather directly from a textbook
    • All our course resources will be posted on Canvas
  • We'll use edSTEM, an online Q&A platform that allows you to ask questions (either privately or publicly) and have it answered by someone in our learning community. Sign-up details are on Canvas under the Course Resources page.
  • There will be lots of Office Hours starting week 2
  • We'll also suggest readings in two freely available textbooks. If you want a complete supplementary textbook, checkout the syllabus for links to free versions of
    • Abelson and Sussman’s Structure and Interpretation of Computer Programs
    • Felleisen et al.’s How to Design Programs

61 of 62

Difficulty curve of the course

Writing

functions

Lists and

higher order functions

Recursive functions

Imperative programming

and object-oriented programming

62 of 62

For Friday…

  • Please read the Syllabus!
  • Peruse the course's Canvas page.
    • If you need help getting used to Canvas watch the Welcome to Canvas video
  • Sign-up for edSTEM (details on Canvas)
    • Watch the Welcome to edSTEM video to see how it works
  • Make sure to watch the pre-recorded lecture videos for Friday and complete Mini-Quiz 0
  • Take a look at Exercise 0 and see if you can get DrRacket installed

On Friday in class we'll…

  • Review the stuff on Mini-Quiz 0 (out-of-class)
  • Use PollEverywhere for Mini-Quiz 1 (in-class)
  • Complete most of Exercise 0
  • Talk about text-based programming