Following Along Async Tutoring [Dface]

I treed the rest of the expressions in @Eternity 's post. The file with the expressions is called Practice Trees.pdf
Tree #1:


Looks like we got the same answer

Tree #2:
or(or(or(and(and(x,y),~z), and(and (~x,y), z)),and(and(x,~y),z)), or(or(and(and(x,~y), ~z)),and(and (~x,y), ~z)),and(and (~x,~y), z)):

We got different answers and I think it’s cuz an end parenthesis is in the wrong place. I got the same answer after moving them:


The answer:

Tree #3:
((x∧~y∧~z)∨(~x∧y∧~z)∨(~x∧~y∧z))∨(x∧y∧z)

Tree #4:


Same answer

I had trouble making the trees at first but after thinking of a method to do them it got easier. It just took some practice to learn and it was good.

This is an assignment for describing the implies operator using English:

For an implies truth table I want x being true and y being true to be true. I want x being false and y being false to be true and I want x being false and y being true to be true. The only thing I don’t want to be true is that x is true and y is false.

That way it looks like the implies truth table. The output of (1,0) is 0.

I was thinking about making implies operator this morning and found that for the rows I want a T output, I didn’t have to make an operator for them. What worked is just thinking about what I can’t have true in an implies table. That’s the x being true and y being false.

The way I described the operator is: I can’t have both x be true and y be false. Here’s the operator: not(and(x,not(y)))

Truth table:

Expression:
and(x,not(y))

x y and(x,not(y))
1 1 0
1 0 1
0 1 0
0 0 0

I was answering with expressions for all the rows of the table til i remembered this:

One expression is enough

Or(and(x,y), and(x,not(y)))

x y Or(and(x,y), and(x,not(y)))
1 1 1
1 0 1
0 1 0
0 0 0

Or(and(x,y), and(not(x),y), and(not(x),not(y)))

x y Or(and(x,y), and(not(x),y), and(not(x),not(y)))
1 1 1
1 0 0
0 1 1
0 0 1

Yeah use and, or, not to express a row with a true output. If there’s more than one expression combine them with OR. I think u can express a false output if u wanted instead.

In order to make an expression for any truth table, you gotta have your truth table out first. This is the one we’re going to use as an example:


The first step is to choose if you want to express all the false outputs or true outputs. Each false or true output means one expression that we have to make. For our table above we’ll choose true. That means we only have to make two expressions

Next step is using the “and” operator to make an expression for each true row. Your working expression has to return the value true when you plug in the two inputs of that row. For our example, I’ll do row two: and(x,not(y)). This returns the value true.

Next step is if we made more than one expression, we gotta combine them with the “or” operator. This will give us a working expression for the whole table. For our table above, I made the two expressions and(x,not(y)) & and(not(x),y). Them combined looks like this: or(and(x,not(y)), and(not(x),y).

The last step is to check if the expression is correct. Go through the truth table and plug in the inputs of each row. If you get the same outputs as the table then your expression is correct.

edit: for “or(and(x,not(y)), and(not(x),y)” im missing one more paranthesis at the end of the expression. Should look like this: or(and(x,not(y)), and(not(x),y))

For xor(x,y) I can write the expression: or(F, and(x,not(y)), and(not(x),y), F)

Ok so I cant use expressions like T or F in this activity. How do i construct T or F like i did with other operators? My answer is gonna have “and” or “not” or “or”.

So for T I gotta make an expression that works like it? T makes the desired row true and all other rows false.

For F , the expression will make the desired row false and all other rows false.

For all possible values a variable can have that means:
x,y
1,1
1,0
0,1
0,0

F would make all rows false. All I would need to do is make an expression for one row and negate it.

I actually came up with this:
and(not(x),not(y), y)= F

I read ahead and see maybe the expression T means all rows are true?
I would write: or(x,y,not(x)) = T

I read ahead and I see i was close:

I didnt have to include a second variable. I think it’s just like the expressions T and F. They dont have to include x or y i think

Edit:I included the wrong quote at the end. It was supposed to be this:

Tree #1:


or(x, and(or(y,x),and(y,y)), or(not(x)))

Tree #2:

xor(x,and(or(not(x),and(y,y)),implies(x,y)),nand(and(nand(x,x),y),y))

Tree #3:


implies(xor(implies(x,y),y),and(nor(and(x,x),nand(y,y)),y),nor(nor(nor(nor(x,x),y),y),implies(x,y)), nand(x,x,x,x))

Tree #4:

nand(nand(nand(nand(x,x),y),x),xor(xor(xor(x,y),y), x),and(and(and(y,x),x),y),or(or(or(or(y,y),x),y),x))

Here’s some expressions using infix notation:
Tree #1:


I don’t know if i have to use the symbols between variables or if I can just write out “not”, “or”,“and”, “nor”

Tree #2:

Tree #3: