The Computer Science Iceberg Explained (Part 1)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Yeah, I’ve heard that video should be pretty good

👍︎︎ 2 👤︎︎ u/QuablYT 📅︎︎ Mar 10 2022 🗫︎ replies

Are you going to finish this? If not I would like to give it a go.

👍︎︎ 1 👤︎︎ u/Simsimma76 📅︎︎ Sep 08 2022 🗫︎ replies
Captions
computers what are they how do they work and if computers are so good why has there been a sequel to them yet today i will be explaining all those questions and more through a format called the iceberg charts if you've never heard of that format before don't worry it's really simple it's an image of an iceberg with all the topics i'll be going through in this video the lower we go the more obscure and complex the topics will be this is the computer science iceberg explained [Music] okay i'm not gonna waste your time too much you probably already know what a website is but unless you've done your research you might not know how your computer retrieves them so let me tell you first you have your browser this is a program that does all the technical stuff for you so that you only have to tell it where to go on your computer it's probably google chrome or safari maybe firefox whatever they all do the same thing let's say you want to go to google.com it's a bit of a small website i don't know if you heard of it before on its own the domain name doesn't really say anything about where the website is instead your computer needs to find the ip address to do that your browser takes your request for google.com or whatever other website you are going to and goes to your local dns server dns server then takes your request for google.com finds whatever ip address matches the domain and sends it back to your computer when i say computer i also mean phones and any other device of the browser now that your browser knows the ip address of the server it wants to access it now knows where the server hosting the website is more specifically the browser can now ask your internet service provider to connect you to the server with the ip address your browser then establishes a connection with the server that hosts the website yo what's good hey not much what about you all right all right all right hey can i get those files oh of course here you go all right thanks have a great day all right you too okay your browser now has all the files it needs to display the website and now comes the part where your computer needs to work a little since it has to go through every single file it has just gotten from the website to figure out exactly how the website should look the first file is the html file this is just relatively simple information about what to display like text or buttons or forms or whatever then there's the css which is used to describe the side of the website like what color the text should be or how large the button should be etc and then maybe there's a javascript file that contains some code that your browser should run oh there i'm done you happy finally after all those steps the website loads and you can now see and use the websites and of course as soon as you access a different page the entire process repeats again more or less anyway in practice a lot of different methods like caching have been invented to make this process a lot faster and easier if you've ever been on the internet there's a very high chance you've been offered some cookies but what the hell is a cookie what are they used for and why can't i eat them in short cookies are a small file that websites can give to the client typically used to store some sort of information that is personal to the user so for example say you're logged into a website like youtube you know the video streaming platform i don't know if you've heard of it anyway when you click on a video your browser sends a request for that specific page of youtube.com and so the website won't really know who you are to fix this websites typically use what is called a session cookie which acts as a form of single use password for that session to identify the user if it weren't for these cookies you would have to log in every single time you did anything on a website but cookies can be used for many other things like storing your settings and preferences but also very often used for tracking the user's behavior and is often sold off to companies who use them to among other things personalize the advertisements so perhaps more realistically when you access our websites yo what's up hello what can i do for you to oh what's up epicgamer294 long time no see i was literally here 2.3 seconds ago anyway do you got the file oh yeah sure here you go okay what is this just a few cookies nothing a few are you absolutely favorite background color number of times i've visited what make sure to bring every one of them back please just so we can all of them even tracking cookie number 29 i mean what do you even do with this don't worry we don't sell your data to anyone why do we use it ourselves the term indexed web is used to describe the part of the internet that you can access using a standard search engine like google.com the deep web is all the stuff that can't be found using google files like that email you accidentally sent to early can't be found by searching on google they are somewhere on some server that file is a part of the deep web how does a computer compute i mean we took some sand put some electricity through it and now it runs minecraft magic okay that's not true let's have a look at the part of the computer that does the work the cpu if we zoom all the way in we see these this is a transistor pretty cool right no not really not in its own anyway a transistor functions a bit like a switch on or off one or zero if you combine some of them you can create logic gates these things are the lowest level of the cpu hierarchy if you combine some of these gates you can start to do basic math like adding or subtracting numbers together or comparing numbers these things are called instruction sets and are built into the cpu so now we have some sand that can respond to the electricity we put into it now all we need is a system to figure out how we send and receive these instructions and before we know it we now have a system that can do maths i guess so really all that just to do maths right well okay you have to understand that all software is just a bunch of math instructions for the cpu let me just continue okay it'll all make sense just yeah okay sure just go okay so we add a system that can control where the input and outputs our cpu goes and then we add some memory to the cpu you know some ram so that we can store what instructions to execute and when finally let's create a language for these instructions and boom a computer finally now that we have a computer and a set of executable instructions to go with it we can start to write minecraft no no god no no coding stuff like that and machine code is practically impossible i mean look good luck coding minecraft like this no to make it easier to occur with some smart people have invented what we call an assembly language which turns this into something more human readable this allows us to code minecraft no well i mean technically yes it is possible to code complex programs and assembly languages but in the case of minecraft it's actually made in java basically most software is written in languages like c java python or any of the other millions of languages out there which builds upon assembly languages in various ways to abstract a lot of the work of programming which makes it a lot easier and faster as a code and there you have it keep in mind that this is a simplified version of how it works okay this is this is more complex in real life good good let's proceed this number this number was randomly generated by my computer but how i mean inherently computers follow precise instructions how could something that's made to do exactly what it's told produce something random well the short answer is that it can't not in its own anyway the long answer is that it depends on your interpretation of quantum mechanics so how do computers create random numbers then well let's have a look we can't just create an algorithm to generate a number from nothing so we need some sort of input it honestly doesn't really matter what we use as input so some computers just use the time as input which works fine somehow this input needs to be turned into a completely different number most random number generators use some variation of the middle square method where you take your input square it and then remove some of the digits then you take this number and repeat the process a couple of times in practice this method has its problems what you might have realized is that this isn't technically random if you run it again with the exact same input it would output the same results this method of using some input to generate a seemingly random number it's not random but pseudo-random basically meaning that for all intents and purposes it's random enough so that you can't really predict the output if you don't know the input and the algorithm but it's still not truly random is it if you want true randomness we need some part of our generator to be actually truly random we obviously can't have a randomized algorithm since computers undergo this peculiar phenomenon called following instructions and doing exactly what they're told so instead if you want true random we need the input to be truly random getting a random input is quite difficult though because defining the word random is quite difficult websites like random. measure atmospheric noise to get random input [Music] let's say you're a developer coding your website you're making a sign up feature so that users can make an account easy no problem barely an inconvenience take the password and the email of the user signing up installed in the database so that the next time the user wants to log in they can just provide both of those and get access to their accounts right no stop it what are you doing is this the 90s have you lost your marbles never ever just put the passwords in the database without hashing it first you're absolute so what is hashing i'm glad you asked right now if someone gets access to your database they can see all of the passwords and emails of every single user on your website that is not good what we do here in the post stone age world is that we take the passwords and run it through a one-way function that obfuscates the input turning it into something completely new this is called hashing here's the trick because this function is irreversible i'll get to that concept in a second even if someone hacks your website and has complete access to the database they won't be able to just retrieve the passwords of every user on your site they will be obfuscated and impossible to decode unless your brute force your way through every combination well mostly anyway now when someone logs into your site they'll insert their password the password will be hashed and the hash will be compared with the hash that was saved in the database fascinating right so how does it work how do we create irreversible one-way algorithms well there are many different hash functions out there that all work in different ways but the one that is perhaps used the most nowadays is sha which stands for secure hash algorithm quite possibly the most generic name you give a hashing algorithm but i digress now of course i'm not going to explain how sha works because that would be way too complex and psych i'm going to do it anyway let's do some random text as an example okay thanks step one take your input convert it to binary step two keep adding zeros until it's the nearest multiple of 512 bits but reserve 64 bits step 3 use the 64 reserved bits to describe the length of the message step 4 separate your data into chunks of 512 bits step 5 separate your chunk into portions of 32 bits we call these portions words and you currently have 16 words but you need 64 words 48 more words which is why we need six use your existing words and some wiki rotational function to create 48 more words time for the main hash function this is what the magic happens step 7 find the square roots of the first few prime numbers step eight take the fractional parts of them and multiply them by two to the power of 32 step nine convert them to binary step 10 use some wacky compression algorithm to smush the square primes with the word step 11 you now have a set of 16 hash words convert them to hexadecimal add them together and boom you're done it couldn't be easier and also i probably just lost 90 of my audience there but whatever at least i still got you right right hello anyone watching this though [Music] data storage pretty important part of computers and just information technology in general so let's have a look at how data is stored shall we one of the first ways to store data servers on paper but okay that isn't computer science so we'll just fast forward a few thousand years to the early slash mid 19th century okay this fellow by the name of charles babbage had the idea to use paper with holes in it called punch cards for his new and fancy mechanical computer creatively called the barrage engine punched cards had actually already been used in looms in the beginning of the 18th century and okay you know what i'm not gonna explain looms okay back to damage these punched cards though originally used for looms and then by babbage in his computers would actually remain as the dominant way of storing data for computers even after the invention of electronic computers though after the electronic computers became more popular magnetic tapes started to replace punched cards but in the years to follow many different technologies would be invented for storing data shortly after magnetic tape was used in computers magnetic disks were invented and are still very commonly used to this day because they have continued to improve since their invention you probably have a magnetic disk hard drive in your device right now but how does a magnetic disk hard drive work exactly i mean how do you store cat images and a round disk of metal well inside the hard drive there's a stack of metal disks called platters each of these platters is plated with a thin film of magnetic material divided into billions of really tiny areas and i do mean tiny here each of these areas can be in one of two magnetic alignments corresponding to either a one or a zero binary the disk is then rotated a few thousand rounds per minute and right above it is a reading right here that can read and change the magnetic alignments of the different areas and again i do mean right above it's literally about five to seven nanometers above the disk [Music] let's say you have a computer capable of doing maths and you want to render a 3d object like a sphere how do you do it well the answer is math so it shouldn't be a surprise when i keep up how do you approach such a problem well we can start by copying the real world we can simulate every light beam emanating from a light and see where it hits just like how light works in real life and that works but the amount of time that would take to render is just absolutely staggering what we can do instead is go the other way instead of simulating beams of light emanating from a light source go through each pixel of the camera and simulate a beam of light going from it seeing if it hits a light source this is ray tracing you might be surprised to hear that this technique was first invented on paper in 1968 and was among the first computer rendering techniques invented but it was only in 1928 with this technique which was named raycasting began to be used and experimented with seriously this image here was made in 1979 by scott roth but as i said earlier ray tracing is very resource intensive and so if you wanted to render something quickly or if you just didn't have a super computer you were going to have to find some other way to render a 3d object and so a few other techniques came about so basically simulate the way light works without all those fancy expensive tracings before i continue let me just tell you about how 3d objects are defined at its core every 3d object is just made of a bunch of polygons sometimes triangles but it can also be what are called quads it depends on what we are doing this is done to break down complex 3d shapes into very simple geometric shapes that we can use to do maths on so actually when we make a 3d sphere on a computer we really just get a bunch of triangles and put them together in the shape of a sphere got it okay back to rendering what we can do is that we can go to each triangle and then calculate its lightning level depending on where it is compared to the light the issue with this is that well this sphere looks kind of fractured doesn't it it's not smooth this is flat shading you can very clearly see the differences in lighting between each triangle what we can do to fix this is that we can take each triangle in our 3d object take the three corners of the given triangle and calculate their own levels of lightning so that we can blend these three values across the triangle if that makes sense so now rather than having one triangle with one flat color we now have a triangle that is pretty much like a gradient so let's apply this to our sphere and wow that's a lot better in fact you might not even have noticed that this is just a bunch of triangles if it weren't for the fact that you can see it on the edges anyway this technique of shading was first invented in 1971 by henry gr this technique of interpolating color values was developed upon further and new shading methods like phong shading were invented in 1973. in the years to come these shading techniques would become more complicated and allow for a lot more things than just color and brightness but while the first instances of 3d rendering might have happened in the early 70s it would take a while before we saw the first 3d being used in media like animated movies or video games mostly because of the whole most people don't have a supercomputer thing in the beginning of the 80s though there were a few simple 3d arcade games like battlezone but real 3d in video games wasn't really used and explored until the 90s once again because of the whole most people don't have a supercomputer you get it in the 1990s there were a few experiments with real-time 3d rendering in video games the most popular of these was perhaps wolfenstein 3d which worked by using the raycasting we talked about earlier well 2d ray casting basically rather than tracing array for every pixel on the screen in two dimensions you would only trace array for every pixel in one dimension say you have a wall distance between the wall and the camera for every given array would determine the height of the line of pixels like this this gives a fascinating illusion of 3d and this is also how doom worked albeit it was a bit more complicated a few years later in 1992 real polygon based 3d rendering would appear for arcade games and a few years later consoles with 3d focused hardware like the playstation and the nintendo 64 started to hit the shelves simultaneously video games like quake in 1996 would also popularize 3d games with a computer today we started to use ray tracing for real-time applications like video games as we now finally have enough computational resources to run this equation multiple times per pixel for every pixel on your screen multiple times a second machine learning one of those hot buzzwords like big data and blockchain but what is it let's say you want to make a program that can analyze images to find out if there's a smiley face on them or something what you can do is that you can write an algorithm that analyzes an image for the exact things that make up a smiley like detecting a face looking from mouth and so on the issue with this approach is that it's extremely hard to write a program that can reliably detect any smiley face on an image what if the smiley face is in a 3d perspective so the proportions are changed or if it's on the edge of an image and your program doesn't know where to look when you look at an image you can easily tell that this is a smiley face and that this isn't it's hard to tell exactly what a smiley face is to a computer but you know it when you see it this is where machine learning comes in rather than having to figure out exactly what defines a smiley face yourself you give your computer a bunch of images of things that are smiley faces and things that aren't smiley faces your computer then goes through each image tries to analyze it and makes a guess as to which images contain smiley faces and which ones don't at first it'll guess correctly about 50 of the time as it gets pretty much randomly but eventually it might start to find the right patterns and increase its success rate i want to note that i just described one specific type of machine learning machine learning has many different forms and just refers to when a machine learns anyway the uses of machine learning go beyond looking at images of smiley faces obviously i mean say you're a company and you want to maximize the amount of time your user spends on your app what if you want to create a self-navigating self-driving car all these problems and many more would be incredibly hard to solve by manually making the algorithms but as long as there is some pattern that can be analyzed or some other similarity between the things you're looking for you can apply machine learning you've probably heard that computers use binary for everything right but how is binary these zeros and ones used to store text and numbers and images and videos and everything else at the same time to give a short answer every type of data text numbers whatever has its own set of rules for how the bits are supposed to be used some data types are quite simple like the boolean which only has two values true or false then there's the integer which is also somewhat simple basically the numbers we are used to in the real world are on base 10 which means that we have 10 different digits we can combine computers use binary which is base 2 without only 2 digits let's take a random binary number as an example how it works is that the value of the first bit is 1 the value of the second bit is 2 then 4 8 16 32 64 128 and so on the values of all the placements of the ones are added together and from that we can derive the value in base 10. if you want to save text you can use the string data type essentially every character is given a number values for example the character uppercase q could be this in binary which is actually just the number 81. some encodings like utf-8 support many different characters including things like emojis you're using napster to download britney spears's baby one more time or playing quite three and half life or something the year is 1999 and the date is december 31st you and your friends are looking at the time because soon your clock will go from this to well that's the question isn't it apparently o'clock is just displaying the last two digits of the current year that is 99 but what will happen when the year becomes 2000 will the clock think that we're in the year 1900 okay but who cares about your clock what will happen to everything else what will happen to computers and what about airplanes and satellites will they just adjust themselves using data from the year 1900 that was the year 2k problem now luckily nothing major really happened on new year's eve 1999 mostly because a lot of resources have been invested to prevent yet uk from becoming a problem actually somewhere between 150 to 225 billion us dollars were allegedly spent on averting year 2k in the us alone and though many remember it as the disaster that never happened we shouldn't forget the amount of work that was done on checking out the tons of 20-year-old computer systems [Music] you are using mlinga to download musicguy23's new hit single or playing minecraft 2 or something the year is 20-38 and the date is january 19th you and your friends are looking at the time because okay this is confusing let's just go back in time so today quite a few computer systems keep track of the time by using a signed 32-bit integer that represents the number of seconds that have passed since january 1st 1970 called the 32-bit unix time format what does that mean well you remember how i explained integers before right yeah so the number of bits we use to store an integer is predetermined this means that for every integer there's a maximum value we can store in the case of 32-bit integers if the first bit is used to determine whether the integer is positive or negative the maximum number it can store is 2 to the power of 31 or numerically 2 billion 147 million 483 and 648 now you might already be piecing this together but basically at some point about this many seconds will have passed since the year 1970 and we won't be able to store a higher date using 32-bit unix time this will happen on january 19th 2038 and there you have it the year 2038 problem so what is going to happen well i mean we don't know the 32-bit unix time format isn't used that often in most newer systems and we have about 16 years to check on the systems we use today but a lot of software updating and system checking will have to be done if you want to be completely safe and that's it for part one thanks for sticking around if you like the video good for you i'd like to thank koda the creator of icebergcharts.com for coming up with some of these entries uh sorry for the lack of uploads these last few months i wish i had a good excuse but to be completely honest i was just lazy my next video will probably be something that won't take as long to make so be on the lookout for that maybe also join my discord server if you'd like
Info
Channel: Quabl
Views: 493,423
Rating: undefined out of 5
Keywords: Quabl, Computer Science, Computer science iceberg, computer science iceberg chart, computer science iceberg explained
Id: H565avw-ufk
Channel Id: undefined
Length: 24min 18sec (1458 seconds)
Published: Sun Feb 06 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.