it is true or false and why?

State whether each of the following is true or false. If false, tell why:

a. !(p || q) is the same as (!p || !q)
b. (!!!p) is the same as (!p)
c. (p && q || r) is the same as (p && (q || r))
closed account (EzwRko23)
a. !!!(true) || false
b. (false && !!true) || (!false && true)
c. (false || true) && (!true || false)
Last edited on
you dont honestly expect us to do your homework for you do you, you don't have a specific coding problem here you're just too lazy to think about your homework for 5 mins
We're not telling. These are all simple logic problems that you should be able to figure out on your own if you payed attention in class.

xorebxebx: That's just mean. ;)

-Albatross
That inspired me:

Answers:
a. (((((!false || !true) || true) && false || false || true || true) && false || (((false) || !(!((false) || !!!true || true || !!(false && !false || true)) || false) && ((true && true && true && !!false)) || (!!false) && false || false || false || false && false) || !true && !!!false || false || false)))

b. (false && !true || (!false || (!true || !(true && (false || false) || true && true && !(!true || true || false || ((!true)) && true && false || true) || !(false && true) && true && !false)) || false && false) || (!(true) && true && (false && !false && false || !!(!!true || (true) && !false)) && ((!true && true && true || (true) && (true && !!(!false && true || (false || false || !((!false && false) && false)))))) || false || true || true || false && !((false || (((true) && (!!!!true) || !(!false && true) || (true && !!(!false && ((!false)) || true) || !!!!!!(!true) || false && true)) || !true || false)) && false && true || !(!(true && (!!!!false || true && false && false && (true || true && false))) && true) && !(true && !((!false) && (false || true)) && !!true)) && true && (((true))) || true && (true)) && (true && false))

c. (!((true && true && ((true || true && !false || (!true || true || !(!!!!false && !true) && false) || !false || ((false || !true && false || !false) && !!((false && false && !!false || false) && true && !!(false) && (true) && (false && (true || !true && (true) || true) || true)))))) || false && ((!true || true)) || true) || false)
ATHAR, YOU SADIST!

Wait, do those also generate the explanations required?

Explanations:

a)1000010110010111000111100001111010111100111100101100000111010011010001100
101100000111010011100101110101111010011010001000001110100110000111000101101
100110010110000011001101101111111001010000010000110100011000011000001111100
111110010000011000101010011000001101001111001110000011011101101111111010010
000011101001101000110010110000011100111100001110110111001011000001100001111
001110000011101001101000110010110000011101001110010111010111101001101000100
000111010011000011100010110110011001011000001100110110111111100101000001010
001000011100001100000111110011111001000001000011100010101001101110100000100
010111110001100001110110111100001101100110010111101010000010001101101111111
001010000011000011000001100110110000111011001110011110010110000011000011101
110110010010000011000011000001110100111001011101011100101100000110001010110
010000011101111100101100000110011111001011110100100000110000110000011001101
100001110110011100111100101100000110011011011111110010100000111010011010001
100101100000110011011010011110010111001111101001000001100010111010111101001
000001100001100000111010011100101110101110010110000011001101101111111001010
000011101001101000110010110000011100111100101110001111011111101110110010010
1110

b)1000001110111011001011110110110010111011101000001101110111010111011011100
010110010111100101000001101111110011010000011011101100101110011111000011110
100110100111101101100101111001110000011000111100001110111011000111100101110
110011100111000001101111111010111101001011001000001100001110111011001001000
001100001110111010000011011111100100110010010000011011101110101110110111000
101100101111001010000011110110000011001011010111000001010111000001100011000
001110111110100011001011110010110010110000011010111000001101001111001110000
011100111101111110110111001011000001101001110111011101001100101110011111001
011110010101110100000101010011010001100101111001011001011100110110111111100
101100101101100100000110000111011101000001101111110010011001001000001101110
111010111011011100010110010111100101000001101111110011010000011011101100101
110011111000011110100110100111101101100101111001110000011010011110011100000
111010011010001100101100000111001111000011101101110010110000011000011110011
100000110111111011101100101101110

c)1000001110111011001001110011100000110000111100101100101100000110001111011
111101101111000011101011110100110010111001001000001100010110010111001101101
111111001011001011000001101111111001011100111000001100010111100110000011101
001101000110010110000011000011100011110001111001011110000111010011001011100
100100000110111111100101100100110010111100101000001101111110011010000011011
11111000011001011110010110000111101001101001110111111011101110011101110

Okay, we're being mean here. Sorry. :(

-Albatross
Last edited on
And I believe the inventor of boolean logic come from George Boole ? He must have a real inquiring mind to come out with this !

http://en.wikipedia.org/wiki/George_Boole

Boole said,

... no general method for the solution of questions in the theory of probabilities can be established which does not explicitly recognize ... those universal laws of thought which are the basis of all reasoning ...

In this regard, I should call him the founder of the field of computer science! Such a pity he died at age 49 :(
Hahaha you all are baddies.. The answers by albatross is funny..LOL.
It is true or false and why?


bool it = true || false && why;

it is true only if why is true (you haven't given a value for why)

unless you parenthesize

bool it = true || ( false && why );

in which case it is definitely true.
Just write some truth tables...that's the first proof strategy you learn in discrete math courses.
@jsmith: I suppose I'm giving an answer here, but I was under the impression that ANDs were computed in formal logic before ORs.

-Albatross
My apologies. That is definitely a 1 statement.

Let me correct.

bool it = true || false && why;

it is definitely true. But, if you parenthesize:

bool it = ( true || false ) && why;

then it is true only if why is true (you haven't given a value for why)
http://www.cplusplus.com/doc/tutorial/operators/

Question b is just plain stupid. I wish that these assignments used more realistic coding examples that one might actually see in the real world.
Topic archived. No new replies allowed.