Lecture 0 Flashcards

1
Q

What is Computer Science?

A

Problem solving. Taking an input, putting it through a system, and retrieving and desired output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Define unary counting.

A

With our fingers, where 1 finger represents 1 item.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is binary? What is a bit?

A

Binary is a two digit counting system used by computers. Each binary digit is a bit.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

If we have 3 light bulbs to represent binary digit, where light on is 1 and light off is 0, how high can we count?

A

If we consider that there are only 8 possible combinations of on and off given 3 bulbs, and we assume that all three in off represents 0, then the highest we can count is 7.

Lines up like:
2^2 // 2^1 // 2^0
# // # // #

With each slot (#) coinciding with incremental powers of 2

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Determine the number of possible combinations given a binary system and 3 decimal places.

A

The binary system requires we use 0 and 1 as the only digits. With three places to put two possibilities, the mathematical representation of this relationship is 2^3 possibilities, which is 8. Adding a new decimal place raises the power.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What about if we extended to 8 bulbs? How High could we count?

A

With eight bulbs, we calculate 2^8 as 256 possibilities. One of which is already defined as 0, leaving the highest possible digit as 255 if we only include positive integers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Only using bits, how can we represent letters in a computer?

A

Agree on a number (65) that coincides with a letter (A) and represent that number in binary (10000001).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is ASCII?

A

It’s an 8 bit system used to represent 255 characters on computer screens. Primarily used for English.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Unicode?

A

Extends beyond ASCII by using more bits to represent additional characters (chinese / letters with accents / emojis).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How are colors represented on a computer?

A

Each color is represented by three bytes (8 bits allowing for a range of 255) that correspond to amounts of RGB. So, (72,73,33) is a dark shade of yellow.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is an image represented on a computer.

A

Each three byte color is given a square of space to occupy on the screen -> a pixel. So, when you have a 31mb picture saved to your computer, the resolution of that image corresponds to the number of pixels in the image (# of pixels * 3 bytes per pixel = file size).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is an algorithm?

A

They are step-by-step instructions for solving problems.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what is the best solution (or algorithm) for finding your name in a phone book?

A

LOGARITHMIC ALGORITHM. Computation gives us logarithms (inverse function of exponents). In practice it can be summarized to: divide the number of pages by half and go there (if 1000 pages, go to page 500). Decide if the name is before or after page 500 and divide the remaining step by 2, decide if left or right of page 250 (or 750 if took right half). Even if out pages double, we only add 1 step (2000/2 = 1000, continue with above example).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly