CS 151 - Introduction to Computer Science

Fall 2019


GENERAL INFORMATION

This is the website for CS 151 - Introduction to Computer Science offered in Fall 2019 and taught by Jeff Kinne, Adam Davenport, and Rob Sternfeld. This class will be held MWF 9-9:50am (section 002 Kinne), MWF 10-10:50am (section 001 Sternfeld), MWF 11-11:50am (section 003 Davenport) in Root Hall A-019.

Office hours are as follows.

  • Jeff Kinne - MW noon-3pm, TR 9-11am in Root Hall A-140D.
  • Adam Davenport - see at bottom of cs.indstate.edu
  • Rob Sternfeld - MTW 1-3pm in Root Hall A-140F

Click on the links on the left for information about the course.

COURSE ANNOUNCEMENTS

  • Here we'll keep notes on announcements for the course.
    Skip to the latest
  • August 13
    • Basic plan for the beginning of semester - (1) getting started with Linux and the CS systems, (2) running commands to look at data files, (3) Python3 programming
  • August 21
    • Syllabus - there it is, unix lab hours.
    • Attendance. For Kinne (9am section), log into the computer you are sitting at when you sit down. For Sternfeld (10am section) - ??. For Davenport (11am section) - log into the computer you are sitting at when you sit down.
    • Getting around Linux, getting your home computer setup.
    • See Linux and CS Systems Bootcamp from course links.
    • cs151 accounts - get logged in, set password and name. For Kinne (9am section), your username and password are in blackboard for this course. For Stenfeld (10am section) - ?? For Davenport (11am section) - ??
    • HW1 - demo of instructor doing it, everyone else do it. Get a start, try handing in to make sure that works
  • August 23
    • Log in to the computers for attendance.
    • Setting up your personal computer. For Windows - Putty. For Mac - Terminal. For Chromebook -??
    • HW1 - for question 4, it is asking for the size of the smallest and largest files. HW1 - finish it now, hand it in.
    • HW1 - graded today, check blackboard to see what your score is so far.
    • New - getting started with Python, chapter 1 in Automate the boring stuff (see course links) - arithmetic and expressions in Python, variables, saving a Python file and running it.
    • Note - we are using Python3 (not Python 2).
  • August 26
    • HW1 solutions, everyone 5/5?
    • Quiz 2 - knowing how to get around Linux, deal with files and such...
    • Reading - Chapters 1 and 2 of Automate the boring stuff.
    • Example programs - grade calculation, average of numbers from user, printing integers (with while loop, with for loop), typing practice, arithmetic quiz, multiplication table, prime testing
    • Study on the left - terms
    • Next HW and Quiz - next time.
  • August 28
    • Quiz 2 retake - ask your instructor. Solutions are in code/Quiz/ to study. A quiz retake will have the questions in a different order.
    • HW 1 late submission - ask your instructor.
    • How are you doing? If you don't have at least a 4 on HW 1 and Quiz 2, you should see your instructor; if you don't change your study habits you are likely to fail the class. You don't need to be a genius, you just need to spend the time to do the work and study. Remember that you can see your instructor in office hours and can also get help in the unix lab, Root Hall A-015.
    • HW3 coming soon.
    • Quiz4 will likely take place Wednesday Sept 4. Look for a sample quiz coming soon.
    • And, for some fun... - how do the isPrimes, typing, and multiply_practice programs work? What can we do to extend them?
    • You MUST do before Friday -
      	  cd ~jkinne/public_html/cs151-f2019/code
      	  cp multiply_practice*.py ~
      	  cd ~
      	  python3 multiply_practice.py
      	  nano multiply_practice.py
      	
      Also copy over the other python files in ~jkinne/.../code into your account. Run them. Look through them.
      And read through chapters 1 and 2.
      And if you have any trouble with the commands, do it in the lab Root Hall A-015 and get help in there.
      And if you need a retake of quiz 2, you MUST study and get it all correct on Friday.
  • August 30
    • Probably a work day for HW3, attendance is still required.
    • Maybe last chance retake of quiz2 as well.
  • September 4
    • Read chapter 3 - creating functions, named arguments to functions, try and except.
    • Text editor - at some point start using something smarter than nano. Jeff starts using atom in class (note that atom is available for all OS's and is installed on the CS lab computers, but it cannot be used in Putty or the Mac terminal).
    • Quiz4 practice - take a look in in-class code. Questions? Answers?
    • Cheat sheet - keep your cheat sheet up to date. This should be a quick summary of all of the Linux commands, and a quiz summary of all of the Python syntax and functions.
    • HW3 - take a look. Pick one for us to solve now. Everyone checkout the assignment. Let's solve the problem. Everyone handin the assignment.
    • BD4ISU - paid internship for under-represented, must be interested/willing to take a few extra bio, calc/stats courses
    • Note - if you're struggling, it would be okay to come to one of the other sections of 151 as well - sit in twice.
  • September 6
    • Quiz 4 in class today
    • HW3 due by 11:59pm Sunday, also see the assignments page for a link to a video giving hints/tips and giving a demo of how the correct solutions should work.
    • Sample questions can be found here
    • The remainder of class will be spent on HW3
    • Read chapter 4 for next week.
    • Something fun and useful - number guessing game, unit conversions - let's see if we can do google's "convert 1 mile to km" (sneak peak at split...)
  • September 9
    • Jeff's section
      • HW3 late work accepted through Wednesday, let's see correct solutions in class and take notes
      • for Wednesday, letter grade estimate
      • basic rules for if/else, while, see flow charts in the text
      • quiz4 answers
      • our version of okay google
    • Exam - probably next week, sample exam later this week
    • Quizzes - write your full name legibly, be nice to your instructor
    • quiz 4 retake?
  • Sept 11
    • HW5 released, due Monday by midnight
    • Exam sample for Friday
    • Play computer - key type of quiz/exam question, we practice in class
    • Some fun
    • Challenge - Jeff tries to leave a "challenge" question at the end of each lecture. These will not be graded. You should work on them before the next class, and if anyone asks for Jeff's solution he'll do it at the beginning of class.
    • Challenge - try to get some of the HW5 problems without using a for loop (may need to look up help on print, also need to know that \n in a string will give a newline).
    • Challenge - play computer with code/challenge/playComputer1.py
  • Sept 13
    • Jeff's section - how functions work - defining, running, play computer with playComputer1.py.
    • Sample "play computer" quiz - sample quiz.
    • Feedback - what's working for you, suggestions, etc. - on paper anonymous sometime during class. survey.txt
    • HW5 - note the questions telling you to go to the lab and to your instructor.
    • Challenge - create an account on hackerrank and start solving problems from Python bootcamp (see link on the Links page)
    • Note - play computer quiz on Monday, first exam one week from today. Sample exam ready for Monday, will include material from all of the HW's and quizzes.
  • Sept 16
    • Jeff's section - virtual office hours - setup an account at judy.indstate.edu, join the team "ISU CS" there, and email Jeff your username. Note that you need to sign up with your @sycamores.indstate.edu email address. I will add you to a channel for CS 151, and we do the "talk to the instructor" question from HW5 there.
    • Suggestions for those having trouble - (a) read the book, type in the code from the book and run it, (b) do all of this in the unix lab (pick a schedule of 2-4 hours per week that you'll do this in the unix lab), (c) do the old HWs again for practice, (d) try problems at the end of the chapter in Automate the Boring Stuff and check with your instructor and/or unix lab, (e) talk to yourself and write (don't fall asleep).
    • Note - you don't need previous experience to do alright in this class. You do need patience, curiosity, time, and ask for help when you need it.
    • Quiz today. Reminders - you are not allowed to use the computer or your phone. Jeff's section is allowed a 1 pages cheat sheet (front and back).
    • Tutoring/help lab - Unix lab, Root Hall A-015 open Monday 10-5, Tuesday-Thursday 9-5, Friday 9-noon, when it is open there is someone on duty who is being paid to help anyone who needs help.
    • First exam on Friday, Sept 21.
    • Sample exam sent out tonight, questions on it Wednesday. Exam content - Linux and CS systems bootcamp, Chapters 0-4 of Automate the Boring Stuff, all quizzes and HWs.
    • Note - CS 151 from the summer is linked off of the links page - includes some tutorials and videos
  • Sept 18
    • View the exams page for more information on the first exam and practice problems.
    • Play computer - try the ones from the sample exam on paper, then type them in and check, and make sure you understand. Then watch Jeff's video (will be available some time tomorrow morning).
    • Quiz6 - solutions and will it count? Jeff's section - not in your total grade right now, will do a retake option after the exam.
    • HW5 - solutions and is it graded yet? Jeff's section - didn't do the answers (your choice).
  • Sept 20
    • First exam. Good luck!
  • Sept 23
    • HW7 - project1a. See assignments page.
    • Exam1. 9am section not graded yet
    • Next up - functions, lists, tuples - chapters 3 and 4. Functions - def, parameters, return, local variables, imporant for code reuse / readability / modularization. Lists - indexing (negative and slices), append, del, remove, index, sort, for, in, not in, random choice. Tuples - similar to lists but immutable (might be stored differently internally by Python).
    • Next quiz - functions and lists, chapters 3 and 4.
  • Sept 25
    • HW7 - how your instructor is managing it, any questions.
    • Exam1 - if you didn't talk about it in class yet.
    • Continuing with functions, lists, tuples, strings.
    • Sample quiz
    • On computer quiz.
  • Sept 27
    • 9am section - worked on HW7
    • Next quiz - Wednesday
    • HW7 due - Wednesday
  • Sept 30
    • Quiz next time - check sample, any questions
    • HW7 due Wednesday - how it will be graded
    • On computer quiz practice. To try it out, login and check it out with
      	cd ~
      	handin -C pQuiz
  • Oct 2
    • Quiz - not this time
    • HW7 - due, check assignment for details on grading, turn in with handin, for groups both of you need to turn in the code!!
    • On computer practice quiz - questions?
    • Extra credit - acm_contest problems, let's take a look at a few...
    • Time to work on HW7, if you think you're done let's get it graded
  • Oct 7
    • Quiz 8 today. Any questions?
    • Reading - chapters 5 and 6 (dictionaries and strings)
    • Reading - from the book (files extracted in code/automate_online-materials) - magic8Ball.py, magic8Ball2.py, guessTheNumber.py, prettyCharacterCount.py. We may make HW assignments to extend these.
    • 9am section - looked at prettyCharacterCount.py (uses dictionary to count # characters, uses setdefault), and prettyCharacterCount2.py to see how it was working.
  • Oct 9
    • Quiz 8 - 10am section takes today, maybe retake next week
    • Reading - chapter 8, reading files
    • Example files for us - /u1/junk/shakespeare.txt, /u1/junk/kinne/Indianapolis-Weather-Station-USW00093819-1950-2018.csv
    • 9am section - looked at code/recipes/readFile.py
    • New HW - see assignments page, HW9, we may add a few more easy problems to it
  • Oct 14
    • HW9 questions?
    • Quiz10 on Friday - on the computer, practice today.
    • Reading csv files (11am section did not get to this yet)
    • HW to check your cheat sheets? (a few said yes, a few more said no, most did not have an opinion)
    • Retake quiz8 on Wednesday - everyone does the retake
  • Oct 16
    • Retake quiz8
    • Dealing with csv files (last new thing you need for HW9
    • Something cool / interesting / awesome we can do with programming - looking at large datasets. Example 1 - Indiana weather data. Example 2 - human genome. Example 3 - who logs in to the CS server the most.
    • Practice / get ready for Quiz10 for next time
    • HW9 - questions and work on it
  • Oct 18
    • Quiz 10
  • Oct 21
    • Quiz 11
    • Final questions on homework 9
  • Oct 23
    • Another quiz maybe. Jeff's section - quiz12a in class, went through solutions to quiz11a, will assign quiz10 and some other problems as HW.
  • Oct 25
    • Questions on scheduling classes for next semester? Next course in CS major is CS 201 Computer Science I. Other recommended courses - CS 170 Web Programming I. See CS undergrad advising and schedule of spring classes (bottom of cs.indstate.edu).
    • Considering switching majors? Consider IT, Cybercriminology and Security Studies. See catalog.
    • New HW assignment - quiz10 problems for most of the points, something more involved for an A on the assignment (based on weather maybe...)
    • Starting to talk about algorithms - find smallest/largest, selection sort
  • Oct 28
    • HW13 released, due Oct 31 by midnight
    • HW14 released soon, video democoming soon
    • Algorithms - selection sort example, try running selection sort code and compare against Python3's list sort.
    • Running time - using time command to run your program, counting "number of operations"
    • For the cheat sheet: 1 + 2 + ... + (n-1) + n = n*(n+1)/2, and summation notation with Sigma
    • For the cheat sheet: linux time command to measure running time of program
    • For the cheat sheet: metric abbreviations K, M, G, T, P, Hz is times/second
    • For the cheat sheet: if n is how many #'s dealing with, linear means a running time (aka # of steps) something like n, quadratic means something like n2
    • For the cheat sheet: running time for selection sort is quadratic ( and why), running time for Python's sort function is not quadratic (it actually is something like n * log(n))
    • Note - CS is not just programming, it is also about using the best algorithm to solve a problem (which requires some math/proofs to be sure of)
  • Oct 30
    • Last day to drop is Monday. If you're considering it please check with your instructor and advisor first.
    • Work on HW13, and if done with that then HW14 as well.
    • Spring courses - next courses in the major are CS 201, CS 170, and both require a C or higher in CS 151.
  • Nov 4
    • 9am & 11am sections - HW 14 part 1 due tonight, part 2 due Wednesday. Worked more on it today. Handin whatever you have by tonight. If you get a warning message about a manifest file when you handin, don't worry about it.
    • Coming up - dealing with files, directories (chapters 8, 9 )
  • Nov 6
    • Plan for the rest of the term - (a) a HW with a lot of easy problems (build confidence, review the basics, help in getting ready for exams), (b) file system functions in Python3 and a few related things, (c) another group project/HW - something new or a new revision of past group project/HW (probably due exam week), (d) exam the week before Thanksgiving, (e) study week - wrap up our algorithms content including a quiz or two.
    • Today - file system functions in Python3.
    • 9am section - HW14 - come to Jeff's office hours to do grading and check out your code in person. Make sure to handin so we can look at the files. Jeff's available times - Thursday 9:30-1, 2-3; Friday noon-1:30, 3-4; Monday 11-2:30; Tuesday 8:30-11, 1:30-2:30; Wednesday noon-2:30. Go ahead and keep working on your HW14 until you see me, and handin before you come to my office. Get as much working as you can, and get as many of the answers into weatherInfo.txt as you can.
  • Nov 8
    • Second exam - will be Friday Nov 22
    • HW15a - with all relatively small programs - is released, due Nov 15
    • A few new things - list comprehensions (shortcut instead of loop), recursion (alternate to using loops
  • Nov 11
    • HW15a - hwcheck is on. Note - there was a mistake in the formula for volume of gold; instead of * 2.2 it should be / 2.2.
    • List comprehensions
    • HW14, 9am section - see Jeff for grading.
    • HW14, 11am section - graded in class this week.
  • Nov 13
    • 9am section - HW14 grading, work on HW14 / HW15a, get started in HW16. HW14 - see me now in class or 1-3 today.
    • 9am section - HW16 - project 1b - keep working on previous project, or do start new. Talk to Jeff about what you're planning. Work with same partner, different partner, no partner - your choice. 30 points - style, must use everything we've learned (functions, loops, files, command-line arguments, input, lists, dictionaries). Interesting options for HW16 if you want to try something new - more with the weather data, some other csv files with data that would be fun to explore.
  • Nov 15
    • 9am section - HW14 and HW15a questions?
    • 9am section - HW16 - see assignments page.
    • Now would be a good time to read through the book again, programs we have done in class, and previous HW assignments. Pick a few hours per week to do that
    • Exam2 - on Nov 22. Sample exam coming soon.
  • Nov 18
    • 9am section - grading programs - if your program does not run (error) it is worth 0. Never turn in code that does not run (test often).
    • 9am section - grading programs - a 100% score on a program is not a guarantee that it is 100% correct, only that it passed tests. Always pay attention to model solutions as how to solve the problems.
    • 9am section - grading for quiz 10/11/12 - quiz 11 and 12 grades are in BB, and the max is counted. If you think there is a mistake, or if you think your quiz10 grade would be higher (so would count in place of quiz 11/12) send Jeff email with the details.
  • Dec 2
    • Algorithms you need to know (take notes) - selection sort, linear search, binary search, converting between bases, merge sort. For each, should - (a) be able to trace through the algorithm working on example input on paper, (b) know best-case and worst-case running time. What's the point? If we don't use the right algorithms, then many things computers do would not be fast enough (e.g., waiting for google search results for a few days as opposed to a second or two). See the links page for links about data structures and algorithms.
    • 9am section - today did linear search and binary search, and for both did the algorithm design steps - (1) specify the problem being solved including example input/output pairs, (2) write down the basic idea of the algorithm (enough to run it on paper with a short example), (3) write down more detailed pseudocode that would be enough to start writing a program, (4) determine what the best and worst-case running time is.
    • 9am section - next time is merge sort. Short quiz on linear and binary search, on paper. Need to be able to run the algorithm on paper, need to know the running time and why.
    • Be working on assignments. 9am section - HW16, due end of exam week, see assignments page, Jeff should give you an example project.
    • Exam2. Grading? Solutions?
  • Dec 4
    • 9am section - HW16, see code/HW16/cs15100 for Jeff's example project that uses good style and doesn't something mildly amusing.
    • 9am section - quiz on binary search.
    • 9am seciton - Exam2 handed back, solutions posted (here).
    • 9am section - merge sort, or converting bases?
    • 9am section - grades are mostly up to date. I updated your estimated letter grade. Remember that you need at least a C to take CS 170 and CS 201. Note that exams are worth 50%, and I will count the final exam in place of the others if you do better on the final. If your current total grade is X, your current exams total is Y, and you get a Z on the final, then your new total grade would be: X - 0.5*Y + 0.5*Z. If you currently have a 60% total grade, a 50% total exam grade, and got an 80% on the final exam, then you would have a final total grade of 60 - 0.5*50 + 0.5*80 = 75%.
    • 9am section - to finish strong, do well on the final exam, do well on HW16, and I will let you submit late HW assignments to me in person (that is, stop by my office, tell me what you have finished, and we'll take a look right then).
    • 9am section - did converting bases today. Try it out yourself and check your answers with - this website. Try with base 2, 8, and 16. For each you want to be able to convert between that base and base 10.
  • Dec 6
    • 9am section - converting bases questions. (1) Convert 123 to base 8, base 2, and base 16. (2) Convert 10 from base 8 to base 10. Convert 1010 from base 2 to base 10. Convert A2 from base 16 to base 10. (3) What is the largest 4 bit number? What is the largest 2 digit 8 number.
    • 9am section. HW16 due Dec 15 noon, I will grade it once for you ahead of time if you are ready. HW15b optional extra credit. Final exam - everything, study, cheat sheet, sample exam maybe.
    • 9am section - merge sort.
  • Dec 8
    • See exams page for a sample exam
  • The end
    • Final grade, prereq...
      Need a C or higher as prereq into CS 170, 201. If you have less than a C you will need to retake CS 151 in the spring. Don't take this as a criticism about you as a person, it just means you aren't ready for the next class yet.
    • Final grade, C...
      Those in the 9am section who ended up with a C/C+ are borderline ready for the next class, and will likely be in trouble if you don't work on your programming over break. You should read through the book again, try out some things on your own, do some of the later HW assignment problems again.
    • Final grade, B...
      Those with B-/B are probably okay but also should do some reading and practice over the break.
    • Final grade, A...
      Don't rest on your laurels - push yourself, keep coding. It is common for people who get an A in 151 to have a dropoff in 201 or 202; don't let that be you!
    • Final grade, but also...
      Those comments are "on average"; there are a few who ended up with either a slightly higher or lower grade than I think was indicative of your skills/knowledge.
    • Remember...
      programming is fun and important! You get to make things happen! Analyze important data, make software that helps people or solves important problems, make games (cool), be an important part of the running of any type of business.
    • More to work on over break...
      Stay tuned, we'll be sending some more review information out over break.
    • Inspirtation and why you decided to major in CS...
      Stay tuned, planning to send something out over break.
Note: course website layout/code/template from Steve Baker. Anything horrible is not his fault.