printf(‘Introduction to Computer Science’);

Nur Younis
3 min readMar 26, 2021

--

All the content showcased in this article is derived from the CS50 Harvard University Course taught by David J. Malan.

INTRODUCTION TO COMPUTER SCIENCE.

While human language is based on letters, words, and sentences, computers understand what we call the ‘binary’ or ‘machine language’ — that is, formed by 0s and 1s.

But where do all these numbers go?

Well, they are stored in the CPU (Central Processing Unit)of our computer systems through transistors.

As David J. Malan showcased in his lecture, we can think of these transistors as switches that turn on and off in order to represent 1s and 0s respectively.

Counting in Binary: 0 (left), 1 (right)
Counting in Binary: 2 (left), 3 (right)

However, if we were to get another bit — or switch — we would be able to count further. With 3 switches we are able to represent 2 values per bit. In the case above. Malan explains that we can look at these bits as 3 columns where powers of 2 are represented from left to right.

We just have 0s or 1s — on or off. In the example below we are representing the number 7.

In a nutshell, we have bits that allow us to represent numbers that can be associated to letters. This is the magic behind your emailing system!

How does our computer know what to do?

Algorithms can be simply defined as a set of instructions that tell the computer what to do — or how to solve a certain problem.

Pseudocode & algorithmic thinking.

The following quotes and information has been retrieved from a TEDed Video.

Pseudocode is ‘english-like sintax that resembles a programming language’

For example, to count the people in a room:

  1. Set N=0
  2. For each person in room

2.1 Set N=N+1

Don’t you think this is inefficient? we could count more people at a time. If we were to translate this to pseudocode, we would change step 2 to ‘for each pair of people in room’ and change step 2.1 to ‘Set N=N+2’. As the TED video pointed out, if there were 3 people in the room, then the algorithm would ocunt 2 because there is just one PAIR. The final code would then be as follows:

  1. Let N=0
  2. For each pair of people in room

2. 1 Set N=N+2

3. If person remains then

3.1 Set N=N+1

Upcoming second lecture…

--

--

Nur Younis
Nur Younis

Written by Nur Younis

Where curious minds interested in the intersection of finance, technology, and sustainability meet.

No responses yet