CompSci 101 Introduction to Computer Science March 3, 2015 Prof. Rodger compsci101 spring151.

Slides:



Advertisements
Similar presentations
CompSci 101 Introduction to Computer Science January 22, 2015 Prof. Rodger compsci101 spring151.
Advertisements

CompSci 101 Introduction to Computer Science February 3, 2015 Prof. Rodger Lecture given by Elizabeth Dowd.
CompSci 101 Introduction to Computer Science Feb 26, 2015 Prof. Rodger.
Aprendo vocabulario. What´s this? This is a duck.
CompSci 101 Introduction to Computer Science January 13, 2015 Prof. Rodger compsci 101 spring
CompSci 101 Introduction to Computer Science January 20, 2015 Prof. Rodger compsci 101, spring
CompSci 6 Introduction to Computer Science October 20, 2011 Prof. Rodger.
Dictation practice 4th Form Ms. Antonela.
CompSci 100e Program Design and Analysis II March 29, 2011 Prof. Rodger CompSci 100e, Spring20111.
Tips: To change your picture, click “Insert” –> “Picture”, select picture from your computer. You can adjust your picture by click the “Format” menu. When.
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 November 1, 2011 Prof. Rodger.
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.
“It’s my bread” By Kauri 2. “It’s my bread,” Said the rhino.
CompSci 6 Introduction to Computer Science November 8, 2011 Prof. Rodger.
CompSci 101 Introduction to Computer Science November 18, 2014 Prof. Rodger.
Zoo Math Grade: Kindergarten By: Laura Wilkerson.
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 Introduction to Computer Science March 31, 2015 Prof. Rodger Thanks to Elizabeth Dowd for giving this lecture Review for exam.
Animals In Our Life. [s], [d], [t], [f], [v], [e], [ei], [a:], [ai].
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 Introduction to Computer Science January 28, 2016 Prof. Rodger compsci101 spring161.
Elimination Method Day 2 Today’s Objective: I can solve a system using elimination.
CompSci 101 Introduction to Computer Science Feb 24, 2015 Prof. Rodger.
CompSci 101 Introduction to Computer Science February 11, 2016 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.
PLAY Is there a monkey? Click one number!
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 April 7, 2015 Prof. Rodger.
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 April 14, 2016 Prof. Rodger Lecture today by Sriram Vepuri.
CompSci 101 Introduction to Computer Science March 1, 2016 Prof. Rodger.
CompSci 101 Introduction to Computer Science April 14, 2016 Prof. Rodger compsci101 spring161.
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.
Teaching Reading for Young Learners
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
This is a frog. This is a green frog..
Combining Like Terms at the zoo
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
Vocabulary Practice 1. Choose your theme: animals school food music
Introduction to Computer Science
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
Combining Like Terms at the zoo
CompSci 101 Introduction to Computer Science
CompSci 101 Introduction to Computer Science
How Many Animals Are There?
By Yu-Chen Hsiao Chun-Ti Su
CompSci 101 Introduction to Computer Science
Presentation transcript:

CompSci 101 Introduction to Computer Science March 3, 2015 Prof. Rodger compsci101 spring151

Announcements Reading and RQ 12 for next time Assignment 5 due Thursday APT 5 due today, APT 6 due March 17 compsci101 spring152

Set Operations from pictures bit.ly/101S Question: Which operation does the red represent? E) A) B) C) D) compsci101 spring153

Problems – snarf setExample.py 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 –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”, … ] compsci101 spring154

Data for example [“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” ] compsci101 spring155

Smith COMPSCI101 MATH101 ECON101 HISTORY230 FRENCH1 Green Ye Li Black LeeOlson Wills Wrigley Abroms Williams Curtson Lin Wei Yavatkar Delong Noell Set Picture of Data compsci101 spring156

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

Smith COMPSCI101 MATH101 ECON101 HISTORY230 FRENCH1 Green Ye Li Black LeeOlson Wills Wrigley Abroms Williams Curtson Lin Wei Yavatkar Delong Noell People Taking both Math And CompSci Intersection compsci101 spring158

Part 1 – processList bit.ly/101S 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 spring159

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

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

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

Smith COMPSCI101 MATH101 ECON101 HISTORY230 FRENCH1 Green Ye Li Black LeeOlson Wills Wrigley Abroms Williams Curtson Lin Wei Yavatkar Delong Noell Union all sets But French1 compsci101 spring1513

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

Part 3 – unionAllSetsButMe bit.ly/101S 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" ]) 15

Part 4 – peopleTakingOnlyOneCourse bit.ly/101S 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 compsci101 spring1516

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

APT - UniqueZoo How do you solve this problem? How is it similar to the problem we just solved compsci101 spring1518

Example Data for UniqueZoo ["zebra bear fox elephant","bear crocodile fox", "rhino elephant crocodile kangaroo", "elephant bear"] zebra elephant fox bear kangaroo rhino crocodile compsci101 spring1519

UniqueZoo – two zoos have unique animals zebra elephant fox bear kangaroo rhino crocodile compsci101 spring1520