On this page:
2.15.1 Exercises 7
2.15.1.1 Question 21
2.15.2 Exercises 8
2.15.2.1 Question 22
2.15.2.2 Question 23
2.15.2.3 Question 24
2.15.2.4 Question 25
2.15.2.5 Question 26
2.15.2.6 Question 27
2.15.2.7 Question 28

2.15 Logical Operators

In order to combine logical expressions together, we have the conjunction &&, the disjunction ||, and the negation ! operators. While the conjunction and the disjunction operators take two arguments and are written in infix notation, the negation operator takes just one argument in prefix notation. The value of such combinations is determined by the following rules:

2.15.1 Exercises 7
2.15.1.1 Question 21

What is the value of the following expressions?
  1. (2 > 3 || !(2 == 3)) && 2 < 3

  2. !(1 == 2 || 2 == 3)

  3. 1 < 2 || 1 == 2 || 1 > 2

2.15.2 Exercises 8
2.15.2.1 Question 22

What is a conditional expression? What is a logical expression?

2.15.2.2 Question 23

What is a logical value? Which logic values does Julia provide?

2.15.2.3 Question 24

What is a predicate? Give examples of predicates used in Julia.

2.15.2.4 Question 25

What is a relational operator? Give examples of relational operators used in Julia.

2.15.2.5 Question 26

What is a logical operator? Give examples of logical operators used in Julia.

2.15.2.6 Question 27

What is a recognizer? Give examples of recognizers in Julia.

2.15.2.7 Question 28

Translate the following mathematical expressions into Julia’s notation:
  1. \(x<y\)

  2. \(x\leq y\)

  3. \(x<y\wedge y<z\)

  4. \(x<y\wedge x<z\)

  5. \(x\leq y \leq z\)

  6. \(x\leq y < z\)

  7. \(x< y \leq z\)