Convert function with only AND Boolean operations - boolean

I have some function like
(A and ( B or c)) or (D and E and (F or H or R or P )))
and I want to convert that function to function with only and operations (of course if possible)
I find that with DeMorgan's Laws can be done some kind of transformations but I didn't manage to conver this function any ideas ?
I know that function
!(A or B) is equal to function !A and !B
but I could not find the equal function to the one above

The function you mentioned:
!(A or B) = !A and !B
is the same as:
A or B = !(!A and !B)
So let's start by splitting your problem into two parts of ABC and DEFHRP.
(A and (B or C)) = (A and !(!B and !C))
(D and E and (F or H or R or P)) = (D and E and !(!F and !H and !R and !P))
Since these two parts are joined by an 'or', we can apply the equivalence again to get:
!(!(A and !(!B and !C)) and !(D and E and !(!F and !H and !R and !P)))

The key substitution you're looking for is A OR B => !(!A AND !B). Using this you can expand the expression.

a and (b or c)
is the same as
a and not (not b and not c)
You can test it here
And for the more complex one:
d and e and (f or h or r)
is the same as
d and e and not(not f and not h and not r)
which is tested here

Related

How can I replace a variable by another in coq

When I was trying to prove if two functions are equivalent and come to the step:
I : f(S a') b = S (f a' b)
f (S a') (S b) = S (f a' (S b))
I am wondering whether it's possible to use exact(I) to prove it, namely, to replace (S b) by b, since that's the only difference.
The inference from the premise to the conclusion is generally false for an arbitrary function f: consider the function f a b such that f a 0 := a and f a (S b) := S b, you can prove the premise and contradict the conclusion.
You could substitute b in I only if it was quantified universally in that hypotesis: I : forall b, f (S a') b = S (f a' b) ; in that case substituting would amount to application of I to S b.
If it's not possible to strenghten your hypothesis, you need to use something specific to the function f to conclude.

How do I simplify(expand) this Boolean expression?

Expression - (A OR B OR C OR D) AND (!B AND !D)
I know that with distributive property, it holds that (a OR b) AND (c OR d) = (a AND c) OR (a AND d) OR (b AND c) or (b AND d) but I'm not sure how it will work if the second group has an AND
Steps in the answer would help.
Something like this perhaps?
(A OR B OR C OR D) AND (!B AND !D)
= (A OR B OR C OR D) AND !(B OR D)
= ((A OR C) OR (B OR D)) AND !(B OR D)
= ((A OR C) AND !(B OR D)) OR ((B OR D) AND !(B OR D))
= (A OR C) AND !(B OR D) OR false
= (A OR C) AND !(B OR D)
That seems like it's going to be minimal since each variable appears once and there are no apparent contradictions or tautologies.

Why is (a and (not b)) or (a and b) = a?

I reached the end of a pretty long Boolean simplification, where I was supposed to prove that something = a. I reached a point (a and (not b)) or (a and b). Any further reorganization of the equation did not bring me further. But using a Truth tabel I checked to see that (a and (not b)) or (a and b) indeed does equal a. And it does make sense intuitively too, but can you actually use the Laws of Boolean Algebra to turn (a and (not b)) or (a and b) into a?
It makes more sense when you use the simplified notation, * for and, + for or, ~ for not.
(a and b) or (a and (not b)) =
(a*b)+(a*(~b)) =
a*(b+(~b)) =
a*(1) =
a
((a and (not b)) or (a and b)) ... distributive law
<=> (a and (b or not b) ... (b or not b) is alway true
<=> a
Feel free to distribute:
c = (a and ¬b)
(a and b) or c
(a or c) and (b or c)
(a or (a and ¬b)) and (b or (a and ¬b))
distribute again for both the left and right sides:
((a or a) and (a or ¬b)) and ((b or a) and (b or ¬b))
simplify:
(a and (a or ¬b)) and ((b or a) and T)
(a and (a or ¬b)) and (b or a)
simplify again (using the absorption property = x and (x or y) == x):
(a) and (b or a)
and again:
a and (a or b)
== a
(I know this is a bit of the long way around...)

Converting a query to CNF

I've recently been trying to learn logic, but I've come across a query that I can't do and I'm not quite sure where I'm going wrong. When converting a query to CNF, what do you do when you come to this particular situation?
(a AND NOT(b AND c)) AND (d OR e)
= (a AND NOT b) OR (a AND NOT c) AND (d OR e)
=
How would i re-arrange this to get it into CNF form? Am I doing something completely wrong?
Thanks for your help,
Sean
I use the symbols:
^ for AND
v for OR
~ for NOT
and here is how you can transform your formula in CNF:
(a ^ ~(b ^ c)) ^ (d v e)
= (a ^ (~b v ~c)) ^ (d v e) // DeMorgan: ~(A ^ B) <=> (~A v ~B)
= a ^ (~b v ~c) ^ (d v e)
= CNF
Every clauses are separated by AND and contain only OR. With your syntax it gives:
a AND (NOT b OR NOT c) AND (d OR e)
I hope it helps :)

boolean algebra simplification provided equation

i have this one
OM5= NOT ( A OR (B AND C)) OR D
i provided i photo of it.
http://i.stack.imgur.com/opS1I.png
I used different calcs that were online and all gave me this result
http://www.wolframalpha.com/input/?i=not+(a+or+b%26%26c)+or+d like the wolframalpha one!
But when i did it with my hand i had different results.
the result was NOT(A) AND ( NOT(B) OR NOT(C) OR D )
NOT ( A OR (B AND C)) OR D
= (NOT A AND NOT (B AND C)) OR D
= (NOT A AND (NOT B OR NOT C)) OR D
= (NOT A AND NOT B) OR (NOT A AND NOT C) OR D
That's it.