Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Introduction & Motivation Steve Wolfman, based on notes by Patrice Belleville and others.

Slides:



Advertisements
Similar presentations
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 Propositional Logic: A First Model of Computation Steve Wolfman, based on notes by Patrice.
Advertisements

Snick  snack 1 CPSC 121: Models of Computation 2011 Winter Term 1 Number Representation Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Proof Techniques (Part A) Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 Introduction to Induction Steve Wolfman 1.
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 Introduction & Motivation Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 Introduction to Induction Steve Wolfman 1.
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 DFAs in Depth Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack CPSC 121: Models of Computation 2009 Winter Term 1 Propositional Logic: Conditionals and Logical Equivalence Steve Wolfman, based on notes.
Snick  snack A Working Computer Slides based on work by Bob Woodham and others.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Propositional Logic: A First Model of Computation Steve Wolfman, based on notes by Patrice.
Snick  snack 1 CPSC 121: Models of Computation 2009 Winter Term 1 Number Representation Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Propositional Logic: Conditionals and Logical Equivalence Steve Wolfman, based on notes.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Propositional Logic, Continued Steve Wolfman, based on notes by Patrice Belleville and.
Snick  snack A Working Computer Slides based on work by Bob Woodham and others.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
Algorithms and Problem Solving. Learn about problem solving skills Explore the algorithmic approach for problem solving Learn about algorithm development.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Functions Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Rewriting Predicate Logic Statements Steve Wolfman, based on notes by Patrice Belleville.
Snick  snack CPSC 121: Models of Computation 2010/11 Winter Term 2 Propositional Logic: A First Model of Computation Steve Wolfman, based on notes by.
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 DFAs in Depth Benjamin Israel Notes heavily borrowed from Steve Wolfman’s,
Snick  snack CPSC 121: Models of Computation 2010 Winter Term 2 DFAs in Depth Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack A Working Computer Slides based on work by Bob Woodham and others.
Snick  snack CPSC 121: Models of Computation 2010/11 Winter Term 2 Propositional Logic, Continued Steve Wolfman, based on notes by Patrice Belleville.
Welcome to CSCA67 Discrete Mathematics for Computer Scientists
Snick  snack CPSC 121: Models of Computation 2010/11 Winter Term 2 Introduction & Motivation Steve Wolfman, based on notes by Patrice Belleville and others.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Proof (First Visit) Steve Wolfman, based on notes by Patrice Belleville, Meghan Allen.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Propositional Logic: A First Model of Computation Steve Wolfman, based on notes by Patrice.
analysis, plug ‘n’ chug, & induction
Intro to CIT 594
Intro to Discrete Structures
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
CS 103 Discrete Structures Lecture 01 Introduction to the Course
CPSC 321 Introduction to Logic Circuit Design Mihaela Ulieru (‘Dr. M’)
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Building & Designing Sequential Circuits Steve Wolfman, based on notes by Patrice Belleville.
Course Guide CS 285 Discrete Mathematics Dr. Eng. Manal Farrag Prince Sultan University, College for Women
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
CSCI 51 Introduction to Computer Science Dr. Joshua Stough January 20, 2009.
CS100J Spring 2006 CS100J: 11 weeks of programming using Java and 2 weeks using Matlab. David Gries is teaching CS100J. Graeme Bailey is teaching a special.
CS 140 Computer Programming (I) Second semester (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.
CPSC 121: Models of Computation Unit 2 Conditionals and Logical Equivalences Unit 2 - Conditionals 1 Based on slides by Patrice Belleville and Steve Wolfman.
1 CPRE210: Introduction to Digital Design Instructor –Arun K. Somani –Tel: – –Office Hours: MWF 10:00-11:00 Teaching Assistant.
Snick  snack CPSC 121: Models of Computation 2013W2 Propositional Logic: A First Model of Computation Steve Wolfman, based on notes by Patrice Belleville.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
CPSC 121: Models of Computation Unit 0 Introduction George Tsiknis Based on slides by Patrice Belleville and Steve Wolfman.
Snick  snack CPSC 121: Models of Computation 2012 Summer Term 2 Introduction & Motivation Steve Wolfman, based on notes by Patrice Belleville and others.
1 CS1100 Fall Instructor: David Gries CS100M: Matlab No prior programming experience One semester of calculus Math & engineering type problems CS100J:
Snick  snack 1 CPSC 121: Models of Computation 2013W2 Number Representation Steve Wolfman, based on notes by Patrice Belleville and others This work is.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
1/32 This Lecture Substitution model An example using the substitution model Designing recursive procedures Designing iterative procedures Proving that.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Introduction & Motivation Steve Wolfman, based on notes by Patrice Belleville and others.
1.  This course covers the mathematical foundations of computer science and engineering. It provides an introduction to elementary concepts in mathematics.
Snick  snack 1 CPSC 121: Models of Computation 2008/9 Winter Term 2 Number Representation Steve Wolfman, based on notes by Patrice Belleville and others.
CPSC 121: Models of Computation REVIEW. Course Learning Outcomes You should be able to: – model important problems so that they are easier to discuss,
CPSC 121: Models of Computation 2008/9 Winter Term 2
MS. NANCY HARRIS LECTURER, DEPARTMENT OF COMPUTER SCIENCE CS 149 – Programming Fundamentals (Accelerated)
CSC207 Fall 2016.
INTRODUCTION TO PROBLEM SOLVING
Module 2: Conditionals and Logical Equivalences
CPSC 121: Models of Computation 2008/9 Winter Term 2
CPSC 121: Models of Computation
Foundations of Computer Science
CPSC 121: Models of Computation 2013 Winter Term 2
CPSC 121: Models of Computation 2016 Winter Term 2
CPSC 121: Models of Computation
Basic Concepts of Algorithm
CPSC 121: Models of Computation 2008/9 Winter Term 2
CPSC 121: Models of Computation
Presentation transcript:

snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Introduction & Motivation Steve Wolfman, based on notes by Patrice Belleville and others 1

Learning Goals: In-Class By the end of the unit, you should be able to: –Give an example of how we can apply formal reasoning and computers to a simple, real- world task. –Give an example of how a computational solution to a simple task might go wrong. –Describe the two “big stories” of CS121: reasoning about computation and building computers. 2

Outline Introductions Introductions Exercise The CS121 Story Course Administration Next Lecture Notes 3

Introductions Steven Wolfman ICICS 239; office hours listed on the website I also have an open door policy: If my door is open, come in and talk! Also, I will usually be available after class. And, you can make appointments with me. Additionally, you can use TA office hours. 4

Outline Introductions Introductions Exercise The CS121 Story Course Administration Next Lecture Notes 5

More Introductions Introduce yourselves… how? 6

Introduce Yourselves in Groups of 4-ish FIND ~3 people around you, preferably people you’ve never met. Form a group. Have everyone in the group introduce themselves to everyone else in the group. (Count the number of intros this takes.) Tell everyone why you’re here, your favorite career that you’ll never have, and one unusual thing about you. 7

Problem: How Many Introductions? Problem: How many introductions does it take for everyone in a group to meet everyone else in a group? 8

Concept Q: Intros for 4 How many introductions does a group of 4 people take? a.3 b.4 c.6 d.12 e.None of these 9

Problem: How Many Introductions? Problem: How many introductions does it take for everyone in a group to meet everyone else in a group? To solve this problem, we need to model it more formally. 10

How Many Introductions? Model: One “introduction” is one person introducing themselves to another person. (Two people need two introductions to introduce themselves to each other.) A group has “introduced themselves” when every group member has introduced themselves to every other member. (No self-introductions!) Hi, I’m Grace H. Hi Grace, I’m Alan T. Intro #1 Intro #2 11

How Many Introductions? Problem: How many introductions does it take for a group of n people to introduce themselves? 12

How Many Introductions? For 2 people? For 3 people? For 4 people? For 5 people? … For n people? 13

How Many Introductions? For 100 people? For people? For people? 14

Program for Introductions int introductions(int n) { return n * (n - 1); } (define (introductions n) (* n (- n 1))) Do you believe it? 15 (in Java) (in Scheme/Racket)

Program for Introductions: Testing Java version with 100: 9900 Do you believe it? 16

Program for Introductions: Testing Java version with 100: 9900 Java version with : Do you believe it? 17

Program for Introductions: Testing Java version with 100: 9900 Java version with : Java version with : Um.. Do you believe it? Does this fit with your “model” of computation? 18

Program for Introductions: Testing Racket version with 100: 9900 Racket version with : Racket version with : Do you believe it? Will Racket always get the right answer? 19

Outline Introductions Introductions Exercise The CS121 Story Course Administration Next Lecture Notes 20

Questions that CPSC121 Answers How can we prove that our formula for the number of introductions is correct? (induction) What went wrong in our Java implementation? (number representation) How do we model and reason about computational systems at various levels of abstraction? (propositional and predicate logic, proof, sets, functions, DFAs, relations,...) 21

CPSC 121: The Big Stories Theory How do we model computational systems (programs/computers) in order to design and analyze them? Grand goal: Reason about what is and isn’t possible to compute. Hardware How do we build devices that can compute out of real materials (“sand and rocks and water”)? Grand goal: break down a full computer into simple “gates”. Bonus end goal: Develop tools to communicate computational ideas clearly and precisely. 22

Our Working Computer 23 The whole thing (mostly wires connecting boxes).

Our Working Computer (zoomed in on one “box”) 24 Just the “ALU” (arithmetic and logic unit). You’ll see a pared-down version in lab in a couple of weeks.

CPSC 121: The (By?)Products Theory Products: Propositional logic Predicate logic Sets and functions Proof techniques (especially induction!) Finite Automata/Regular Expressions Universal machines Uncomputability Hardware Products: Gates Combinational circuits Binary data representations Sequential circuits A full computer 25

What is CPSC 121 Good For? With CPSC121’s help, you will be able to: model important problems so that they are easier to discuss, reason about, solve, and test. learn new modeling formalisms more easily. communicate clearly and unambiguously with other CS experts on complex topics. characterize algorithms (CS problem solutions), such as proving their correctness or efficacy. critically read proofs: justifying why each step is correct and judging what the proof means. 26

Outline Introductions Introductions Exercise The CS121 Story Course Administration Next Lecture Notes 27

Course Administration Explore the CPSC 121 website: You are required to be familiar with the course website. Ignorance of information on the website may harm you. 28

Additional Administrative Notes The first quiz is “any marks gives full marks”. So, if you get more than 0%, we’ll count it as 100%. Labs, tutorials, and TA office hours in the Learning Centre all start NEXT week. (My office hours start this week!) 29

Outline Introductions Introductions Exercise The CS121 Story Course Administration Next Lecture Notes 30

Learning Goals: In-Class By the end of the unit, you should be able to: –Give an example of how we can apply formal reasoning and computers to a simple, real- world task. –Give an example of how a computational solution to a simple task might go wrong. –Describe the two “big stories” of CS121: reasoning about computation and building computers. 31

Next Lecture Learning Goals: Pre-Class By the start of class, you should be able to: –Translate back and forth between simple natural language statements and propositional logic. –Evaluate the truth of propositional logic statements using truth tables. –Translate back and forth between propositional logic statements and circuits that assess the truth of those statements. 32

Next Lecture Prerequisites Read Sections 1.1 and 1.4/2.1 and 2.4 You should have completed the open-book, untimed quiz on Vista that’s due by 9PM the day before class. (You are responsible for ensuring that you have submitted the quiz by 9PM!) 33 Readings: 3 rd ed in black/4 th ed in red

snick  snack Some Things to Try... (on your own if you have time, not required) 34

What Works is NOT Always Obvious Let’s try out what we’ll call the “Radix” Algorithm. General form: 1.Put all items together in a list in order 2.Make an empty list for each possible value of each “digit” in the items (or letter in a word, etc.). 3.For each digit of the items in the main list, starting with the rightmost digit: a)For each item in the main list, in order: Put it at the back of the list indicated by the current digit in that item b)For each digit list, in order: Put the list at the back of the main list. What does this do? How does it work? 35

What Doesn’t Work is Not Always Obvious (1 of 2) Class Main { public static void main(String[] args) { // Let's add up 4 quarters. System.out.println("4 quarters gives us:"); System.out.println( ); // Let's do something a hundred times. int i = 100; do { // Make i one smaller. i--; } while (i > 0); System.out.println("Done!"); System.out.println("i ended up with the value: " + i); System.out.println("It went down by: " + (100 - i)); } 36

What Doesn’t Work is Not Always Obvious (2 of 2) Class Main { public static void main(String[] args) { // Let's add up 10 dimes. System.out.println("10 dimes gives us:"); System.out.println( ); // Let's try do something a hundred times.. // but accidentally go forever int i = 100; do { // Make i one LARGER. Oops! i++; } while (i > 0); System.out.println("Done!"); System.out.println("i ended up with the value: " + i); System.out.println("It went down by: " + (100 - i)); } 37

Even Bigger Story: “Clear Thought” Computer Science is the science of “clear thought”, but not like philosophy (or religion, or poetry, or...). CS is the science of thoughts so clear in their expression and intent that we can realize them: execute them or test their truth in the world. CPSC121 provides and applies the fundamentals you need to model the world with “clear thought”. 38