♫ Opening Music ♫ Hello, welcome to the first class of your algorithm course Yes! If you knew the Channel Curso em Vídeo for HTML5 course We just started our second course, which is the course of Algorithms If you're coming now and found the Algorithms' course Be aware that there are several courses on www. cursoemvideo.
com or on our YouTube channel that is youtube. com/cursosemvideo So feel free to study. What we are starting now is one of the most requested courses on our channel, an algorithm course, and in this first class I'll do what few algorithms teachers do: really explain to you what algorithms is for.
So without further ado, let's get started on our first lesson of your Algorithms' course! Algorithm It is the name that lay people almost come to understand as soon as they hear it. That's because she looks a lot like another word we hear since our childhood: number but they are two different things!
(although they have the same origin) but if I ask you now: "What's an Algorithm? " Many people would answer that it is something difficult related to complex concepts of calculations or so and then you can ask me: "Guanabara, is people's concept right? " And I will sure answer: "No way.
" Algorithms are very simple concepts, used by everyone in our everyday life. And I'll prove it to you! Today we have digital algorithms acting in our lives.
and I will give some examples. You access a certain website, right? May it be to search something, read your emails, to relate to your friends via social networks, shop online, and even to buy tickets to the movies.
And I assure you, it all exists only because of algorithms. Even at this very moment, when you're there watching this video with your hand on your chin Algorithms are working for you And it's not only there where we apply algorithms. When you play from the simplest game, passing on the classics, and reaching the more evolved games, Algorithms are acting to give you fun.
and it doesn't stop there, you have more stuff from your everyday life using algorithms. With your smartphone, you can talk to people, share experiences, or even calculate routes if you are lost in the street. With your TV set, you can access interactive and on-demand content, often with a simple hand gesture, without even needing the remote control, and guess who controls all this?
You got it right, algorithms! There are even modern cars that are able to park alone and stop without you having to step on the pedals. All controlled by sensors, computers and their algorithms.
And I could stand here talking for hours, but I think you've already got the idea. But the concept of algorithms goes far beyond computers. Let's see how the Manzano, one of the most famous authors on the subject, defines algorithms.
In his book "Algorithms, Logic Computer Programming Development". Manzano sets: "Algorithm steps are finite sets and arranged that, when executed, solve a given problem. " Then that's it.
Every solution comes from a problem. The need to create a relationship of virtual environment gave birth to Facebook. The need to replace SMS gave birth to WhatsApp, and so on.
Algorithms are used even for calculating the amount of beauty of something. By chance have you ever heard of the Golden Proportion? If you haven't, hold your head because she's about to explode.
The concept of Golden Proportion is very simple and it all starts with a number represented by the Greek letter "φ" the Convention "φ" is equal to 1. 618 But be careful not to be confused with the other Greek letter "π" worth 3. 14 let's see the application of "φ" in the real world.
If we take the body of a human being considered perfectly symmetrical what is understood by many as a synonym for beauty and calculate the ratio between the height and the distance from the belly button to the floor the value found for this division will be the value of "φ". Similarly, the measure from the shoulder to the finger and the distance from the elbow to the same finger, also results in "φ". If you take a picture of anyone considered beautiful (and I would call them symmetrical) the Golden Proportion is present in several measures.
Several of these ratios are represented in Da Vinci's work "Vitruvian Man". In nature, the "φ" also appears. For example, sunflowers' seeds are spread by the golden ratio.
The same applies to branches of some tree species and measures of starfishes. Other animals are not left out. The shell of the snail Nautilus is something awesome!
After man discovered the relationships of "φ", we began using this same pattern consciously. In architecture, for example it is used in various constructions, as the Parthenon in Greece and many others. In Botticelli's "Birth of Venus" Aphrodite is fully represented in the golden ratio Beethoven used the reason "φ" in its 5th (fifth) Symphony and several musicians currently use it in rhythmic division and compasses.
Today the industry, advertising and the arts apply the standards of Golden Proportion in their products, logos and websites and you end up liking it unconsciously without really knowing why. And there it is, all this is playing by a standard ie Algorithms. All repeated patterns are known as Routines, and this term is also used in Algorithms and we can apply the concept of routine in our lives.
Let's see for example a routine of our daily lives: crossing the street. Let's consider here a hypothetical algorithm to cross the street. Steps are read from top to bottom and from left to right.
In the first line we have the algorithm that is "across the street", this is our routine to be used. The first step getting to a street (mainly hectic streets) is to look at your right and then look at your left. Lastly, we have a condition.
If a car is coming, do not cross. Otherwise, cross. What I did here was only write in text form your routine when crossing a street, didn't I?
And we may have other options for the same algorithm. Let's see a second option. So we agreed that this first part is really an Algorithm then Let's go to another version, that looks the same from the other but with some differences.
Note that the first here, instead of looking to the right, is to look to the left and then look to the right. My condition is also a little different. If a car is not coming, which is different from the first, that is If a car is coming, If it is not coming, cross, otherwise, do not cross.
Similarly, both of them work and you will cross the street. Hence it is an algorithm! And then you may be thinking Guanabara, I can then just put the same steps in any order and we can build algorithm, right?
Wrong! I'll show you an example. I will show an example, where I'll take the same steps and put in another order and this order will not form an Algorithm.
On the left I'll keep the same algorithm, that we have agreed that it is a routine, and now I will replace the right routine, the same steps but arranged in another way. So let's consider Is the algorithm going to work with the first step "cross" then if a car is coming, look to the right Otherwise, look to the left obviously this solution will not solve my problem thus, this third option is not considered an Algorithm In this case, allowing us to not get hit by the car is a matter of logic when organizing the steps. So as you can see, algorithms really are in our everyday lives and even more than we can imagine.
Some other examples of routine that we perform day-to-day are: make a call using the phone, prepare a cake, make a withdrawal at the ATM, and even cancel our TV plan, and this last one, cancelling our TV plan, I consider the most difficult algorithm in the world! In this case I agree when people say that algorithm is a difficult thing. Cancel cable TV, it is virtually impossible!
Then from now and during all your studies in this course, whenever you are struggling to make an algorithm, remember: there are people trying to cancel TV plans, and that is something really hard to do. I guarantee you thinking this way, everything will become easier. Let us now bring this concept to the computers.
A computer program is developed to meet needs, that is, to solve problems. Let's look at a very simple example, Quadratic equations, and I'm sure that during your youth, when you learned Quadratic equations, you had to solve each using pencil and paper. Surely it crossed your mind the following situation: "Wow, if I had the computer here I would make him solve this problem for me.
" And that's exactly how the algorithms work! You have a problem, you know the standard to solve these problems, so instead of doing this manually, you build algorithms to solve everything for you. I created here a simple algorithm to solve a Quadratic equation, come with me and I'll show you.
This one is one of the tools that we will use in our course. Do not worry now because we see the operation of it later on. This one was the algorithm that I created to solve quadratic equations, and not be frightened by the code size, trust me, it is very simple to understand and very easy to recreate.
It is because now you do not know very well the tool and do not know very well Algorithms. But I am assuring you, you will be able to learn. Let's run this algorithm and you will see that this screen will appear with some basic information, such as: Quadratic equation.
Enter the value of A. If you remember well there are three variables in a quadratic equation: A, B and C. We are entering 2 as A, 5 as B and also 2 as C.
Pressing ENTER it will show me the equation which is 2x² + 5x + 2 = 0. It will calculate the value of Delta, which would be: b² - 4. a.
c, which will be 9 Since it is a positive Delta, we have two possible roots within the field of real numbers. In our case here, we get X' as -0. 50 and X'' as -2.
Of course you can solve it in hand, using pencil and paper but since we know the standard operating We know the quadratic formulas and everything we apply the algorithm to solve it for us. I just enter the values, press ENTER, and the calculation will be done automatically thanks to the algorithm that I built for you and going forward, we will build during our classes we will see another example, running the program again and putting a little different values, for example, 1 to A 2 for B and 3 to the C, and for these values of A, B and C we will have a negative Delta, and if you remember your math classes, for negative Delta there are no roots in the real numbers field, only in the Imaginary field. We will report it to our users, also using our algorithm.
Then for the values of 1, 2 and 3 we calculate. The equation is x² + 2x + 3 = 0 Delta is equal to -8 and a message will inform me Delta is negative, then there are no real roots. Let's go to a 3rd and last example, where Delta will be 0 One example for the delta 0, A is 1, B is 2 and C is also 1.
Pressing ENTER, we have Equation 1x² + 2x + 1 = 0. The delta value is equal to 0 and Delta values equal to 0, we have two real roots, in this case equal to -1 and it is exactly there that we'll start. You have to start learning the algorithms trying to create routines to solve small problems for example the next class we will create a routine to add 2 numbers and the following classes will increasingly difficult until you learn algorithm once and for all.
With this course, you will be able to develop your Logical Reasoning, organize the instructions, and get ready to build your first application within a computer, but that we will only continue in our next lesson because now our time is up already. I would ask you a huge favor, if you liked this lesson, show it to the largest number of people you know. Post it on Facebook, marks your friends, put it on their wall, share this video, give it a thumbs up if you're viewing it on YouTube, encourage our project.
This course aims to show programming for young people who are about to choose a career. Computer programming is one of the coolest jobs I know. If you enjoyed this video and want to be notified whenever a new class is out, click here on this button to sign up for our channel, Curso em Vídeo.
If you are already subscribed click the small gear next to Subscribe and you say you want to receive notifications in your emails. Here we only publish classes and good class. Clicking here you will have access to the playlist of all classes of this Algorithms course.
Every week is a new class, and the next, you will already have the package to download and some exercises to practice. It is a great pleasure to start this new adventure and especially with sponsorship of one of the companies that believe in our projects, Hostnet WebHost. We'll see you next class, a big hug, good studies and do not forget to share this idea.
[Extra moments of recording] Ah, new course, yay! [Thin voice] tucking my little hair [thin Voice] laughs Come on! Hello, all right, again!
Hello! Hello, A, a, a, . .
. Hello! Hello!