DEV Community

Dmytro Lobanov
Dmytro Lobanov

Posted on

3

CS50's Introduction to Computer Science - Week 0 / Notes

All courses: https://cs50.harvard.edu/

Week 0

Full notes: https://cs50.harvard.edu/x/2024/notes/0/

How do computers think?

Computers today count using a binary system. From the binary digit, we get a familiar term called bit (binary digit). A bit is a zero or one: on or off.

2^3  2^2  2^1  2^0
 8    4    2    1
Enter fullscreen mode Exit fullscreen mode

Computers generally use eight bits byte to represent a number. For example, 00000101 is the number 5 in binary. 11111111 represents the number 255.

For example, the letter A was decided to map to the number 65. 01000001 represents the number 65 in binary.

How do computers understand letters, colors, and music?

Just as numbers are binary patterns of ones and zeros, letters are represented using ones and zeros too!

For example, the letter A was decided to map to the number 65. 01000001 represents the number 65 in binary.

H   I   !
72  73  33
Enter fullscreen mode Exit fullscreen mode

Unicode standard expanded the number of bits that can be transmitted and understood by computers. Unicode includes not only special characters but emoji as well.

What is an algorithm and pseudocode?

An algorithm is a procedure used for solving a problem or performing a computation.
Pseudocode is a human-readable version of your code

Example of the pseudocode

1 Pick up a phone book
2 Open to the middle of the book
3 If the person on the page
4    Call person
5 Else if the person is earlier in the book
6    Open to the middle of left half of book
7    Go back to line 3
8 Else if the person is later in the book
9    Open to the middle of right half of book
10   Go back to line 3
11 Else 
12   Quit
Enter fullscreen mode Exit fullscreen mode

Pick up, Open, Call, and Quit are functions.
If, Else if are conditions.
the person is earlier in the book, if the person is later in the book are boolean expressions.
Go back to line 3 is a loop.


Useful links:
https://cs50.ai/chat - your AI duck tutor
https://cs50.dev/ - Visual Studio Code for CS50

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more