comp-think / 2024-2025

The GitHub repository containing all the material related to the Computational Thinking and Programming course of the Digital Humanities and Digital Knowledge degree at the University of Bologna (a.a. 2024/2025).
12 stars 0 forks source link

Lecture "Programming languages", exercise 1 #12

Open essepuntato opened 2 weeks ago

essepuntato commented 2 weeks ago

What is the boolean value of not (not True or False and True) or False?

ValkyrieCain9 commented 2 weeks ago

True

martinamrc commented 2 weeks ago

If I understood correctly the order of the operations:

  1. (not True or False and True): 1) not True = False, 2) False and True = False, 3) False or False = False.
  2. not (False) = True.
  3. True or False = True.

The value is True.

maridematteis commented 2 weeks ago
Screenshot 2024-11-11 alle 21 28 51
KikaYang commented 2 weeks ago

True

lisitein commented 2 weeks ago

NOT FALSE OR FALSE= TRUE

SinerYuu commented 1 week ago

True

martinaucch commented 1 week ago

True

arinee01 commented 1 week ago

True

mir-pin commented 1 week ago

not (not True or False and True) or False?

not True = False False and True = False

so we have not (False or False) or False?

False or False = False

so again not False or False?

not False = True

so in the end

True or False? 
True
polinakhrm commented 1 week ago

not (not True or False and True) or False? 1) not True = False 2) False and True = False 3) False or False = False

not False or False? 1) not False = True

True or False? True

essepuntato commented 1 week ago

Hi all,

While all results are good, in some of your answers, you are not applying the right resolution order for the boolean operators. As described in the chapter, it should be as follows:

First, one must execute all the not operations. Then, one must perform all the and operations. Finally, one must assess the remaining or operations.

Thus, the resolution of not True or False and True should be:

  1. False or False and True
  2. False or False
  3. False
ERendall commented 1 week ago

A bit late to the game, and I have cut out Prof. Peroni's answer before I tried to answer this:

1) not (not True or False and True) or False. 2) not (False or False and True) or False. 3) not (False or False) or False. 4) True or False. 5) True.

nicoldamelio commented 1 week ago

True

simplycyrus99 commented 1 week ago

not True = false false and true = false false or false = false not false or false = true or false = true

romashovar commented 4 days ago

True