7b876bd973ff4a1b987b00ec824d20f2.ppt

- Количество слайдов: 50

CMSC 100 Course Overview Professor Marie des. Jardins Thursday, August 30, 2012 CMSC 100 -- Overview 1 Thurs 8/30/12

2 CMSC 100 -- Overview wordle. net Thurs 8/30/12

Overview n Who am I? n What is Computer Science? n Course n First 3 Logistics Assignments n UPC/QR CMSC 100 -- Overview Code Example Thurs 8/30/12

Who am I? CMSC 100 -- Overview 4 Thurs 8/30/12

About the Instructor n n A. B. Engineering, Harvard 1985 n Ph. D. Computer Science, Berkeley 1992 n Research Scientist, SRI, 1991 -2001 n Professor at UMBC 2001 -now n Tenured in 2007; promoted to Professor in 2011 n 5 Prof. Marie des. Jardins Married since 1985, two daughters (ages 16 (junior in high school) and 18 (sophomore in college)) n Like to read, do crossword puzzles, sing, play the piano, cook, ski, travel, eat great food Class Intro 1/30/11

My Research n Artificial intelligence n How to get computers to behave in ways that we would consider to be “intelligent” n Machine learning: Making computers adaptable and able to improve their performance over time n Planning: Enabling computers to make decisions and solve problems n Multi-agent systems: Getting computers to interact effectively with each other and with humans 6 Class Intro 1/30/11

Research Projects n n Modeling trust in dynamic real-world environments like supply chain management n Analyzing planning problems to construct libraries of contingency plans for rapid replanning n Preference learning to discover users’ preferences in online rating systems and other applications n 7 Integrating low-level learning and planning to enable “skill bootstrapping” (the ability to layer successively more complex skills on top of each other to solve hard problems) Learning from sparse data, and understanding uncertainty in learned models Class Intro 1/30/11

What is Computer Science? CMSC 100 -- Overview 8 Thurs 8/30/12

The Computer Revolution n How fast did this happen? n [ http: //www. blinkenlights. com/pc. shtml ] 1950: “Simon” (plans published in Radio Electronics) 1973: HP 65 (programmable calculator) 1975: Altair 8800 (first widely used programmable computer kit) 1977: Apple II (a huge breakthrough, the first mass-produced, inexpensive personal computer) 1981: IBM 5150 PC (now we’re really taking off) n 1984: Apple Macintosh 128 K (my first computer!!) n 2008: Mac. Book Air (my newest computer!) n n n 9 CMSC 100 -- Overview Thurs 8/30/12

Moore’s Law n Computer memory (and processing speed, resolution, and just about everything else) increases exponentially n 10 (roughly: doubles every 18 -24 months) Source: wikipedia CMSC 100 -- Overview Thurs 8/30/12

Measuring Memory n One 0/1 (“no/yes”) “bit” is the basic unit of memory n n n n How many different patterns can you represent with one bit of storage? n n 11 * Eight (23) bits = one byte 1, 024 (210) bytes = one kilobyte (1 K)* 1, 024 K (220 bytes) = one megabyte (1 M) 1, 024 K (230 bytes) = one gigabyte (1 G) 1, 024 (240 bytes) = one terabyte (1 T) 1, 024 (250 bytes) = one petabyte (1 P). . . 280 bytes = one yottabyte (1 Y? ) Two! (It’s either 0 or 1; that’s it, no in between) How many different patterns can you represent with one byte of storage? Note that external storage is usually measured in decimal rather than binary (1000 bytes = 1 K, and so on) CMSC 100 -- Overview Thurs 8/30/12

What Was It Like Then? n n 12 The PDP-11/70 s I used in college had 64 K of RAM, with hard disks that held less than 1 M of external storage . . . and we had to walk five miles, uphill, in the snow, every day! And we had to live in a cardboard box in the middle of the road! CMSC 100 -- Overview Thurs 8/30/12

What Is It Like Now? n n The cheapest Dell Inspiron laptop ($399. 99) has 4 G of RAM and a 50 G hard drive. . [twice as much as the capacities I mentioned when I last taught this course, just three years ago. . . ] n . . . a factor of 1018 more RAM and 1013 more disk space n 13 The PDP-11/70 s we used in college had 64 K of RAM, with hard disks that held less than 1 M of memory . . . and your i. Pod nano has 8 G (or 16 G!) of blindingly fast storage n . . . so don’t come whining to me about how slow your computer is! CMSC 100 -- Overview Thurs 8/30/12

It’s Not Just Speed, It’s Quantity n So just how big a revolution are we talking about? n How many computers do you think were in the room when I took my first programming class? n n Answer: ZERO. How many computers are in this room? 14 CMSC 100 -- Overview Thurs 8/30/12

Grand Challenges for CS Information Search Information Integration Autonomous Vehicles Human-Level Intelligence Smart Matter 15 http: //www. cs. cmu. edu/~claytronics/software/ CMSC 100 -- Overview thebrain. mcgill. ca Thurs 8/30/12

How Does a Computer Work? “The work performed by the computer is specified by a program, which is written in a programming language. This language is converted to sequences of machine-language instructions by interpreters or compilers, via a predefined set of subroutines called the operating system. The instructions, which are stored in the memory of the computer, define the operations to be performed on data, which are also stored in the computer's memory. A finite-state machine fetches and executes these instructions. The instructions as well as the data are represented by patterns of bits. Both the finite-state machine and the memory are built of storage registers and Boolean logic blocks, and the latter are based on simple logical functions, such as And, Or, and Invert. These logical functions are implemented by switches, which are set up either in series or in parallel, and these switches control a physical substance, such as water or electricity, which is used to send one of two possible signals from one switch to another: 1 or 0. This is the hierarchy of abstraction that makes computers work. ” 16 W. Daniel Hillis, The Pattern on the Stone -CMSC 100 -- Overview Thurs 8/30/12

How Does a Computer Work? “The work performed by the computer is specified by a program, which is written in a programming language. This language is converted to sequences of machine-language instructions by interpreters or compilers, via a predefined set of subroutines called the operating system. The instructions, which are stored in the memory of the computer, define the operations to be performed on data, which are also stored in the computer's memory. A finite-state machine fetches and executes these instructions. The instructions as well as the data are represented by patterns of bits. Both the finite-state machine and the memory are built of storage registers and Boolean logic blocks, and the latter are based on simple logical functions, such as And, Or, and Invert. These logical functions are implemented by switches, which are set up either in series or in parallel, and these switches control a physical substance, such as water or electricity, which is used to send one of two possible signals from one switch to another: 1 or 0. This is the hierarchy of abstraction that makes computers work. ” -- W. Daniel Hillis, The Pattern on the Stone 17 CMSC 100 -- Overview Thurs 8/30/12

Abstraction: The Key Idea! n Computers are very complex n Most interesting programs are very complex n What makes it possible to design and maintain these complex systems? ? n Which just means: n n Once we’ve solved a “low-level detail, ” we can treat that solution as a “black box” with known inputs and outputs, and not worry about how it works. The way we get there is called problem reduction (or decomposition or divide-and-conquer) 18 CMSC 100 -- Overview Thurs 8/30/12

Course Overview and Policies CMSC 100 -- Overview 19 Thurs 8/30/12

What This Class is About n How computers are built, programmed, and used to solve problems n n Systems: Operating systems and networks n Software: Basic programming/algorithms, databases n Theory: Algorithms, computation, complexity n Applications: AI, graphics, … n n Hardware: Digital logic and system architecture Social issues: Ethics, privacy, environmental impact Other skills emphasized: n n 20 Effective writing and presentation skills Basic programming (in Scratch) n Foundational mathematics for computer science CMSC 100 -- Overview Thurs 8/30/12

What this class is NOT about n How to install Windows or Linux n How to use Excel and Power. Point n What kind of computer you should buy n Advanced programming techniques 21 CMSC 100 -- Overview Thurs 8/30/12

Course Logistics n n Instructor: Prof. Marie des. Jardins, [email protected] umbc. edu http: //www. csee. umbc. edu/~mariedj/ Office hours: Tues 2: 30 -3: 30, Wed 2: 00 -3: 00, ITE 337 TAs (ITE 349): n n n 22 Clay Alberty, clay [email protected] edu Office hours: Mon 2: 30 -4: 30 pm Kellie La. Flamme, kl [email protected] edu, Office hours: Tues/Thurs 11: 30 -12: 30 pm Stephanie Schneider, sschneider [email protected] com Office hours: Wed 4 -5 pm Course website/syllabus: http: //www. csee. umbc. edu/courses/undergraduate/100/Fall 12/ Schedule: http: //www. csee. umbc. edu/courses/undergraduate/100/Fall 12/schedu le. html CMSC 100 -- Overview Thurs 8/30/12

Textbook n Schneider and Gersting, Invitation to Computer Science, 6/e n n I’ve requested a reserve copy to be placed on reserve at the library n You can buy it on Amazon for $84. 44 (less than the bookstore is charging. . . ) n You can buy the ebook for $76. 49 at the Cengage website n 23 About half of the reading in the book will be assigned, as will many chapter exercises Buy an earlier edition at your own risk! It’s your responsibility to have access to the 6 th edition content and exercises n CMSC 100 -- Overview Does anybody already have the 5 th edition? Thurs 8/30/12

My Expectations n Students will… n Attend class regularly n Be prompt, and not engage in distracting or disruptive behaviors n NO LAPTOPS OR CELLPHONES (INCLUDING TEXTING) DURING CLASS n (yeah, I know it seems weird in a CS class…) n Know what work is due, and turn in assignments promptly n Follow the course’s academic honesty policy n Be engaged in the learning process, respectful of the course staff, and supportive of your fellow students n Express concerns and ask questions n Understand that the course staff has other obligations outside of this class 24 CMSC 100 -- Overview Thurs 8/30/12

Your Expectations n The instructor will… n Tell students what is expected in terms of coursework and behavior n Be fair in giving assignments, grading assignments, and returning coursework in a timely fashion n Let students know how they are doing in the class n Answer questions and concerns promptly n Be open to feedback and suggestions n Be respectful of students n Try to make the course useful, interesting, and enjoyable n Understand that students have other obligations outside of this class 25 CMSC 100 -- Overview Thurs 8/30/12

Academic Honesty Policy n See handout… 26 CMSC 100 -- Overview Thurs 8/30/12

Course Communications n Email n n n Office hours n n n Instructor postings and polls Discussion board Blackboard n 27 One point of EXTRA CREDIT if you come to my office hours (or stop by any time my door is open) in the next two weeks (i. e. , by Thursday 9/13) to introduce yourself and chat for a few minutes! Piazza n n Requests for extensions, questions about course policies Dr. d. J Grading inquiries, requests for help with assignments TA n Still having trouble? Talk to Dr. d. J Some assignment submissions CMSC 100 -- Overview Thurs 8/30/12

Homework Expectations n Homework expectations: n In general, there will be an assignment (a homework or programming assignment, or a research paper deliverable) due each Tuesday n The primary purpose of the homework assignments is to keep you on track with the reading, and to provide me with feedback about problem areas, well in advance of the midterm and final exams. (The exams will be very similar to the homework assignments and will also have some simple programming questions. ) n Please plan your time (to do the reading and complete the assignments) accordingly! n All assignments are to be submitted in class (i. e. , as hardcopy!) unless otherwise specified (and must be legible and stapled!) n Late policy (see course syllabus) 28 CMSC 100 -- Overview Thurs 8/30/12

First Assignments n IMPORTANT: You need to have access to your own computer in order to do the work in this class. Please see Dr. des. Jardins immediately about access to lab machines if you do not have your own computer. n Academic Honesty Policy and Survey: Due Tuesday 9/4 n HW 1: Due Tuesday 9/11 n PA 0: Due Thursday 9/13 29 CMSC 100 -- Overview Thurs 8/30/12

Example: UPC Codes (ok, so that’s kinda like saying “ATM machines. . . ”) CMSC 100 -- Overview 30 Thurs 8/30/12

Universal Product Codes Slides for the UPC example courtesy of Prof. Michael Littman (Brown University) n First scanned product: Wrigley’s gum (1974) n Method of identifying products at point of sale by 11 -digit numbers n Method of encoding digit sequences so they can be read quickly and easily by a machine 31 CMSC 100 -- Overview Thurs 8/30/12

Reduction Idea Each level uses an encoding to translate to the next level (i. e. , the next higher abstraction) n • Patterns of ink. • Sequence of 95 zeros and ones (“bits”). • Sequence of 12 digits. • Sequence of 11 digits. • Name/type/manufacturer of product. 32 CMSC 100 -- Overview Thurs 8/30/12

Product Name Ponds Dry Skin Cream n • 3. 9 oz (110 g) • Unilever Home and Personal Care USA Name Badge Labels (Size 2 3/16" x 3 3/8") n • 100 Labels • Avery Dennison/Avery Division 33 CMSC 100 -- Overview Thurs 8/30/12

11 -Digit Number n Digit = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9} n Sequence of 11 digits n QUESTION: How many different items can be encoded? 34 CMSC 100 -- Overview Thurs 8/30/12

Encode Name By 11 Digits First 6 digits: Manufacturer n First digit, product category: n n n 2: store’s use, for variable-weight items n n 0, 1, 6, 7, 8, or 9: most products 3: drugs by National Drug Code number Last 5 digits: Manufacturer-assigned ID 35 CMSC 100 -- Overview Thurs 8/30/12

Examples Labels: 0 -72782 -051440 n • 0=general product • 72782= Avery • 051440=Avery’s code for this product Ponds: 3 -05210 -04300 n • 3=drug code • 05210= Unilever • 04300=National Drug Code for this product 36 CMSC 100 -- Overview Thurs 8/30/12

12 -Digit Number The UPC folks decided to include another digit for error checking. Example: n • 01660000070 Rose’s Lime Juice (12 oz) • 04660000070 Eckrich Franks, Jumbo (16 oz) • 05660000070 Reese PB/Choc Egg (34 g) • 08660000070 Bumble Bee Salmon (14. 75 OZ) n Misread digit #2 and you turn sweet to sour! 37 CMSC 100 -- Overview Thurs 8/30/12

Check Digit 1. Add the digits in the odd-numbered positions (first, third, fifth, etc. ) together and multiply by three 2. Add the digits in the even-numbered positions (second, fourth, sixth, etc. ) to the result 3. Subtract the result from the next-higher multiple of ten. The result is called the check digit 38 CMSC 100 -- Overview Thurs 8/30/12

Code and Example 01660000070 set evensum to d 2+d 4+d 6+d 8+d 10 set oddsum to d 1+d 3+d 5+d 7+d 9+d 11 set checkdigit to (0 -(3*oddsum+oddsum)) mod 10 01660000070 odd-digit sum: 0+6+0+0=6 even-digit sum: 1+6+0+0+7=14 odd*3+even = 6*3+14=32 subtract from multiple of 10=40 -32=8 • • • 39 • Lime juice: 01660000070→ 016600000708 Franks: 04660000070→ 046600000705 Choc Egg: 05660000070→ 056600000704 Salmon: 08660000070→ 086600000701 CMSC 100 -- Overview all are two digits different now Thurs 8/30/12

Some (Mod) Math n 3 x Sodd + Seven = 0 mod 10 n The sum of the odd-position digits (times 3) plus the sum of the even position digits (including the check digit) is 0 mod 10 n Modulo math is just like regular math, except things wrap around (like an odometer). Mod 10 means we only pay attention to the last digit in the number n Divide by 10 and only keep the remainder 40 CMSC 100 -- Overview Thurs 8/30/12

More Modulo Math n What’s the check digit for the code 0 -000000? n What happens to the check digit if you add one to an oddposition digit? n What happens to the check digit if you add one to an evenposition digit? n Behavior that matters: check digits for “similar codes” (which might be easily confused/misread) are different (reducing the probability they’ll be misread) 41 CMSC 100 -- Overview Thurs 8/30/12

Bits n We’ve gone from a product name to an 11 -digit number to a 12 -digit number n A 0 will appear in the UPC as a white bar (space) and a 1 as a black bar n n n So we need to turn each digit (base 10) into a series of bits (base 2) Also, we want to be sure we alternate 0 s and 1 s often enough (e. g. , don’t want 20 black bars (1 s) in a row) Finally, we want to have a code that we can scan in either direction (i. e. , we need to be able to tell which direction we’re reading it in) 42 CMSC 100 -- Overview Thurs 8/30/12

Bits Digits are encoded as 7 -bit patterns that all: • start with 0, end with 1 • switch from 0 to 1 twice • include no pairs of numbers that are the reverse of each other (“reverse complements”) • 0: 0001101 1: 0011001 2: 0010011 3: 0111101 4: 0100011 5: 0110001 6: 0101111 7: 0111011 8: 0110111 9: 0001011 Encode d 1 d 2 d 3 d 4 d 5 d 6 d 7 d 8 d 9 d 10 d 11 d 12 as: 101 d 2 d 3 d 4 d 5 d 6 01010 d 7 d 8 d 9 d 10 d 11 d 12 101 43 CMSC 100 -- Overview Last 6 digits have 0 s and 1 s reversed. (No reverse complements can tell what direction we’re scanning in!) Thurs 8/30/12

How Many Bits? n Question: How many bits (zeros and ones) long is the code for the original 12 -digit sequence? 44 CMSC 100 -- Overview Thurs 8/30/12

Finally, Ink! n n n n Given the long pattern of bits, we write a 1 as a bar and a zero as a space Two 1 s in a row become a double-wide bar Two 0 s in a row become a double-wide space No UPC has more than four 0 s or 1 s in a row. Question: WHY? All digits have equal width All UPCs start and end with bars (actually with black-white-black pattern) UPCs can be read upside down UPCs can be read at an angle or variable speed via ratios 45 CMSC 100 -- Overview Thurs 8/30/12

Example n n n n 46 . . . . Barcode for skin cream: 3 -05210 -04300 -8 (8 is the check digit) start: 101; 3: 0111101 05210: 0001101 -0110001 -0010011 -0011001 -0001101 middle: 01010 04300: 1110010 -1011100 -1000010 -1110010 (rev) 8: 1001000 (rev); end: 101 The digits underneath are for our benefit (the machine doesn’t read them!) CMSC 100 -- Overview Thurs 8/30/12

Whew! n The n n n UPC example illustrates: Abstraction Binary numbers and modulo math Encoding (error correction, readability constraints) 47 CMSC 100 -- Overview Thurs 8/30/12

QR Codes n “QR” = “Quick Response Code” n QR codes are kind of like UPC codes. . . n . . . but the encoding is a lot more complicated: n n Complex masking scheme enables variable resolution, etc. , but the algorithm to reconstruct the underlying content is much more sophisticated n CMSC 100 -- Overview Variable data types and error correction levels n 48 Different “versions” provide different resolutions (which is why the pixels look bigger in some QR codes than others) No one pixel “means” anything like it does in a UPC code Thurs 8/30/12

QR. . . Coins? ? n Last year, the Netherlands introduced the first coins with a scannable QR code! Wave of the future. . . or total gimmick? 49 CMSC 100 -- Overview Thurs 8/30/12

That’s It! n Any last questions? n Enjoy your long weekend and I’ll see you on Tuesday! 50 CMSC 100 -- Overview Thurs 8/30/12