A list of puns related to "De Morgan's Laws"
It's a helpful law to shorten by a bit your booleanic expressions.
De Morgan's Law:
Given two statements A, B we can say the following -
(not A) and (not B) = not (A or B)
(not A) or (not B) = not (A and B)
Before the story I need to mention that I have yet to take a proper programming course, I learned through online videos and trial and error.
I was doing some boolean comparisons and my code started getting messy. I was basically doing "not A and not B" and wondered if I could take the not outside and have the same result. I drew a quick truth table and tested "not (A and B)". The result was not the same, but I saw a pattern and something told me to change the "and" to an "or". I did and it was a perfect match. Happy with my discovery I sent this to a friend who actually just finished studying CS in a university and he wrote to me: "Classic De Morgan's" and I was like WHAT?
He told me someone already discovered it a two hundred years ago and was surprised I discovered that by mistake. He knew of it through a course he took related to boolean algebra and said it's a very basic thing. We laughed about it saying that if I were a mathematician in 1800 I would be revolutionary.
To prove (A U B)β = A' β© B', for A' β© B' my book explains,
βSuppose x β Aβ β© Bβ, meaning that xβ Aβ and x β Bβ. Since x β Aβ we know x β A, and similarly x β B. This means that x β A U B, so x β (A U B)β as required.β
This is the part were Iβm confused:
It says x β Aβ, and part of B is the complement of A, how is it that x is excluded from B?
Hopefully my question is worded properly haha.
It can improve the readability of your code a lot.
Here are some examples from me, if you have any share it with us :)
not (A and B) == (not A) or (not B)
not (A or B) == (not A) and (not B)
!(a < 10) && !(b <= 5) == (a >= 10) && (b > 5)
!(a > b || b != a) == (a <= b && b == a)
(!A && !B && !C) == !(A || B || C)
(!A || !B || !C) == !(A && B && C)
https://imgur.com/a/mpHQTYY
I'm really having a tough time trying to figure out how all you need is De Morgan's Law to get from step 11 to step 12. It looks like so much more happened
Is it possible to verify A β© (B βͺ C) = (A β© B) βͺ (A β© C) without using distributive law but de morgan law?
(A' βͺ B' ) ' βͺ (A' βͺ B) ' = A
(A βͺ B)(AB)' = AB' βͺ BA'
Help would be much appreciated!
Sometimes we want to use more state detectors in our slightly more complicated logic circuit. However if we want to chain a lot of AND then it becomes messy really quick thanks to the fact that a AND gate is 2x2 and multiple of them is really hard to fit.
By using De Morgan's law and the fact that wires act as OR gates, we can replace the bulky AND gates with the smaller and much easier to fit NOT gates, or in some cases, 1 NOT gate to make a master AND function.
Here is how it works
(AB)'=A'+B'
AB=(A'+B')'
And it works for any number of inputs, we can demonstrate this by substituting B for BC
(A(BC))'=A'+(BC)'
(ABC)'=A'+(B'+C')
ABC=(A'+B'+C')'
For those of you who are not familiar with this, A B C are inputs, ' is the negator, + is OR and multiplying them is AND. It basically means if we flip all inputs and output of an OR gate, we can make a master AND gate.
Here's an example
https://preview.redd.it/tssa7xiqsfv31.png?width=1919&format=png&auto=webp&s=50cbc48e787b38310a5541e7656bf201cb6b2623
https://preview.redd.it/rp5z6jjvsfv31.png?width=1919&format=png&auto=webp&s=82a5cf79c7aaa3bff7f0cf3caf43f6882f5ddeed
https://preview.redd.it/54572lexsfv31.png?width=1919&format=png&auto=webp&s=c190efc33acc4a12c7df4fdfe81bc9c0a4e68954
Here I want the CO2 level to go above the Oxyferns and so I set up 3 element detectors and a pressure sensor.
All element detectors have to detect CO2 and pressure sensor has to detect a high enough pressure for the carbon skimmers to run.
Notice here the pressure sensor has a built in NOT gate. You just have to set it the opposite of what you want. In fact, the NOT gates for the element sensors are also not necessary, because there are not much gas other than O2 and CO2 involved, it can very well be set to detect O2 instead and make the whole thing work with just 1 NOT gate.
As you can see, instead of using 3 AND gates, 2x2 each, I ended up with 4 NOT gates, and can hide them all behind batteries and walls. Even with 5, they are still much more easier to fit then several 2x2 AND gates.
Hope this help you
https://violationtracker.goodjobsfirst.org/parent/jpmorgan-chaseall they have to do is buy their way out of trouble with investors $$$$$$
{-# LANGUAGE LambdaCase, TypeOperators, UnicodeSyntax #-}
I just started playing around with some very simple type-level proofs. I introduced the following types to encode logic on the type-level (I only show the necessary definitions to understand the post here, a more complete version can be found here):
data p :& q = p :& q -- | Conjunctions
type Iff p q = (p -> q) :& (q -> p) -- | If and only if
data p :| q = L p | R q -- | Disjunctions
data False -- | Unprovable
newtype Not a = Not (a β False) -- | Not
Next, I axiomatise an elimination rule for False
and prove the Principle of Explosion. And I introduce proofs by contradiction (an inverted version since this shortens the proofs) via axiomatised tertium non datur.
axiom = error
{- | Axiomatise elimination of False & show principle of explosion -}
_falseE β· False β a
_falseE = axiom "False β a"
explode β· p β Not p β q
explode a (Not a') = _falseE (a' a)
{- | Axiomatise tertium non datur & setup pro
... keep reading on reddit β‘I'm confused with the "I like basketball no more than physics". Does it mean that I like physics more than basketball? Thanks!
We have a text next week and I have been studying for hours and I keep getting stuck. In the picture provided they are two separate problems, but according to the teacher de morgans law is: not(something and something) is not (something or not(something). In the pictures, the part of the expressions that have a square should be able to have de morgans law applied to, but in one of them it applies and in the other, it goes straight to double negations. They look similar and was just wondering why one expression uses de morgans law while the other doesn't.
https://preview.redd.it/dbt0e6nkiwy31.jpg?width=960&format=pjpg&auto=webp&s=4548baecffa85748fec0a7f96fadbe613d75432b
De Morgan's Law is a neat law of Boolean propositional logic, helpful in every-day programming. It helps with inverting a boolean expression to get the opposite expression. Wolfram Mathworld has a much more correct definition using set theory, being equivalent to Boolean expressions.
That's important since programming is all about Boolean-expressions! If you want to invert some "if" conditional code (that is, to compute the test for the "else" fall-through case), you need to apply the Law's two transformations:
An interpretation of these rules, helpful for applying it, is that you first apply the not-operator on all expressions, then replace all ands with ors, and vice-versa. This gets much more tricky and complex when order of operations come in play with parentheses (nested expressions).
Your goal is to take a C-like language's Boolean expression, and apply De Morgan's Law on it. You may choose to simplify the resulting expression as much as possible for epic bonus poinst; consider reading into Karnaugh maps as one approach. "Simplified" is measured in the least-amount of variables and operators required (not counting parentheses).
The grammar of this C-like language is English-language space-delimited words, uses parentheses for nested expressions, with variables strictly being lower-case alpha-numeric. The reserved key-word for logical-and is "AND", with logical-or "OR", and logical-not "NOT". The expression will be in Infix-notation.
Note that the "NOT" is a unary operator, meaning it always applies first to variables on the right of itself, or to a full expression. The expression "NOT a OR b" is equivalent to "(NOT a) OR b", but not "NOT (a or b)".
Given the expression, print it's inverse using the same grammar and given variables. Simplify the expression for epic bonus points.
a
NOT a
a AND b
NOT a AND b
... keep reading on reddit β‘Alright. I have have an assignment to do and at one part it's asking me to,
*Given that a = Communication and b = Computer Systems Hardware, use the truth tables to prove that (a.b)' = a' + b'
*Given that a = Communication and b = Computer Systems Hardware, use the truth tables to prove that a'.b' = (a+b)'
Image to tables (https://imgur.com/a/b4lxR)
So these are my truth tables which I believe are correct however!, I'm not sure if I am fully answering the question and feel like I am missing the full answer I'm supposed to give. If I am can someone please help me with this, I honestly am not sure what to really add on or to do after the truth table if anything else is needed to be added..
So,
1) ( A βͺ B)β = Aβ β© Bβ
2) ( A β© B)β = Aβ βͺ Bβ
In (1) the left side doesn't make sense( I think!) if A and B have different universal sets but right side does even if A and B have different universal sets( again, I think!). Is there any scenario(maybe other fields of mathematics) where these laws hold true for A and B having different universal sets or is it just undefined?
https://imgur.com/a/mpHQTYY
I'm really having a tough time trying to figure out how all you need is De Morgan's Law to get from step 11 to step 12. It looks like so much more happened
https://imgur.com/a/mpHQTYY
I'm really having a tough time trying to figure out how all you need is De Morgan's Law to get from step 11 to step 12. It looks like so much more happened
Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.