Python for Absolute Beginners Transcripts
Chapter: The big ideas of software development
Lecture: Big idea: Algorithms
0:00 What is an algorithm? In terms of computer programs, it's really just the little parts of your program that have to make decisions
0:09 or control the flow of what your application is doing. Well, first we're going to check and see if a user is logged in.
0:15 If they're logged in, we're going to then get their courses and show them here. If they're not, we're going to tell them, Hey
0:20 you have to log in first, or redirect them over to a page that is the unauthenticated page. Something like that might be how it works on the website.
0:29 Programs are not usually made up of the algorithm that makes up the program. There's a bunch of little parts.
0:35 And each little part generally has its own algorithm. Sometimes these are very formalized. Sometimes they're just kind of thinking through
0:42 to the decision-making. So for example, if we want to get really formal we're not going to do that too often in this course but we could look at this.
0:48 This is Euclid's algorithm for finding the GCD great common divisor, of two numbers. Take two inputs and you say, Is B zero?
0:57 No. Is A greater than B? No. And then you have the steps and you go through it. Most algorithms as we think about them in modern programming
1:07 it's not generally this low level but sometimes. Often, you'll find the building blocks that we use are built out of algorithms themselves
1:15 and we can just use them. We don't have to deal with the low-level details. But that's what an algorithm is.
1:21 Sometimes this is almost used as a negative word in today's world. It has algorithms have political bias
1:29 or algorithms have racial bias or they have these other problems that are unfair or inaccurate. And that's true but all that really is saying
1:38 is programs sometimes, when people decide how they think or the data that they use, is imperfect and it has problems.
1:47 But an algorithm itself is just this neutral thing. It's just kind of this decision-making process. Take these things as inputs, do this sort of test
1:55 carry on in this way or that way.