Kk. I had trouble finding problems in the way you have them formatted.
Hmm. Do you mean broadly or, in this context, truth tables? I assume truth tables. Without looking it up: truth tables are tables showing all possible outputs of an expression from all possible inputs.
The problems I did so far were easy. Most of what I’ve done so far seems intuitive. The only looking up I did when I did the problems was what the notation stood for (~ being negation for example, though that one was easy to remember). I didn’t need to look up how the operators worked or anything or what they meant.
Formatting/notation isn’t important. Lots of options are fine. You can use what you prefer, and you can find problems with any notation.
Truth tables are useful when there are variables that could be true or false. If you evaluate an expression with 1’s and 0’s, no variables, then you don’t need a table.
Next you need the concept of defining logic operators in terms of other operators.
For example:
nand(x,y) = ?
Answer only using the following operators: not, and, or.
“in terms of other operators”. Hmm.
nand is an and operator and a not operator. not and. For an and operator to be true both operands need to be true. For a nand operator to be true they cannot be both true. Hmm. An AND operator is true only when both operands are true. A NAND operator is true when both operands differ (one true and one false) and when both operands are false. That would be the negation of an AND operator.
NAND:
False if both are true. True if both differ. True if both are false.
Hmm. We want to have create an expression that does the same thing as a NAND operator. So true when both operands differ and when both operands are false. An OR operator would be true when both are true. True if both differ. False if both are false.
OR: True if both are true. True if both differ. False if both are false.
NAND and OR seem to agree on being when both differ. They disagree on when both are true and when both are false.
A NOR gate?
NOR:
False if both are true. False if both differ. True if both are false.
NAND and NOR gates agree on being true when both are false and false when both are true.
NOR OR?
nor(or(x,y)). Hmm. I can create OR answers, but NOR needs two things to work on.
At this point I just started making a bunch of truth tables until one worked out. I got it under 30 minutes still. I got an answer 28 minutes in.
Answer: nand (x,y) = nor (and (x,y), and (x,y))
False if both are true. True if both differ. True if both are false. I just realized I kind of took it for granted that I understood the notation you were using. I’m unsure if I did it correctly now. Here’s the truth table:
Uhh no, I do not know how to simplify that or make it shorter given the notation I was using. Actually I wouldn’t know how to simplify it even in the notation I learned the material in.
A thought did occur to me were you looking for not(and (x,y))? Did I have to use or?
Hmm. They all have identical outputs. I assume theres something about the "(or (and (x,y), and (x,y))"part in “not(or (and (x,y), and (x,y)))” that can make it simpler into just “not (and (x,y))”.
I did think while doing it that whatever I come up with would be equivalent to not (and (x,y)). I just didn’t think that would be a satisfactory answer because it said you can use or and because the long time frame made it seem like this would take a bit time to think of and do.
For or(x,x) with identical inputs the output is the same as the input. Putting it into a statement: it will rain or it will rain. Its the same as only dealing with just it will rain and whether thats true or not.
For or(x,y) when x and y are both true or both false they have the same output as or (x,x). That makes sense. Since when both are true and when both are false they have the same input.
So or (x,y) is the same as or(x,x), or or(y,y), when the x and y represent the same thing.
Funnily enough (tbh I don’t know if funny is the right word) I was thinking of that article as I was doing the problems. I’ve read it a couple times. I’m gonna give it another read.
In general I’d say I do have a really bad problem of trying to figure out what the teacher wants. Its partially why I really hate school and especially any kind of writing/free-response assignments in school. They are so open-ended that I get extremely stressed trying to figure out what the teacher is looking for. I think I’ve dropped more classes due to the broadness of free-response assignments than anything else (why I really hate english class and essays). I think this is also, partially, why the only classes I’ve done consistently well in school is math.
After re-reading it:
Since verbal behavior (spoken or written) is what gets the gold star, students begin to think that verbal behavior has a truth-value.
Hmm. I’m sure there’s plenty of stuff I’ve learned in school that are just noises, or pictures in the case of writing, that are meant to satisfy teachers. However, I don’t think that has been my particular issue when going through school. I’ve never fully felt comfortable in saying words to satisfy a teacher. I’ve always tried to figure out what the stuff I’m saying means. I always felt like if I’m just repeating without understanding I’d be lying. “Surely the teacher will know that I don’t understand what I’m talking about.” This mentality has lead to a huge deal of stress because I typically end up trying to figure out too much, overreach, burn out, and quit.
I guess partially I have that mindset? I don’t try to necessarily find the vibrations to satisfy my teachers. In general, my experience through school has been that I’ve typically been the one to best understand a subject and connect it with my experiences compared to a lot of peers (and I think some teachers too). How often I put the effort in and enjoyed the material to do such a thing is different.
To reply to what you’ve said: yeah, I do think too much of what my teacher wants.
Yeah. So you see how the functions with 2 inputs become special cases when the inputs are the same?
They don’t have any more information available than when receiving 1 input, so they actually have to give the same outputs as one of the functions that takes only 1 input. There are only 4 binary functions of 1 input: one, zero, not, identity which correspond to the 4 possible truth tables for a function with 1 input (10, 11, 00, 01 are the only 4 options). (The one and zero functions don’t actually need any input because the output is the same regardless of the input.)
Make sense?
If so:
Next you can try to reinvent De Morgan’s two laws. They’re for converting between “and” and “or”.
Oh and if you understand then label which are which. For {or, and, xor, implies} label each one with one of {one, zero, not, identity} for how it behaves when given 2 of the same input.
Hmm. From the resources I’ve looked at so far I learned about four unary operations. Always true, always false, identity, and negation. I assume one is always true, zero is always false, not is negation, and identity is identity.
One is always true. One is implies.
Zero is always false. Zero is xor.
Identity is the same as the input. Hmmm. “or” and “and” seem to satisfy this.
Negation is the opposite of the input. Hmmm. Nothing seems to satisfy this.
Did I mess up somewhere?
or (x,x) if x is true. Then its true. If x is false. Its false.
and (x,x). If x is true. Then its true. If x is false. Its false.
Uhh. Hmm. Lets check the other ones:
xor(x,x). If x is true, then both are true. Not either or. False. If x is false, then both are false.
implies (x,x)
If x is true its true. If x is false its true.
I timed myself up to 60 minutes. It wasn’t a perfectly focused 60 minutes but regardless I was just making trying out random truth tables until I got one that worked. I mean I did try and think about it to an extent but most of my time was spent just trying random variations of “and” and “not” until I get a truth table like “or”. I failed. Didn’t attempt Law 2.
Hmmm. I guess there’s some background information I’m not understanding here. I thought all this made sense to me so far.
I don’t think most people ever reinvent the laws. I thought it was worth a try. Let’s try this next (there’s a chance it’s too hard but you did the same thing with nand so worth a try):
It turns out that {and, or, not} is a universal set of logic operators (this is closely related to stuff you may have heard about computational universality). You can construct all the other operators from them.
Assignment: Using {and, or, not}, construct xor, nor, implies and equality.
Max 60min.
PS This is standard logic. There are other types of logic (that you don’t need to know about) including reversible logic, where, given the outputs and the arrangement of operators used, you can figure out what the inputs were. Reversible logic is relevant to quantum computing and to computing with low energy usage.
Those two work as negation. Which makes sense since not and = nand and not or = nor. So when its just two inputs “and” and “or” work as the identity and nand and nor work as the negation.
Ok. So I got an answer today. I forgot that I could just negate the variable(?) itself. So I wanted to give it a quick try before dropping it. I spent like ~10 minutes. I saw that and(not(x),not(y)) gave me
and so I just did not on that whole thing and got:
.
Here’s the full table: