Lesson Note Taker
Fill in the blanks below during the binary presentation. You can visit our website here!^ Due to last minute deployment issues, may need to run a local server
- git clone https://github.com/TheoH32/Runtime_Terror.git
- run:
- bundle install
- bundle exec jekyll serve
Binary
- Binary is a base 2 number system.
- 0 represents off and 1 represents on
- A bit is the minimum unit of binary information stored in a computer system.
Boolean Expressions
- A boolean expression is a logical statement that is either TRUE or FALSE and compares data.
Truth Tables
- The logical operations shown in truth tables are and, or, not, and XOR.
# AND
5 > 3 and 5 == 3 + 2
5 < 3 and 5 == 5
5 == 5 or 5 != 5
5 < 3 or 5 != 5
age = 19
citizen = (True)
if age >= 18 and citizen:
print("You are eligible to vote.")
else:
print("You are not eligible to vote.")
I went to the refinery met this girl she a 1010 so finery it made me think about binary turns out she non binary
Binary Conversions
Binary to Decimal
- We can count in binary by using powers of 2.
- In binary, we read from right to left.
- 0111 has a value of 7.
Binary Search
- For a binary search, the list must be sorted.
- In a binary search, computers start at the middle (front,middle,end)/
- The number of steps required in a binary search follows the equation: log2(n)+1.
- Binary searches also work with a list of strings. We can sort them alphabetically.
- Binary searches can be represented in tree diagrams.
Hacks
You will NOT be awarded any points for sections that are INCOMPLETE
Note Taker
- Fill in all of the blanks above.
Lesson Quiz
- Complete the lesson quiz
- SCREENSHOT SCORE and paste it here (or paste screenshot with submission)
Binary Game
- Complete the Binary game and reach a minimum score of 10!
- SCREENSHOT SCORE and paste it here (or with submission)
Binary Search Questions
- Make a binary search tree of different the list [1,2,4,15,25,30,31]
- 31 / \ 25 30 / \ / \ 15 20 31 / \ / \ 4 18 27 / 2
- Put this list of strings in a order that can be used for binary search ["Donut”,"Cake”,"Soda”,"Banana”,"Fruit”]
- Here is the list in alphabetical order: ["Banana", "Cake", "Donut", "Fruit", "Soda"].
- Explain why Binary Search is more efficient than Sequential Search.
- Binary search is a more efficient algorithm than sequential search for finding a target value in a sorted list. Binary search works by repeatedly dividing the list in half until the target value is found. This means that binary search only needs to make a logarithmic number of comparisons, while sequential search needs to make a linear number of comparisons.
Extra Credit:
- Translate the binary number, 1001010, into octal (base 8). SHOW YOUR WORK AND EXPLAIN YOUR THINKING. OR
- write the best rap line (determined during the lesson by group)
Octal is a number system that is based on the number 8, using the digits 0 to 7. In contrast, binary is a number system based on the number 2, using only the digits 0 and 1. To convert a binary number to octal, we can split the binary digits into groups of three digits each, starting from the right. Next, we can replace each group of three binary digits with the corresponding octal digit.
Here are the steps to convert a binary number to octal:
Start with a binary number, for example: 1001010. Group the binary digits into groups of three, starting from the right: 1 001 010. Replace each group of three binary digits with the corresponding octal digit: 1 1 2. Write the resulting octal digits together to get the octal equivalent of the binary number: 112. Therefore, to convert a binary number to octal, we need to group the binary digits into sets of three, then replace each set with the corresponding octal digit. This process helps us to quickly convert between binary and octal representations.
I went to the refinery met this girl she a 1010 so finery it made me think about binary turns out she non binary
Hacks Scoring
Hack | Comments | Grade |
---|---|---|
Note Taker | fill in the blanks above | 0.1 |
Lesson Quiz | under 100% = 0.1 only | 0.2 |
Binary Game | must score at least 10 points | 0.2 |
Binary Conversions Practice | if incorrect= 0.2 awarded | 0.2 |
Binary Search Questions | if incorrect= 0.2 awarded | 0.2 |
Extra Credit | MUST SHOW WORK | 0.1 |
Total | expected= 0.9/1 | 1/1 |