Compsci 201 Whats Computer Science Owen Astrachan olacs

  • Slides: 28
Download presentation
Compsci 201 What's Computer Science? Owen Astrachan ola@cs. duke. edu December 7, 2018 12/7/18

Compsci 201 What's Computer Science? Owen Astrachan ola@cs. duke. edu December 7, 2018 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 1

Z is for … • Zero • There are two bits in the universe,

Z is for … • Zero • There are two bits in the universe, or 10 • Zip • Magic number is 0 x 4 b 50, “PK” 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 2

Plan for the Day • What can we do with computers • So so

Plan for the Day • What can we do with computers • So so many things, power of scale • Data, computers, and storage: oh my! • What can't we do with computers? • Today or every day now and forever? • Chess and go: we'll never compete, but now? • Final Exam: details 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 3

What can computers do? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 4

What can computers do? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 4

What can computers do? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 5

What can computers do? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 5

What can computers do? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 6

What can computers do? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 6

What can you do? • Not everyone wants to be a software engineer •

What can you do? • Not everyone wants to be a software engineer • Diplomat, lawyer, physician, entrepreneur, • Musician, teacher, data scientist, … • Problems with programs, problems with people • UI, UX, PM, SWE, OMG • What you know and what you know how to do Compsci 201, Fall 2018, Last. Day- 12/7/18 Everything 7

Please write this program I guess I'm too dumb 12/7/18 Compsci 201, Fall 2018,

Please write this program I guess I'm too dumb 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 8

Some Better Scenarios I can't write this program but neither program because can all

Some Better Scenarios I can't write this program but neither program because can all these it’s provably famous people impossible 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 9

Solving Problems • Some problems cannot be solved at all • One program detects

Solving Problems • Some problems cannot be solved at all • One program detects all infinite loops • Some problems cannot be solved efficiently • Listing all N-bit sequences of 0's and 1's • Some problems have approximate solutions • Siri: not exact, but close or good enough 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 10

This I Believe • Efficient solutions? Some yes, some no, some … • We

This I Believe • Efficient solutions? Some yes, some no, some … • We don't know, but if we found one? • We'd solve many, many unknown ones • Clay Prize: does P == NP? • Efficient solutions versus guess and check • Theoretical aspects of computer science 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 11

What Ge Wants You to Hear • How many Natural numbers are there? 1,

What Ge Wants You to Hear • How many Natural numbers are there? 1, 2, 3, … • What about Integers, …, -2, -1, 0, 1, 2, … • Both infinity, but the same? • What about rational numbers? ½, ¾, and so on? • What about real numbers: sqrt(2), pi • There are degrees of infinity • More reals than the others which are the same • If you enjoy degrees … Compsci 201, Fallof 2018, infinity, Last. Day 12/7/18 12 Everything

Good and Bad Websites • How do we identify these? • Go to goodwebsites.

Good and Bad Websites • How do we identify these? • Go to goodwebsites. com • Go to badwebsites. com • Are both listed on goodwebsites. com? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 13

How much does that cost? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 14

How much does that cost? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 14

One step closer to … • Is goodwebsites. com listed on goodwebsites. com •

One step closer to … • Is goodwebsites. com listed on goodwebsites. com • Yes, it is, of course it is • What about sites_that_list_themselves. com • Is goodwebites. com listed on this site? • Is badwebsites. com listed on this site? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 15

Contradiction • What about this website? • sites_that_do_not_list_themselves. com • Aka std_not_lit. com •

Contradiction • What about this website? • sites_that_do_not_list_themselves. com • Aka std_not_lit. com • Does std_not_lit. com list itself? • If so, it doesn't • But, if it doesn't, it does • Oh no. We cannot have this website, no way. 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 16

Infinite Loop Testing • Can we write does. Halt as specified? Suppose so! •

Infinite Loop Testing • Can we write does. Halt as specified? Suppose so! • Reads a program and an input • Like the Java Compiler: reads a program public class Program. Utils /** * Returns true if progname halts on input, * otherwise returns false (infinite loop) */ public static boolean does. Halt(String progname, String input){ } } 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 17

Self-reference, … please, no • What about Confuse. java ? • Specifies program and

Self-reference, … please, no • What about Confuse. java ? • Specifies program and input, calls does. Halt public class Confuse { public static void main(String[] args){ String prog = "Confuse. java"; if (Program. Utils. does. Halt(prog, prog)) { while (true) { // do nothing forever } } 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 18

Two alternatives, none work • What if does. Halt returns true? Meaning stops! •

Two alternatives, none work • What if does. Halt returns true? Meaning stops! • If Confuse/confuse stops, then infinite loop, oh no! • What if does. Halt returns false? • What happens main? ends. But … publicin class Confuse. Program { public static void main(String[] args){ String prog = "Confuse. java"; if (Program. Utils. does. Halt(prog, prog)) { while (true) { // do nothing forever } } 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 19

This was (or is) earth-shattering • Alan Turing first showed this for programs: 1936

This was (or is) earth-shattering • Alan Turing first showed this for programs: 1936 • Had to formally specify what a program was • Also demonstrated by Alonzo Church, ola's academic great grandfather • Cantor showed Real Numbers > Rationals • So-called diagonalization, 1891 • Ridiculed by establishment 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 20

WOTO http: //bit. ly/201 fall 18 -dec 7 -1 12/7/18 Compsci 201, Fall 2018,

WOTO http: //bit. ly/201 fall 18 -dec 7 -1 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 21

Final Exam • Exam is Monday, Dec 17, 2: 00 pm – 5: 00

Final Exam • Exam is Monday, Dec 17, 2: 00 pm – 5: 00 pm • Accommodations: you know where/when • Optional all questions answered sessions • Possible, if so? Sunday 5: 30 -6: 30 B 101/LSRC • We won't know until Tue/Wed 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 22

Final Exam Details • Multiple Choice is 40 -50% of total points • Written

Final Exam Details • Multiple Choice is 40 -50% of total points • Written answers are 50 -60% of total points • Bring 6 pages of notes as with previous exams • Name on all pages, leave as you turn in exam • You have three hours, we expect you to take two • Many of you will be here until the end! Compsci 201, Fall 2018, Last. Day 12/7/18 23 Everything

WOTO Hash. Set<String> hs and Tree. Set<String> ts each contain the same N strings.

WOTO Hash. Set<String> hs and Tree. Set<String> ts each contain the same N strings. Which of the following best characterizes the runtimes of printing all N values from each set in alphabetical order? A. B. C. D. For ts this is O(N) for hs this is O(N) For ts this is O(N) for hs this is O(N log N) For ts this is O(N log N) for hs this is O(N Compsci 201, Fall 2018, Last. Day 12/7/18 log N) Everything 24

Major, Minor or … IDM! Comp. Sci 201 Comp. Sci 260 Comp. Sci 216

Major, Minor or … IDM! Comp. Sci 201 Comp. Sci 260 Comp. Sci 216 Comp Genomics Everything Data Comp. Sci 316 Comp. Sci 270 AI Database Comp. Sci 230 Discrete Math Comp. Sci 330 Algorithms Comp. Sci 250 Comp. Sci 371 Comp. Org. Comp. Sci 310 Mach. Learning Comp. Sci 308 Op. Systems Comp. Sci 307 Software Design Comp. Sci 342 IP 2 Comp. Sci 408 Apps 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 25

Incentives • • On the first day you earned … By reaching 75% threshold

Incentives • • On the first day you earned … By reaching 75% threshold for discussion … By reaching 75% of Duke. Hub evals … By reaching 80% of Duke. Hub evals … • But, if you haven't completed Assignment Quiz? • If you haven't completed Huffman Coding? 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 26

Create • Make sure video is accessible/viewable • Can be private, must be viewable

Create • Make sure video is accessible/viewable • Can be private, must be viewable with link • Ask someone else to try to view • Will poll class next week with submissions • Favorites can earn extra points • Maybe be we can try … 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 27

OLA BIG-O-L-A OLA 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 28

OLA BIG-O-L-A OLA 12/7/18 Compsci 201, Fall 2018, Last. Day. Everything 28