Transcript for:
Understanding Algorithms in Computer Science

[Music] there are a lot of misconceptions in the computing world it is easy to misunderstand such a complex piece of technology in today's lesson i am going to introduce computer science computer science has a lot of myths and misconceptions some of which are that it is the study of computers the study of how to write computer programs and that is the study of the uses and applications of computers and software computer science is actually defined as the study of algorithms this includes formal and mathematical properties hardware realization linguistic realizations and each application algorithm in the other hand is defined as an ordered sequence of instructions that is guaranteed to solve a specific problem an example of this is step one doing something step two doing something step three doing something step in stop you are finished furthermore there are operations used to construct algorithms sequential operations is defined as carries out a single well-defined task sequential algorithm or serial algorithm is an algorithm that is executed sequentially once through from start to finish without other processing executing as opposed to concurrently or in parallel conditional operations is defined as ask a question and the next operation is then selected on the basis of the answer to that question this is the ability to test a variable against a value and act in one way if the condition is met by the variable or another way if not they are also commonly called by programmers if statements to know if a condition is true or false we need a new type of data the booleans they allow logical operations a logic statement or operation can be evaluated to be true or false our conditional statement can then be understood like this if a condition evaluates to true then do these things only for true else otherwise do these things only for false iterative operations is defined as looping instructions that tell not to go on but go back and repeat the execution of a previous block of instructions in iteration control structures a statement or block is executed until the program reaches a certain state or operations have been applied to every element of a collection this is usually expressed with keywords such as while repeat for or do until we use algorithms all the time although we don't call them that whenever we follow a set of instructions to assemble a child's toy bake a cake balance a checkbook or go through the college registration process here is a good example of an algorithm used in everyday life is the set of instructions this is for programming a dvr to record a collection of television shows note the three types of instructions in this algorithm sequential steps three four five and seven conditional steps one and six and iterative step two in our math subjects we were thought to do addition as first add the right most column of numbers seven plus five getting the value twelve writing two under the line and carry the one to the next column and you know the rest although as children we learn this algorithm informally it can like the dvr instructions in the previous figure be written formally as an explicit sequence of instructions in this figure shows an algorithm for adding two positive and digit numbers it expresses formally the operations informally described previously again note the three types of instructions used to construct the algorithm sequential steps 1 2 4 6 7 8 and 9 conditional step five and iterative step three even though it might not appear so this is the same decimal addition algorithm that you learned in grade school if you follow it rigorously it is guaranteed to produce the correct result now if you are to ask why are formal algorithms so important in computer science it is because if we can specify an algorithm to solve a problem then we can automate its solution computing agent on the other hand is a machine robot person or thing carrying out the steps of the algorithm these machines do not need to understand the concepts or ideas underlying the solution because all it has to do or the steps programmed exactly is written machines can learn algorithms take note that in your thesis you will be training a model and this model contains a machine in some cases unsolved problems occur which are problems that are unsolvable some solutions are too slow and some solutions are not yet known and that ends our discussion [Music] you