Total Pageviews

Search This Blog

Friday, October 6, 2023

How to Understand Binary, Tree Diagrams, and Truth Tables

There are different ways of thinking about the number 2 in math, and some ways are more useful than others depending on the question.

For example, in computers, electricity is either flowing through a transistor or not, so there are only 2 possible states, usually written as 0 (off) and 1 (on). If you look at the power switch of most electronic devices, you will see a symbol that has a 1 inside of a 0. Here is an example of that:



Binary math works off of base 2 instead of base 10, also called decimal. In base 10, 341 is the same as
3*10^2 + 4*10^1 + 1*10^0. The same number in binary is written as 101010101, and it means:
1*2^8 + 0*2^7 + 1*2^6 + 0*2^5 + 1*2^4 + 0*2^3 + 1*2^2 + 0*2^1 + 1*2^0.

Another way of thinking about the number 2 is with something called a tree diagram. How many possibilities are there for flipping a coin 3 times? 




There are 2 possibilities for the first toss, and then from each of those two possibilities, and so on. In other words, with every coin toss, the total number of outcomes doubles. So for tossing a coin 3 times, there are 2^3 or 8 possible outcomes. This diagram also works for figuring out the odds of a woman giving birth to at least 2 girls if she gives birth to 3 children total. 

In logic, when we have a statement with two or more parts, if one part of the statement is false, the whole statement is false. This can be shown with a truth table. Let p and q be statements and let T and F stand for true and false respectively. 

p        q        p and q        p or q

T        T        T                 T

F        T        F                 T

T        F        F                 T

F        F        F                 F

There are logical operators besides "and" and "or", but these are the basics.  It's important to note that in logic, it is impossible for a statement and its opposite to be true at the same time. For example, it is impossible in a given time in place for it to be both raining and not raining. "And" statements can only be true if each part is true. For more information, read up on Boolean algebra. 

No comments: