Lecture "Programming languages", exercise 1
essepuntato opened this issue Β· 20 comments
What is the boolean value of not (not True or False and True) or False
?
not (not True or False and True) or False = True
as follows:
(not True or False and True) = False
not False or False = True
I think the solution is True
. Indeed,
not (not True or False and True) or False =
not (False or False and True) or False =
not (False or False) or False =
not False or False =
True or False = True
The boolean value of not (not True or False and True) or False
is True
:
- not (not True or
False and True
) or False
False
- not (
not True or False
) or False
False
not (False)
or False
True
True or False
=True
not (not True or False and True) or False=
not (False or False and True) or False=
not (False or False) or False=
not False or False=
True or False=
True
The boolean value of not (not True or False and True) or False
is True
.
That's because the application order of the boolean operations is: first, the not
operations, then, the and
operations. Finally, the or
operations. Of course, the round brackets also affect the application order.
For not (not True or False and True) or False
we first execute the part between brackets: (not True or False and True)
not True
=False
False and True
=False
False or False
=False
We then obtain not False or False
, and we execute:
not False
=True
True or False
=True
The result is True
, starting from the values between the brackets:
not True
=False
andFalse and True
=False
.False or False
=False
not False or False
=True
not (not True or False and True) or False
not (False or False and True) or False
not (False or False) or False
not (False) or False
True or False
True
Following the order of the operators I got
1)not 2)and 3)or
not ((not true) or (false and true)) or false
(not((false) or (false))) or false
(not (false)) or false
(not false) or false
true or false = true
the result of this boolean statement is:
not (False or False) or False =
not False or False =
True or False = True
The boolean value of not (not True or False and True) or False is True.
- not (False or false and true) or False;
- not (False and true) or False;
- not False or False;
- True or False= True.
not (not True or False and True) or False ->
not (False or False and True) or False ->
not (False or False) or False ->
not False or False ->
True or False = True
The value of not (not True or False and True) or False
is:
not (not True or False and True) or False
= not (False or False) or False
= not False or False
= True or False
= True
not (NOT True or False and True) or False
= not (False or False AND True) or False
= not (False OR False) or False
= NOT False or False
= True or False
= True
The final output of the above-mentioned equation will be true or 1
Hi all,
Just a couple of notes:
- @elizastuglik and @Postitisnt, the result is correct, but you solved
or
operations beforeand
operations, whileor
s should be the last to run. - @ManuSrivastava1 despite the fact that in some cases
1
is interpreted asTrue
, the operation return only a boolean and not a number.
not (False or False and True) or False
not (False or False) or False
not False or False
True or False = True
not (not True or False and True) or False
not True == False
False and True == False
not (False or False) or False
False or False == False
not (False) or False
not False == True
True or False == True
I think the solution is True, infact:
not True= False
False AND True= False
False OR True= True
not (False or False and True) or False
not (False or False) or False
not (False) or False
True or False
TRUE
not True ββ> False ββ> not(False or False and True) or False
False and Trueββ> False ββ> not(False or False) or False
False or Falseββ> False ββ>not False or False
not Falseββ> True ββ> True or False
True or Falseββ> True