CompSci 101 Introduction to Computer Science

Slides:



Advertisements
Similar presentations
CompSci 101 Introduction to Computer Science February 3, 2015 Prof. Rodger Lecture given by Elizabeth Dowd.
Advertisements

CompSci 101 Introduction to Computer Science Feb 26, 2015 Prof. Rodger.
Computer Science: A Structured Programming Approach Using C1 3-7 Sample Programs This section contains several programs that you should study for programming.
CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring
CompSci 6 Introduction to Computer Science October 20, 2011 Prof. Rodger.
CompSci 100e Program Design and Analysis II March 29, 2011 Prof. Rodger CompSci 100e, Spring20111.
CompSci 101 Introduction to Computer Science September 23, 2014 Prof. Rodger.
CompSci 101 Introduction to Computer Science Sept. 9, 2014 Prof. Rodger President Brodhead speech graduation 2010 CompSci 101 Fall
CompSci 6 Introduction to Computer Science Sept 29, 2011 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were not.
CompSci 101 Introduction to Computer Science March 3, 2015 Prof. Rodger compsci101 spring151.
CompSci 6 Introduction to Computer Science September 13, 2011 Prof. Rodger.
Compsci 101.2, Fall Plan for TDAFB (after fall break) l Hear via about plans to catch-up and stay-ahead  Profs. Rodger and Astrachan to.
Compsci 101.2, Fall Plan for 11/9 and 11/11 l Reviewing Concepts for test  Loops: index and by element  Strings, Lists, Sets, Dictionaries.
Compsci 101, Fall Plan For The Day (PFTD) l Practice solving problems  Some solved with a computer, some with Python  Differences in solving.
CompSci 101 Introduction to Computer Science February 10, 2015 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were.
Compsci 101.2, Fall Plan for October 22 l Images, tuples, RGB color model  Image processing by understanding API  Image processing with tuples.
CompSci 101 Introduction to Computer Science January 28, 2016 Prof. Rodger compsci101 spring161.
CompSci 101 Introduction to Computer Science Feb 24, 2015 Prof. Rodger.
CompSci 101 Introduction to Computer Science January 26, 2016 Prof. Rodger compsci 101, spring
CompSci 101 Introduction to Computer Science November 11, 2014 Prof. Rodger CompSci 101 Fall Review for exam.
CompSci 101 Introduction to Computer Science March 17, 2015 Prof. Rodger compsci 101, spring
CompSci 101 Introduction to Computer Science February 25, 2016 Prof. Rodger compsci101 spring20161.
CompSci 101 Introduction to Computer Science January 15, 2015 Prof. Rodger 1.
CompSci 6 Introduction to Computer Science September 27, 2011 Prof. Rodger CompSci 6 Fall
CompSci 101 Introduction to Computer Science February 16, 2016 Prof. Rodger “All your troubles are due to those ‘ifs’,” declared the Wizard. If you were.
CompSci 101 Introduction to Computer Science March 24, 2016 Prof. Rodger compsci 101, spring
CompSci 101 Introduction to Computer Science March 8, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science March 1, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science March 29, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science February 5, 2015 Prof. Rodger Lecture given by Elizabeth Dowd compsci101 spring151.
CompSci 101 Introduction to Computer Science Sept 13, 2016 Prof. Rodger compsci101 fall161.
CompSci 4 Java 1 Apr 2, 2009 Prof. Susan Rodger. Announcements Assignment 7 questions? –Beware having two events that kick in at the same time! –Beware.
CompSci 101 Introduction to Computer Science
Unit 6 Introduction Monday, March 11.
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Math 1316 Prof. Thomas Jay.
CompSci 101 Introduction to Computer Science
CompSci 6 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Chapter 4: Probability & Statistics
Normal Distribution.
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CS 1430: Programming in C++ Turn in your Quiz1-2 No time to cover HiC.
CompSci 101 Introduction to Computer Science
Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Saving you money… one dbq at a time
Welcome to MAT 142.
CompSci 101 Introduction to Computer Science
PFtTBSB Files and formats: how to read and store data
Median: middle score - half of the data will fall below the median When data is placed in order… - half of the data will fall below the median.
CompSci 101 Introduction to Computer Science
Purpose of This Deck This slide deck is intended for use by site administrators to provide information to Parents about the California School Dashboard.
Presentation transcript:

CompSci 101 Introduction to Computer Science Mar 2, 2017 Prof. Rodger compsci 101, spring 2017

fromxkcd compsci 101, spring 2017

Announcements Reading and RQ13 due next time Assignment 5 due next Thursday APT 5 due Tuesday Today: Solving a problem with list comprehensions more with sets compsci 101, spring 2017

Grace Hopper Celebration of Women in Computing Conference Apply now for scholarships to attend! Due March 8

Process Exam Scores Total number, Average, Median Start with grades 76 68 74 72 64 77 46 81 … Create histogram 86 86 86 86 85 85 85 85 85 85 85 84 84 84 84 84 84 84 84 84 83 83 83 83 83 83 83 83 83 83 83 83 82 82 82 82 82 82 82 82 82 82 82 82 81 81 81 81 81 81 81 81 81 81 81 80 80 80 80 80 80 80 80 80 80 80 80 80 79 79 79 79 79 79 79 79 79 79 79 79 79 78 78 78 78 78 78 78 78 78 78 77 77 77 77 77 77 77 77 76 76 76 76 76 76 76 76 76 76 76 76 I am using integer grades, truncated them. compsci 101, spring 2017

Process Exam Scores bit.ly/101s17-0302-1 Calculate Total number of scores Number of unique scores Average score Median score Print a visualization of the grades Get snarf file compsci 101, spring 2017

Latanya Sweeney Former Chief Technologist at FTC. I am a computer scientist with a long history of weaving technology and policy together to remove stakeholder barriers to technology adoption. My focus is on "computational policy" and I term myself a "computer (cross) policy" scientist. I have enjoyed success at creating technology that weaves with policy to resolve real-world technology-privacy clashes. http://latanyasweeney.org/ Identify 87% of US population using (dob,zip,gender). Director of Harvard Data Privacy Lab, instrumental in HIPAA because of de-identification work Keynote Speaker at GHC 2016 compsci 101, spring 2017

aboutmyinfo.org Entered my data Easily identifiable by birth date (about 1) Lots with my birth year (about 273) Lots of people in my age range (of four years) – (1365) One of her sites compsci 101, spring 2017

aboutmyinfo.org Entered my data Easily identifiable by birth date (about 1) Lots with my birth year (about 273) Lots of people in my age range (of four years) – (1,365) One of her sites compsci 101, spring 2017

Set Operations from pictures bit.ly/101s17-0302-2 Question: Which operation does the red represent? A) D) C) B) Answers below http://en.wikipedia.org/wiki/File:Venn0111.svg Symmetric Difference B) intersection C) everything not in either set D) Union e) Difference E) compsci101 fall16

APT SandwichBar

APT SandwichBar Solve APT Sandwichbar with feedback from them, use sets

APT SandwichBar bit.ly/101s17-0302-3 compsci 101, spring 2017

Problems – snarf setExample.py Given a list of strings that have the name of a course (one word), followed by last names (one word each) of people in the course: Find total number of people taking any course Find number of people taking just one course ["econ101 Abroms Curtson Williams Smith”, "history230 Black Wrigley Smith”, … ] Process data – create lists of strings of names for each course Do we need the course names to answer these questions? No. We need to keep the students in a course together to represent a course, but we don’t need the names of the courses to answer these questions. compsci101 fall16

Data for example TO easier format to work with: [“compsci101 Smith Ye Li Lin Abroms Black“, “math101 Green Wei Lin Williams DeLong Noell Ye Smith”, “econ101 Abroms Curtson Williams Smith”, “french1 Wills Wrigley Olson Lee”, "history230 Black Wrigley Smith” ] TO easier format to work with: [ [ ‘Smith’, ‘Ye’, ‘Li’, ‘Lin’, ‘Abroms’, ‘Black’], [‘Green’, ‘Wei’, ‘Lin’, ‘Williams’, ‘DeLong’, ‘Noell’, ‘Ye’, ‘Smith’], [‘Abroms’, ‘Curtson’, ‘Williams’, ‘Smith’], …. ] compsci101 fall16

COMPSCI101 Set Picture of Data ECON101 Li Abroms Curtson Williams Ye MATH101 Smith Lin Noell Green Wei Delong Yavatkar Black Visual way to look at this example. Look at Smith – in four courses. Wrigley in two courses Wrigley FRENCH1 Wills HISTORY230 Lee Olson compsci101 fall16

COMPSCI101 People in CompSci 101 ECON101 Li Abroms Curtson Williams Ye MATH101 Smith Lin Noell Green Wei Delong Yavatkar Black Wrigley FRENCH1 Wills HISTORY230 Lee Olson compsci101 fall16

People Taking both Math And CompSci COMPSCI101 ECON101 Li Abroms Curtson Williams Ye MATH101 Smith Lin Noell Green Wei Delong Intersection Yavatkar Black Intersection is the green Wrigley FRENCH1 Wills HISTORY230 Lee Olson compsci101 fall16

Part 1 – processList bit.ly/101s17-0302-4 Given a list of strings that have the name of a course (one word), followed by last names of people in the course: Convert list into lists of strings of names for each course ["econ101 Abroms Curtson Williams Smith", "history230 Black Wrigley Smith", … ] [ [‘Abroms’, ‘Curtson’, ‘Williams’, ‘Smith’], [‘Black’, ‘Wrigley’, ‘Smith’, …] ] compsci101 fall16

Part 2 – peopleTakingCourses bit.ly/101s17-0302-5 Given a list of lists of names, each list represents the people in one course: Find total number of people taking any course peopleTakingCourses should return unique list of names Small Example [[‘Abroms’, ‘Curtson’, ‘Williams’, ‘Smith’], [‘Black’, ‘Wrigley’, ‘Smith’]] Answer is 6 unique names compsci101 fall16

COMPSCI101 People taking Courses - Union ECON101 Li Abroms Curtson Williams Ye MATH101 Smith Lin Noell Green Wei Delong Yavatkar Black Total Number Is 17 unique names Wrigley FRENCH1 Wills HISTORY230 Lee Olson compsci101 fall16

Next, find the number of people taking just one course compsci101 fall16

COMPSCI101 Union all sets But French1 ECON101 Li Abroms Curtson Williams Ye MATH101 Smith Lin Noell Green Wei Delong Yavatkar Black Discuss, wouldn’t it help if you had the union of all sets but the one Wrigley FRENCH1 Wills HISTORY230 Lee Olson compsci101 fall16

To solve this problem First let’s write a helper function compsci101 fall16

Part 3 – unionAllSetsButMe bit.ly/101s17-0302-6 Given example, a list of sets of strings, and the index of one of the sets, return the union of all the sets but that one example = [set(["a", "b", "c"]), set(["b", "c", "d", "g"]), set(["e", "d", "a"])] unionAllSetsButMe(example,1) is set(["a", "b", "c", "e", "d" ]) compsci101 fall16

Part 4 – peopleTakingOnlyOneCourse bit.ly/101s17-0302-7 Given a list of lists of strings of names representing people from courses Find number of people taking just one course [[‘Abroms’, ‘Curtson’, ‘Williams’, ‘Smith’], [‘Black’, ‘Wrigley’, ‘Smith’, ‘Abroms’]] 4 If this was just our data, we have 4 people taking just one course – either econ101 or history230 compsci101 fall16

COMPSCI101 People taking Only one course ECON101 Li Abroms Curtson Williams Ye MATH101 Smith Lin Noell Green Wei Delong Yavatkar Black Wrigley FRENCH1 Wills HISTORY230 Lee Olson compsci101 fall16