JA EN
Student mode › Grade 10
★ MEMBER ·Grade 10

Numbers, Sets & Logic

Where this is used

AND, OR, NOT — every operation a computer performs is built on these three words, and they are exactly the operations of set theory. A WHERE clause in SQL, picking which features a machine learning model gets to see, the "and/or" conditions written into a law: all of them can be described with sets and logical statements. On top of that, "necessary" and "sufficient" conditions are the tools that let you argue precisely when you are testing a hypothesis, diagnosing a patient, or proving something in a courtroom.

Key points

How to write sets

A set is a collection of the things that satisfy some condition. The three you need are A ∪ B (the union: everything in either one), A ∩ B (the intersection: only what is in both), and Ā (the complement: everything that is not in A).

Statements, true and false

A statement (a proposition) is a sentence you can judge as either true or false. When "if p then q" (p ⇒ q) is true, p is called a sufficient condition for q, and q is called a necessary condition for p.

Telling necessary and sufficient apart

"Even ⇒ a multiple of 2" is true, and "a multiple of 2 ⇒ even" is also true, so being even and being a multiple of 2 are equivalent (each is a necessary and sufficient condition for the other). "An integer ⇒ a rational number" is true, but the reverse is false, so being an integer is only a sufficient condition for being rational.

Absolute value

For a real number a, |a| = a when a ≥ 0 and |a| = −a when a < 0. It measures how far a sits from zero on the number line, so it is never negative.

De Morgan's laws

The negation of "A and B" is "not A or not B." It is a law programmers lean on constantly when they simplify the conditions in an if-statement.

Jobs that use this

Software engineer (backend)$130k

AI and machine learning engineer$160k

Lawyer / legal consultant$200k

§

Members-only from here

The practice questions and full career details are for members. $4.99/mo, cancel anytime.

Comments

Sign in to comment

All grades