Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 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

Lecture 1: Overview CMSC 201 Computer Science 1 (Prof. Chang version)
Snick  snack 1 CPSC 121: Models of Computation 2011 Winter Term 1 Number Representation Steve Wolfman, based on notes by Patrice Belleville and others.
What’s wrong with this proof? If you figure it out, don’t call it out loud – let others ponder it as well. 1. Let a and b be non-zero such thata = b 2.
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 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.
1-1 CMPT 225 Data Structures and Programming Instructor: Aaron Hunter Section: E300 Campus: Harbour Centre Semester: Spring 2007.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Propositional Logic: Conditionals and Logical Equivalence Steve Wolfman, based on notes.
1 CENG 707 Data Structures and Algorithms Nihan Kesim Çiçekli Department of Computer Engineering Middle East Technical University Fall 2010.
Intro to CIT 594
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Revisiting Induction Steve Wolfman, based on work by Patrice Belleville and others 1.
Snick  snack CPSC 121: Models of Computation 2011 Winter Term 1 Introduction & Motivation Steve Wolfman, based on notes by Patrice Belleville and others.
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 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 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
University of British Columbia CPSC 111, Intro to Computation Jan-Apr 2006 Tamara Munzner Conditionals II Lecture 11, Thu Feb
Snick  snack CPSC 121: Models of Computation 2010/11 Winter Term 2 Introduction & Motivation Steve Wolfman, based on notes by Patrice Belleville and others.
EnPh 131 Lec B04 Introduction Course syllabus Course components ….
University of British Columbia CPSC 111, Intro to Computation 2009W2: Jan-Apr 2010 Tamara Munzner 1 Yet More Array Practice Lecture 24, Mon Mar
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.
If statements Chapter 3. Selection Want to be able to do a statement sometimes, but not others if it is raining, wear a raincoat. Start first with how.
analysis, plug ‘n’ chug, & induction
Writing algorithms using the while-statement. Previously discussed Syntax of while-statement:
Intro to CIT 594
CS211: Course Overview George Mason University. Today’s topics Go over the syllabus Go over resources – Marmoset – Piazza – Textbook Highlight important.
Computer Network Fundamentals CNT4007C
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
EECE 310 Software Engineering Lecture 0: Course Orientation.
Invitation to Computer Science, Java Version, Second Edition.
Snick  snack CPSC 121: Models of Computation 2008/9 Winter Term 2 Describing the World with Predicate Logic Steve Wolfman, based on notes by Patrice Belleville.
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.
CS 140 Computer Programming (I) Second semester (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.
Welcome to CMPSC 360!. Today Introductions Student Information Sheets, Autobiography What is Discrete Math? Syllabus Highlights
Snick  snack CPSC 121: Models of Computation 2013W2 Propositional Logic: A First Model of Computation Steve Wolfman, based on notes by Patrice Belleville.
CPSC 121: Models of Computation Unit 0 Introduction George Tsiknis Based on slides by Patrice Belleville and Steve Wolfman.
Dynamic Programming. Algorithm Design Techniques We will cover in this class: ◦ Greedy Algorithms ◦ Divide and Conquer Algorithms ◦ Dynamic Programming.
Welcome to CIS 2168 ! Data Structures and Algorithms
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:
CIS 068 Welcome to CIS 068 ! Software Design & Data Structures In JAVA Instructor: Rolf Lakaemper.
Data Structures and Algorithms in Java AlaaEddin 2012.
Computer Networks CNT5106C
Lecture 1 Introductions, Overviews, Operating Systems.
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)
INTRODUCTION TO PROBLEM SOLVING
CPSC 121: Models of Computation 2008/9 Winter Term 2
CPSC 121: Models of Computation
Computer Programming 1 introduction to JAVA Lecture 1 Instructor: Ruba A. Salamah Islamic University of Gaza.
CPSC 121: Models of Computation 2013 Winter Term 2
CPSC 121: Models of Computation 2016 Winter Term 2
CPSC 121: Models of Computation
CPSC 121: Models of Computation 2008/9 Winter Term 2
CPSC 121: Models of Computation
Presentation transcript:

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

Introductions Steven Wolfman (call me Steve!) ICICS 239; office hours (tentatively): Mon-Wed 11:30-12:30, Thu 2-4 but I 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.

More Introductions Introduce yourselves… how?

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.

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

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

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.

How Many Introductions? Model: One “introduction” is one person introducing themselves to another person. (So, two people need two introductions to introduce themselves to each other.) A group has “introduced themselves” when every member of the group has introduced themselves to every other member of the group. (No self-introductions needed.)

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

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

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

Program for Introductions introductions n = n * (n - 1) (In a programming language called Haskell.) int introductions(int n) { return n * (n - 1); } (In the Java programming language.) Do you believe it?

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

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

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

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

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 computational systems at various levels (from hardware to abstract intent) in ways that facilitate “clear thought”? (propositional and predicate logic, proof, sets, functions, DFAs, relations,...)

“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”.

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.

CPSC 121: Analysis & Proof CPSC 121: Representation, Hardware, & Computation CPSC 121: Analysis & Proof CPSC 121: Representation, Hardware, & Computation CPSC 211: Software Design CPSC 211: Data Structures CPSC 211: Software Design CPSC 211: Data Structures Where Does CPSC 121 Sit? CPSC 111: Programming Caveat #1: It couldn’t possibly be because we teach 121 that its box is biggest. Caveat #2: There’s a LOT more to learn on both sides after 121.

What “Models of Computation” Will We Work With? Propositional logic, as model for the combinational circuitry at the heart of computers Predicate logic (and later enhanced by sets, functions, and relations), as modeling language for computational problems Deterministic Finite Automata and regular expressions as applications of all previous concepts and a crude but (in a sense) complete model of computation as a whole Circuit diagrams using both combinational and sequential circuits to model the operation of a complete computer

Course Administration Explore the CPSC 121 website:

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.

Next Lecture Prerequisites Read Sections 1.1 and 1.4 Solve problems like Exercise Set 1.1, #1-18 and Exercise Set 1.4, #1-17. You should have completed the open-book, untimed* quiz on WebCT that’s due by 9PM the day before class. * For logistical reasons, we set a 2 hour time limit, but you may submit as often as you like. Let us know if we need to make the limit longer.

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%. We may have to move the time of the midterm exam, since it conflicts with CPSC 211. Labs, tutorials, and the Demco Learning Centre all start NEXT week (Jan 12). TA assignments will be posted by end of day Tuesday (but may change through ~week 2). Can I skip the last half hour of today’s office hours (to take care of Naomi)?

snick  snack Some Things to Try... (on your own or if we have time)

What Works is NOT Always Obvious Let’s sort cards with the Quicksort “Algorithm” : 1.If there are no cards in a deck, it’s sorted. 2.Otherwise, pick a card at random. a.Divide the other cards into a deck of cards less than or equal to that card and a deck of cards greater than it. b.Give the “less” deck to a helper and have them Quicksort it. c.Give the “greater” deck to a helper and have them Quicksort it. d.Put the Quicksorted “less” deck on top of the picked card on top of the Quicksorted “greater” deck. How can that work? It relies on itself to get its work done! TRY it with a deck of cards. To compare cards, first: A < 2–10 < J < Q < K If they’re equal so far: Clubs < Diamonds < Hearts < Spades

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)); } Predict and then TRY: What does this print? (If you’re just taking 111, give it a week and then try.)

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)); } Predict and then TRY: What does this print?