[CS50] Week 0 Review
Week 0
Lecture Contents
- What is Computer Science?
Computer Programming is taking some input and creating some output : solving a problem.
input -> |
black box | -> output |
* the black box is the focus
2. Unary vs Binary - how to present NUMBERS
- Unary : one finger at a time (one, two, three, four...)
- Binary : a number system based only on the numerals 0 and 1
ex) 0 = 00000000 5 = 00000101
1 = 00000001 6 = 00000110
2 = 00000010 7 = 00000111
3 = 00000011 8 needs more bits(meaning binary digits) = 00001000
4 = 00000100
=> Computers use 'base-2' form to count.
... 2^3 2^2 2^1 2^0
... 8 4 2 1
-Computers usually use 8 digits to count numbers.
ex) 11111111= 255
3. ASCII - how to present LETTERS
We use ASCII because of an overlap of the zeros and ones that represent numbers and letters.
The map of ASCII values was created to map specific letters to specific numbers.
ex) to say HI!
-> H I !
72 73 33
= 01001000 01001001 00100001
4. Unicode - how to present EMOJI
Unicode expanded the number of bits that can be transmitted and understood by computers.
-Unicode for thumbs up 👍🏻 :
U+1F44D
-Unicode for the same thumbs up, but with a different skin tone 👍🏼 :
U+1F44D U+1F3FD
5. RGB Representation - how to present COLORS
RGB (red, green, and blue) is a combination of three numbers.
red 72 |
green 73 |
blue 33 |
-> 72/73/33 was HI! in letters, but it represents this color in RGB representation.
6. How to present IMAGES, VIDEOS, and MUSIC
-images : collections of RGB values
-videos : sequences of many images
-music : can be represented through MIDI data
7. Algorithms
Problem solving is central to computer programming. ★
Q. How to locate a single name in a phonebook?
a. simply read from page one to the next to the next until reaching the last page
b. search two pages at a time
c. go to the middle of the phone book and ask, “Is the name I am looking for to the left or to the right?” Then, repeat
this process, cutting the problem in half and half and half.
-> each of these is algorithm
( red : a / yellow : b / green : c )
8. Pseudocode
Pseudocode is a human-readable version of your code. It is important for 2 reasons.
1. It allows you to think through the logic of your problem in advance.
2. You can later provide this information to others that are seeking to understand your coding decisions and how your
code works.
Composition of Pseudocode :
- functions
- conditionals
- boolean expressions (true/ false)
- loops
9. Artificial Intelligence
What if there are thousands of possible interactions? Do we need to write tons of pseudocodes?
-> NO!
-LLM (Large Language Model) : a type of AI program that can recognize and generate text, among other texts.
10. Scratch
Scratch is a coding language with a simple visual interface.
It looks like this :
What I learned
I've never seriously learned about computer science or computer programming except one C# class I took in Korea.
When I was in that class, I thought computer programming is all about difficult pseudocodes, signs, numbers, ... etc because that's all I had learned from it. However, I realized that what I learned is just the tip of the iceberg. What really matters is that computer programming actually helps me think and figure out more deeply to solve problems when we face them. I've learned it while solving Problem Set 0 -which is your assignment for week 0- using Scratch, but I'll talk about it more in detail in the next post about my Problem Set 0. The professor is a lot more passionate about what they study and teach, what they say is easy to hear and understand. Also there is an AI dog professor as well. (He's so cute. I don't remember his name but I'm super impressed by the intelligence he has and how well he was made.) I'm really looking forward to the next week's lecture!