The CS50 experience - Lecture 0

Learnings from the world class CS50x course

The CS50 experience - Lecture 0

Introduction:

What is Computer Science?

The study of computers and computational systems to solve real-life problems.

In simple words, it is Problem-Solving.

To get into computer science, we should develop computational thinking which can be achieved by understanding the core and basic principles of Computer Science that are beautifully explained in this course. I am sharing my learning from this course and how I am developing computational thinking by following this course.

Computational Thinking:

Computer Programming is about taking some input and creating some output via some logic - thus problem-solving.

d

The above picture shows the very basic and important concept of CS. The black box, we see in the picture is discussed in the whole course i.e, the main logic by which this computation is performed.

Now, the BIG question is how can we communicate with the computer? How can we make understand the logic to the computer so that it can perform tasks and gives us the desired output?

Let's understand the communication of the computer with an example:

Let's say, I want to buy a brand-new iPhone. So, I'll go to an iStore and ask the dealer about the latest iPhone, its features and most importantly its price. The dealer will give me the information I inquired about so that I can take the decision of buying an iPhone or not.

In this above example, I went and asked the dealer for info related to iPhone which is the INPUT then the dealer gives me all the information which is the PROCESSING the black box. Finally, I will decide whether to buy the iPhone or not which is OUTPUT. And why did this whole process is done so smoothly? Because I communicated (asked) with the dealer so that I can get my desired output.

Here the communication is done in ENGLISH Language which is understandable by humans but not computers. So, to communicate with computers we should do it in the way computers understand.

The Computer understands only 0's and 1's i.e, BINARY. So, to communicate with the computer and make the tasks done we should use BINARY. The concept of 0's and 1's can be explained by the ON and OFF of a bulb which is beautifully shown in the course. Here, 0 is OFF and 1 is ON.

Example: 000 = 0, 001 = 1, 100 = 4, etc

We have seen how numbers are represented in binary and can be communicated to a computer. Now, what about the different LETTERS & CHARACTERS? As we know, a computer only understands 0's and 1's that can be converted to a decimal number (as we have done in the above example).

LETTERS:

Some standard decimal numbers are assigned to the letters and characters so that it can be identified by the computer.

A - 65 - 01000001 | B - 66 - 01000010

This standardization of characters with a decimal number so that it can be understandable by the computer when it is converted to binary was developed by a committee of the American Standards Association (ASA), called the X3 committee. And this standardization is named as ASCII.

ASCII:

It stands for American Standard Code for Information Interchange.

The ASCII values for different characters are shown in the below chart:

If a send a message text message to a friend, then first the characters will refer to its corresponding ASCII Code, then that ASCII Code is converted to binary so that it is understandable by a computer.

Illustration

As time rolled on, many more ways of sending and expressing messages came into the picture which is not fulfilled by ASCII. So, a new system was introduced named UNICODE.

UNICODE:

To fulfilled the requirements which weren't met by ASCII, the UNICODE Standard came into the picture and it provided millions of code points. However, the first 128 of the Unicode are same as ASCII. All Modern Computers use UNICODE which has a mapping of many more numbers to many more letters/characters. More and more features are being added to the Unicode standard to represent further characters and emojis.

Unicode Standard consists of Emojis which is a new & modern way to communicate or express a message to another person and it also contains the code for different language letters & also special symbols like alpha(ɑ), gamma(ɣ), etc.

Above is a sample chart for UNICODE Standard.

Similarly, the colours are also represented in RGB value then it is converted into binary. So, when we talk about images, these are collections of RGB values. Then the videos are a collection of these images formed by RGB values. When we talk about music, it is represented through MIDI Data.

Algorithms:

In simple words, an algorithm is a step-by-step process to solve a particular problem. We can also say it is "A set of instructions" or an approach by which a problem is solved.

For example, If I want to find a phone number from a contact book that is in ascending order(A - Z) then I can find that contact in different ways, Let's say I want to find John, then probably I might go from starting by checking every page until I find John. But there can be a better way(algorithm) to find John's contact easily in less time, If I divide the contact book into 2 equal halves then according to the word I can decide where can I find John's contact ASAP, it might be left half or right half or even at the middle where you divided the book.

We have various algorithms in Computer Science to make our work easy such as Searching Algorithms like Linear Search & Binary Search and Sorting Algorithms like Merge Sort, Insertion Sort, Heap Sort, Bubble Sort, etc. We'll see more about these algorithms in upcoming blogs.

As there are various algorithms to solve a problem, what do you think about how we'll choose an algorithm? That's simple we choose algorithms basis on the time & space taken by the algorithm (which is called Time Complexity & Space Complexity) to perform the task and its requirements.

Here is an example graph from the CS50 lecture which represents time complexity:

Pseudocode:

Pseudocode is a way of expressing an idea to do programming. It is a form of code that is not specific to any programming language.

It is one of the important basic building blocks for programming, as pseudocode shows the ability of a person whether he/she has understood the problem statement or not. Once the pseudocode is written, a programmer can convert it into code of the required programming language.

Here is an example:

Intro to Programming using Scratch:

Scratch:

It is a web-based downloadable programming environment. It is developed by MIT. It utilizes the same building blocks as we discussed above. It is a great way to start the programming journey with ease and fun.

You can build games, short stories, quizzes, etc using scratch to build up your basic building blocks. It consists of sprites(characters), custom blocks, motion, events, sense, sounds, looks, variables, operators, etc which makes it fun and easy to understand.

It doesn't have heavy syntaxes, curly braces, semi-colons, etc which might feel difficult for beginners.

Below is the overview of the scratch environment:

We'll talk more about scratch in my upcoming blog, where I'll show how I build a Scratch Project. Stay Tuned...


You can watch the world-class video lecture by Sir David J Malan here:

You can enrol on the CS50x course by the link below on edX: https://www.edx.org/course/introduction-computer-science-harvardx-cs50x


By the quote below, I'll end my blog. See you next time in another blog :)

"Computer Science is a science of abstraction -creating the right model for a problem and devising the appropriate mechanizable techniques to solve it."

~ Alfred Aho

Make sure to follow me for the series of CS50 blogs and show lots of love to it. Comment down the takeaways & things you found interesting. Till then keep building and keep blogging see'ya :)

Credits: CS50x Harvard University Course and google.com for photos.

Connect with me on Twitter

Connect with me on LinkedIn

If you find my work interesting and if you want to support me then you can buy me a coffee :

Buy Me A Coffee

Happy Learning !!