Why am I getting the wrong response for statement 4?

You can only pass this if you pass off the fourth statement

Cats are female dogs

as “Yes” or “True” if you will.
Cats are, to my knowledge at least, not dogs. Irrelevant of their sex.
I can’t help but feel this is a bug.

The exercise relates to assertion versus opinion.

Cats are female dogs

is an assertion, so, “Yes”, it is a boolean expression.

11 Likes

I thought as much too, but it’s still very confusing regardless. When you go with “No”, it just says something along the lines of “Expected “Yes” on Statement Four”
Could’ve at least elaborated that it’s a boolean due to that, because my first thought was “We’re going with factual statements”.
Thanks!

2 Likes

The lesson text is fairly explicit, but brief as needs be. Cover this point in your review of the topic of what makes a statement a boolean, as opposed to an opinion.

It might rain tonight

has no definitiveness, so is therefore not answerable with True or False. It’s not a boolean.

It will rain tonight

has a definite aire of assertion about it, so is therefore a boolean.

We are not concerned with the veracity of the statement, only whether it can be definitely refuted or confirmed.

18 Likes

In this context the correct answer to “Cats are female dogs.” is “Yes”, and I have to ask: was calling cats “female dogs” (with the connotations therein) intentional?

Edited because flagged. I’ve moderated out the offensive word, however, I didn’t make the joke: Code Academy did with that question. Intentional or otherwise. So if it’s offensive then Code Academy should edit their question.

5 Likes

How is the statement “It will rain tonight” a boolean expression? Since it contains a prediction about a future event, it cannot be evaluated as True or False until said prediction is confirmed or not. I’m confused by your example. I wouldn’t say that’s boolean.

2 Likes

Unless we consider that somewhere in the world it is raining, even now. But you raise a good point.

"It is raining"

would be a better example.

2 Likes

I don’t think it was meant as a joke - the joke you have in mind is too obscure. It’s a bug. Statement 4 can be evaluated as True or False.

Again, the veracity of the expression is not what is needed to determine if this expression is boolean or not. The only parameter needed is to check whether this expression can be flagged as true or false.

If i say “it will rain tonight” and it doesn’t start raining, this is a false expression; if it does rain, it is true.

The same goes to the original question: if I say that “Cats are female dogs”, you can flag it as false because, well, it is false.

But if I say that cats are better than dogs, it is not possible to flag as true or false because while it might be true to some people, it is false to some others (such as myself, a dog person).

Hope I helped!

1 Like

I thought boolean expressions are either True of False no matter what and no matter the circumstances. The statement “cats are female dogs” is False and can never be True. The sentence “it will rain tonight” not only has an unknowable truth-value (it can either be True or False depending on the future events), but its truth value also depends on circumstances external to it’s meaning: since no location is specified, it’s truth value can change depending on where it is “read” or “evaluated” in the world. If instead it refers to any geographical location, it is VERY LIKELY True as there will very likley be a location on the planet where it will rain at night, although it is not necessarily the case (the probability is very low but still there can be a rainless night somewhere). In philosophical terms (not my expertise), the sentence “cats are female dogs” is false in an “analytical” way: it is false by virtue of its meaning, it is NECESSARILY false because of the very meaning of the word “cat” and “dog”, like saying 13 == 8. The sentence “it will rain tonight” sounds more like a contingent proposition, which depends on the facts, hence it doesn’t hold a True or False value. My understanding of boolean expression is that this cannot be boolean. I remain highly unconvinced of the contrary :slight_smile:

Yes, I understood now what you meant. But computers are very literal on their understanding of things. A boolean expression needs only to accept an input and check whether it can or cannot be true.

So, for an expression to be boolean, all that matters is the input. When you tell the computer “it will rain tonight”, it will first acknowledge if its past 6 pm, and then check if it is raining.

If it is, it will return true, if not, it will return false.

It doesn’t even know what a rain is, and what a night is, and it doensn’t really care. All it needs is an input to check and a value to return.

(I do have to say that this is but my interpretation of things, as I am just a beginner in this computer logic stuff :slightly_smiling_face: :upside_down_face: )

I think I might be entering in the realm of philosophy and the problem of future contingents at this point, it’s been debated since Aristotle :sweat_smile: but the way you put it, the expression would be “it IS RAINING now”. How can a computer check the truth value of a future tense statement? By definition, the answer lies in the future :grin:

if time >= 6pm and is_raining == true:
   it_will_rain_tonight = true

else:
   it_will_rain_tonight = false

if you run your “code” at a rainy night, it will return true. otherwise, it will return false. again, computers don’t understand time, so if you are checking if something is in fact happening or if it will do or will not do in the future, it does not matter to them :grinning:

computers are not smart. they just think they are.

What you wrote is not a boolean expression, you are assigning a value of True or False to the VARIABLE it_will_rain_tonight. The variable it_will_rain_tonight could have any name, you are completely changing the point of the discussion :slight_smile: I could easily do the same with cats are female dogs and assign to it a True value, that would’t mean the logic content of the statement cats are female dogs changes. The point of the discussion was in the mere logic nature of the sentence ‘it will rain tonight’, not if it’s possible to convert it into a variable and assigning it a truth value depending on conditionals.

That being said, I know you are well meaning, but you do not need to repeat to me that ‘computers are not smart’ twice. It is a platitude and it feels a bit condescending. I know you did not mean to make it sound like that, but I assure you I know computers are not intelligent beings, thank you :wink:

By that logic, for statement 3, “Dogs make the best pets”, they either make the best pets or they do not make the best pets. Isn’t that the same logic you’re using for “Cats are female dogs”? So shouldn’t statement 3 be Yes?

“Dogs make the best pets.” is subjective. It’s a matter of opinion. “Cats are female dogs.” is factually inaccurate. Personally, I tend to agree with Ron Swanson:
image
I believe the exact quote, however is, “Any dog less than 50 pounds is a cat, and cats are pointless.” :laughing:

1 Like

I tried flagging “statement_four” as “False” because it is a ‘boolean expression’, however “Yes” or “No” is expected instead of “True” or “False”. This is why I am confused.

nbornstein

The exercise is asking whether the sentences are booleans or not. It isn’t asking if they are true or not.
The answer to 4 is ‘Yes’ because it is a boolean. It doesn’t matter that it’s not true. Booleans can be false. In fact, every boolean is either true or false.
For example, “Trees are mammals.” is false and is a boolean. “Trees are the best plants” can’t be objectively true or false because it’s an opinion, so it can’t be a boolean.