Friday, May 27, 2022

# What is Computer Science?

Computer science is typically thought of as becoming an expert programmer but it doesn't take many classes and undergrads to realize this isn't the entire story in this video I'm going to explain why this is the case and really just focus on what you will see in the undergraduate curriculum in computer science .

I'll include a few example problems and many real-world applications so you have an idea of what's to come now I think people get this idea of the major being all programming because computer science does involve more programming than pretty much any other major Computer Engineering and software engineering are the other two at the top of that list in .

No particular order but programming isn't just what it's about so let's start at the beginning of the curriculum which is about learning how to program this is probably what you are expecting to learn the command to write something to the screen which involves a print s command and C than your phrase you'll learn how to declare an integer that .

You'll use for your program which you could call anything you'll learn how you can assign that integer of value and multiply or add to that variable you also learn you need a semicolon after nearly every line as you can see here you'll learn how to do loops for example if you want to write the numbers 1 through 1,000 you could write print F .

For every number individually and take up an hour or two of time and by the way backslash n just means go to the next line or you could write a loop that starts at one increments by one after every loop and prints to the screen the number you're at then stops at 1,000 coding this is so many less steps than writing every number for those who have .

Never programmed before don't worry about what this means you'll learn it later just realize that you can print a thousand numbers with pretty much just these two lines of code you don't need much more and if you wanted to go to a million all you have to do is change this number so you can see how it's all the basics the syntax and just making .

Your program run properly but now let's move on to the classes you may not totally be expecting or just don't know much about the first is discrete math which has no lab component just math so for everyone asking do I need to be good at math or computer science the answer is yes but it's different kind of math and you're .

Probably used to I'll explain more on this later but I am going to go into a little depth on this class do you have an understanding of what's to come you're used to continuous math given a function of X X can be any value you have to know i graph it factor it solve for want to equal something or whatever discrete math is where the variables can .

Only assume discrete values typically denoted as n but not always and this class actually involves a lot of proofs and I'll show one real quick on probably your first week you could come across this problem prove that one plus two plus three all the way to N equals n times n plus one over two so let's see if this is true for N equals three we .

Get 1 plus 2 plus 3 which equals 6 then if we plug in 3 for n we get 3 times 4 divided by 2 which is also 6 so that checks out it works for N equals 2 and 1 as well but how do we prove it for all values well this involves proof by induction we know it works for N equals 2 and 3 normally you'd check for N equals zero .

First and now we're going to prove it for n plus 1 it works for 1 in this case so if it works for n plus 1 then it will work for all N so I'll write this out again now for n plus 1 we would say 1 plus 2 plus dot dot dot n plus n plus 1 equals n plus 1 times n plus 1 plus 1 divided by 2 .

You just plug in n plus 1 where there were n but here we see that 1 plus 2 all the way to n was what was given to us above so we can rewrite that then add on the n plus 1 and then I'm not going to simplify this because I'm sure you know how but these will equal each other and you have proved this to be true seems kind of weird but basically if you know .

This is true for N equals 0 or even N equals 1 then by proving it for n plus 1 is kind of like knocking over dominoes to to the next proving it for every next case for all n all the way to infinity is what you just did and you'll have to know how to do proofs with that technique now that you know this you .

Could prove something like 8 to the N minus 3 to the N is divisible by 5 so now you may be thinking why would I need to understand this kind of math well let's look at a different kind of example that applies a little to encryption how would you find the greatest common factor of 288 and 160 the biggest number that goes into both .

Of them well I would divide by 2 because they're both even and get two more numbers then those are both even so divide by 2 again and just keep going conveniently 2 works every time so we just multiply them at the end and see the greatest common factor is 32 but there's actually a faster method or algorithm to do this .

And most likely you haven't seen before so to find the greatest factor of the two you can find the remainder of dividing 288 by 160 which would just be their difference of 128 now you'd have to find the greatest common factor of that and 160 the smaller of the two numbers above then just do the same thing .

The remainder if you divided 160 by 128 is again their difference which is 32 then what's the greatest common factor of back and 128 if you divided those the remainders actually 0 it goes in perfectly and our smaller number is 32 and since we got down to 0 we know our greatest common factor is 32 so look at that we accomplished this in less steps .

Here than we did here and for bigger numbers the difference would be even more this kind of math allows computers to compute factors way faster so what does this have to do with encryption well if we have a word we want to encrypt like maybe you want to secretly send a friend a message we can change it into the numbers that represent its .

Place in the alphabet you then have to calculate some number to add on here which would make it prime so now we have a large prime number then you and your friend would exchange a secret key which is also a large prime number you multiply your prime number word by your prime number key so if someone intercepts the message and turns it into .

Letters it won't make sense but your friend would just divide the received message by the key and then translate it so why is this hard to crack if someone intercepted the message because computers have trouble factoring large numbers into two prime factors there isn't a fast algorithm so that's why factoring quickly and efficiently has .

Important applications now I do realize when it comes to encryption this method is wrong this isn't exactly how it's done there's a lot more to it and if you want more info there's plenty of videos out there but for this one I just wanted to give you the tiniest glimpse as to what's going on it never made sense to me when people said encryption has to do .

With large prime numbers so I wanted to just show that then you will come across graph theory and no not graphs like x squared or sine of X it's graphs that have a bunch of nodes or points and vertices that connect them this has a lot of applications in computer science because of how complicated connections can get think of how we are all .

Connected on Facebook for example two people actually use graph theory to become billionaires that I'll explain soon but first a basic example let's say we have five college classes so a really small school computer science one biology one chemistry one physics one and calculus one some computer science students are in the physics class some .

Others are in the bio class and some others are in the chem class then some bio students are in the chem class and some chem students are in the calculus class so kemon physics don't have any of the same students same with calc and bio and you get the idea now the question is how many times plots do we need for finals day so could .

We schedule one final time from I oh no maybe 9:00 a.m. to 11:00 a.m. no of course we can't because if there's a computer science final at time one and the bio final has to be at the same time those students who share both classes can't take both the finals so could we do it with two x plus one from nine to eleven and one from 11:00 .

A.m. to 1:00 p.m. if we gave computer science time one then bio would have to have time to but now chem would be out of what's because it shares with both those classes but turns out we can do it in three time slots if we make another time slot for you to give computer science time one bio time to chem time three then physics .

Could be time three because no one shares it with chem and calculus could be time one but imagine what this is like for a university with hundreds of classes and thousands of students it gets complicated what if we have five chess players a through E and player a can beat player B who can beat player see who beats player a then ebj and so .

On based on all these connections in who B to which player should be ranked to the best or what if we looked at the fifty states really only the 48 that border each other so like California borders Arizona Nevada and Oregon then those border other states and this would go on for a while how many colors do we need to color a map of the United States .

So that no two bordering states have the same color believe it or not this was proven to be four you've probably never noticed but the maps of the United States only need four colors so that no two bordering states have the same color which allows us to distinguish the states easily and lastly what if the world wide web contains four web sites .

All on the same subject and website a had a link on its site to B and C which kind of means hey these web sites are good check them out then be linked to D and a and so on which website should be ranked the best assuming they are all about the same topics well two guys studied this and create an algorithm for how to rank the site and call their .

Website Google so being good at graph theory can pay off quite well there's more to discrete math but I'm going to move on I think you get the point how these are discrete math problems like amount of websites classes factors of large numbers and so on this class will lead you into the design and analysis of algorithms I'll go over the .

Basics of this class and more in the next video

RELATED ARTICLES