Note: I am putting these here because students have asked them in the past, this is not a reflection of what will be on quizzes.
A: This is a really hard line to walk when you are first starting to program which is why it is very important that you test your code often to see if it is working and print out what all of your variables are frequently to make sure things are correct. Generally the computer will know how to do each individual command you give it or it will tell you that it doesn't understand, the problem comes in when you fill in extra knowledge because it is so obvious to you and you leave the computer behind because you didn't tell it all of your thinking.
A: Google keeps its algorithms secret for the most part but when it started it was using the Page Rank algorithm, which is pretty simple. Ask me (Ariel) sometime and I can explain the basics.
A: It depends on what you mean by steps. Writing code with the fewest lines used to be important since the space the code took up in the memory of the computer was precious, but now that we have more memory in our computers holding the code for a program is rarely a strain on memory. The number of steps that the computer runs in executing the program does still matter and reducing those is a major topic in computer science, though we won't cover it much in this class.
A: Yes, we call this "Abstraction" and it is one of the four pillars of good computer science. Abstraction makes it possible to reuse code for many different situations. This does not mean that the algorithm isn't specific about what the computer can do in each case, just that it can be used across many different cases.
A: Yes! There are many types and categories of algorithm based on the problems they try to solve, the way in which they try to solve problems, and how long it takes them to solve problems.
A: The algorithms that YouTube and other social media companies use are very good at doing what they were designed to do. Computer Scientists should be grappling with the ethics of those particular algorithms but the fault is not in the computer but in those creating the systems. It would certainly be possible to tweak the recommendation algorithms to isolate consumers less while still recommending relevant and interesting content.
A: Algorithms are instructions, if you can write an instruction out of purely numbers that can be an algorithm.
A: Yes, loops and recursion are the two most common ways to automatically repeat code. We will learn more about loops in a few weeks.
A: Algorithms can be pretty complex. Here is a picture of Margret Hamilton standing next to the algorithm she wrote in 1969 to make the Apollo space mission possible. (Algorithms have gotten more complex since then).
A: Break it down into smaller pieces, look for patterns, and find things that are generally the same but with a couple details different.
A: The code you write is the algorithm the computer follows when running your program.
A: You often can't. In this class we are going to assume that as long as you give the user basic directions (e.x. "Enter a decimal number") they will do as you intend. In the next course, COSC 130, we talk about how to make sure the program doesn't break when the user does wonky stuff.
A: Mostly practice. It is hard to figure out what you need to specify when you are first starting out. That is why we will be looking at a lot of different ways to construct an algorithm, not just code but writing out the steps and making Activity Diagrams (coming soon)
A: If you miss the step of adding the Peanut Butter to a PB&J you will still get a sandwich at the end but it won't be the final outcome that was intended. If a computer has to skip a step it will often crash and give no result or do something unintended in future steps because it didn't do the missing step.
A: The simplest example is probably what we did on the first day: System.out.println("Hello World"); This is a one step algorithm to print out the words "Hello World"