Session 4 Systematic Lists CSC 104 international, Logic open membership, notProgramming for-profit technology standards Pearson Custom and Problem consortium.Solving Computer Science CSC 104 Nassau Community College Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 1 Systematic List • Make a systematic list of all the ways you can order the bits 0 and 1 into a 3 digit sequence, for example, 010. • There are 8 different ways international, openBitmembership, notBit 1 2 Bit 3 for-profit0 technology 0 standards 0 consortium. 0 0 1 0 0 1 1 1 1 Prof. Vincent Costa 1 1 0 0 1 1 Nassau Community College 0 1 0 1 0 1 Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 2 Systematic List • Try a 4 digit sequence. ? different ways Bit 1 Bit 2 0 0 0 0 Bit 3 0 0 1 1 Bit 4 0 1 0 1 international, open membership, notfor-profit technology standards consortium. Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 3 Systematic Lists • Another way of solving a problem is to make a systematic list. A systematic list is generated to organize information in a methodical way. open membership, notinternational, for-profit technology standards • A table isconsortium. an easy way to organize a list – the columns are labeled with the information of the problem and the rows are the different possibilities Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 4 Systematic Lists • Leslie has 25 cents in her pocket but does not have a quarter. If you can tell her all possible combinations of coins she could have thatinternational, add up to cents, notshe will give open25 membership, for-profit technology standards you the 25 cents! consortium. • What would you put as the column headings? How could you systematically determine all the possibilities? Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 5 Systematic Lists Dimes Nickels Pennies 2 1 0 international, open membership, notfor-profit technology standards consortium. Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 6 More Football! • Andrew and his friends have formed a fantasy football league in which each team will play one game against each of the other teams. There areinternational, 7 teams: Texas A&Mnot(Aggies), open membership, for-profit technologyAlabama standards (Crimson Purdue (Boilermakers), consortium. Tide), Oregon (Ducks), Boston College (Eagles), Air Force (Falcons) and Florida (Gators). How many games will be played in all? Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 8 More Football! Team1 Texas Texas Texas Texas Texas Texas Team2 Purdue Alabama Oregon BC AF Florida international, open membership, notfor-profit technology standards consortium. Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 9 More Football! • • • • • • • Texas vs. 6 teams Purdue vs. 5 teams Alabama vs. 4 teams Oregon vs. 3 teams international, open membership, notBC vs. 2 teams for-profit technology standards AF vs. 1 team consortium. How many games?? 21 • Could a diagram be used to solve this problem? Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 11 More Football! • What if there is another team added to the league so there are 8? How many games would be played? international,= open • 7+6+5+4+3+2+1 28membership, notfor-profit technology standards • What if the league had 9 teams? consortium. • 10 teams? Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 12 Another Systematic List • For her Shakespeare course, Kristen is to read all five of the following plays and choose three of them to write papers about: Richard III, The Tempest, Macbeth, international, open membership, not-A for-profit technology standards Midsummer Night’s Dream and Othello. How consortium. many different sets of plays can Kristen write papers about? Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 13 Homework • Use a Systematic List to solve the last slide, the one about the Shakespeare course • Due next class international, open membership, • Let me know if there are anynotissues for-profit technology standards consortium. Prof. Vincent Costa Nassau Community College Acknowledgements: An Introduction to Programming Using Visual Basic 2012, All Rights Reserved 14