Variables
Variables
Variables are basically anything that represents a particular number or elements in a set. One
misconception about variables is that they are mostly letters in the English alphabet, technically, it is
partly true.
You have been exposed to variables even in elementary Mathematics without even realizing it, since the
term variable was only introduced in Algebra. Take these for example:
1 + 1 = ___
or
1+1=?
What is the difference between these two statements?
Actually, nothing, well, aside from the symbol used at the end. However, content-wise, nothing. Why?
The blank and the question mark means the same thing – it signifies the location of the value of
whatever 1 plus 1 is. It indicates that there is a value missing at that part of the statement.
This means the same thing even if we replace it by a box as we are accustomed to sometimes or any
figure that registers as “missing” in our minds.
The difference in high school is that instead of these symbols, we use letters like:
1+1=x
or
1+1=θ
but it means the same thing. We are just accustomed to seeing “blank”, question mark, or boxes to mean
a missing value, that when we replace it with something else, we get confused. Some get frustrated by
the letters probably because of “bad” memories during high school. You have probably seen something
like this in social media platforms, especially Facebook:
Now, you might be willing to find for the missing value at the end, however, if we present it like this:
x + x + x = 18
x + y + y = 14
y–z=2
z + x + y-1 = ?
you get frightened.
“BuT sIr, FrUiTs ArE nOt ThE sAmE aS LetTeRs”
Yes, they are different, but in the statement, they mean the same thing. To make things clearer the actual
values are:
6 + 6 + 6 = 18
6 + 4 + 4 = 14
4–2=2
2+6+4-1=?
Where are we getting at? The apples are only to represent the initially unknown value 6, the bananas
represent 4 or 3, and the cherries, 2. So if we replace the apples with squares, the bananas with triangle,
and the cherries with circles, it would still be the same sentence. Or, let’s say we place your face to
replace the apples, the face of your pet to replace the bananas, and the face of your crush to replace the
cherries, it would still be the same thing:
The apples, x, squares or your face represent the value of 6
The bananas, y, triangles or the face of your pet represent the value of 4 or 3
The cherries, z, circles or the face of your crush represent the value of 2
There is absolutely no difference, meaning-wise, regardless of what you use to represent – those
are variables.
So why do we use letters as variables? Which is easier, drawing apples, writing down the letter x,
constructing squares, or drawing your face?
The letters as variables are only for convenience, but variables themselves could be anything. This also
means that the image a while ago is a legitimate Mathematics problem. Referring to the previous lesson,
Mathematics is a language, just because we are used to letters in Algebra doesn’t mean that letters are
exclusive to Algebra and vice versa. We use letters only for convenience.
As aforementioned, variables have two functions, to represent a particular number or elements in a set.:
The first function, representing a particular number, is shown in the previous discussion. Variables
can be used to represent a missing value, or a value in a statement initially unknown. For example,
Twice a number plus 5 is 6
Since we do not know what the “number” is initially, we use a variable to represent it first so we can
easily find what the number is, if possible. Let’s say x would represent the number:
2x + 5 = 6
The second function, representing elements in a set, uses the variables to summarize a group of
numbers that are too laborious to mention or write down. For example, if every one in Grade 5 -
Matapat got 95 as a grade (literally everyone, no one got higher or lower than 95), instead of
enumerating their names, I would just use their section to represent everyone:
“Grade 5 - Matapat got 95”
In this case, the Grade 5 - Matapat is the variable itself.
Let’s say that you want to say “the square of all numbers greater than 2 is greater than 4.” Instead of
enumerating all numbers greater than 2, which is infinite by the way, we simply use a variable to
represent it. So,
Let x represent all numbers greater than 2, x2 > 4.
or
If x > 2, then x2 > 4
Converting to Mathematical Statement
The language of Mathematics uses symbols for its statements. Like English alphabet is for the English
language, Filipino alphabet (English alphabet plus ñ and ng) is for the Filipino language (after we
included all the borrowed words from foreign languages), and your own syntaxes in coding.
The crux is how to convert (or translate) to Mathematical syntaxes. Take for example the previous
statement:
Twice a number plus 5 is 6
Just like translating one language to another, we consider the context first, then translate
correspondingly.
“Twice” means two times or multiplied by 2
“a number” the unknown value, represented by a variable, let’s have x
“plus 5” means added by 5
“6” is 6
The linking verb, “is”, pertains to the equality of values between the subject and the predicate in the
English syntax. We use “=” to represent equality.
So, 2x + 5 = 6
Another example:
Given any real number, its square is nonnegative
“real number” represents all numbers that can be plotted on the real number line, since there is an
infinite number of elements under the Set of Real Numbers, it will be represented by a variable, let’s
say, y
“its square” does not pertain to the geometric figure, but the power of 2, or 2 as an exponent of what
“its” refers to, which is the real number.
“is nonnegative” literally means “not negative”, which is either zero or positive. In symbols, since we
have zero as the basis for positivity or negativity, “> 0” is positive, “< 0” is negative.
“Let y be a real number, y2 ≥ 0”
The sum of the square of two numbers equals the square of their sum
“sum” means the result of addition, so + is involved
“square of ___” means that whichever its object is, it is raised to the power of 2
“two numbers” and “their” would be represented by two different variables, using only one would bring
about confusion as to what value it pertains, let’s say a and b.
“equal” means equal, “=”
In “The sum of the square of two numbers”, the object of the preposition of “The sum of” is “the
square…” which means that the sum supersedes the square in the order of operations, meaning you get
the square of each term first before adding.
a2 + b2
In “the square of their sum”, on the other hand, the object of the preposition of “the square of” is “their
sum”, which means that you get the sum first before applying the square.
(a + b)2
So, “The sum of the square of two numbers equal the square of their sum” in symbols is
a2 + b2 = (a + b)2
What is important in converting to mathematical syntax is to know the concepts that represent each
English term or phrase. So if you had no idea that “squaring a number” means raising the number by the
power of 2, you might end up drawing a literal square box on the number.
Examples:
Using x to represent the missing value:
Thrice a number is twice the same number increased by 5
3x = 2x + 5
Use of the word set as formal mathematical term was introduced in 1879 by Georg Cantor (1845-1918).
A set is a collection of distinct objects. This means that {1,2,3} is a set but {1,1,3} is not because 1
appears twice in the second collection. The second collection is called a multiset. Sets are often
specified with curly brace notation { }.
The set of even numbers can be written:
{2,4,6,8,…}
The opening and closing curly braces denote a set, the numbers or objects inside the braces are
called elements. The symbol … is called ellipsis and read “and so forth” meaning that the set of even
numbers are infinite.
Notation:
A. The Roster Notation.
If S is a set, the notation x ∈ S means that x is an element of S. The notation x ∉ S means that x is not
an element of S. A set may be specified using the set-roster notation by writing all of its elements
between braces.
For example, {1,2,3} denotes the set whose elements are 1,2, and 3. A variation of the notation is
sometimes used to describe a very large set, as when we write {1,2,3,..,100} to refer to the set of all
integers from 1 to 100.
Examples:
A= {1,2,3,4} B= {p,h,i,l,n,e,s} C = {5, 10, 15,…}
B. The Verbal Description Method.
It is a method of describing a set in words. We can describe the sets named in number. Examples are Set
A is the set of counting numbers less than 5; Set B is the set of letters in the word “Philippines”; Set C is
the set of positive multiples of 5.
C. The Set-Builder Notation
It is a method that lists the rules that determines whether an object is an element of the set rather
than the actual elements.
Examples:
A= {x | x is a counting number less than 5} read as “ the set of all x’s such that x is a counting number
less than 5”. The vertical bar after the first x is translated as “such that”
B= {x | x is a letter in the word “Philippines”}
C={x | x is a positive multiple of 5}
D= {x ∈ Z | x is odd, x < 10} read as “ the set of all x’s, where x is an element of integers such that x is
odd and x is less than 10”
Set-builder on the other hand requires your knowledge in Mathematical syntaxes. Here are common
symbols we use in set-builder
∈ element of
∉ not an element of
s.t. or | such that
∀ for all
∃ there exists
ℝ set of real numbers
ℚ set of rational numbers
ℤ set of integers
ℕ set of natural numbers
∪ union of
∩ intersection of
A superscript + or – on the ℝ, ℚ, or ℤ means positive or negative, respectively. For example,
ℝ+ means the set of positive real numbers
ℤ- means the set of negative integers
1. S = {1,2,3}
2. T = {1,1,2,3,3,3}
Solution:
Example 2: Let A be the set of positive integers and set B be all integers greater than or equal to zero but
less than 100. Is B ⊆ A?
Solution: False. Zero is not a positive integer. Thus zero is in B but not in A, so B is not a subset of A.
Proper Subset
Set A is a proper subset of set B, written as A ⊂ B, if there is at least one element in B not
contained in A.
Example: Consider the sets A = {a,b,c} and B = {a,b,c,d}. We can say that A ⊂ B since each element in
A is also an element in B, and there is at least one element in B that is not contained in A. We cannot say
that B ⊂ A because d is an element of B, but d ∉ A. Hence B is not a proper subset of A.
Operation on Sets
In arithmetic, we have operations such as addition, subtraction, multiplication, and division that enable
us to combine numbers. In sets, we have the intersection, union, difference, and complement of a set.
Intersection of Sets
The intersection of two sets S and T is the collection of all objects that are in both sets.
It is written S ∩ T. The symbol ∩ is a special math symbol called upside down cap, it usually represents
intersection of sets. Using curly brace notation
S ∩ T = {x : (x ∈ S) and (x ∈ T)}
The symbol and in the above definition is an example of a Boolean or logical operation. It is only true
when both the propositions it joins are also true. It has a symbolic equivalent ∧. This lets us write the
formal definition of intersection more compactly:
S ∩ T = {x : (x ∈ S) ∧ (x ∈ T)}
Example:
Given: A = {1, 2, 3, 4, 5, 6} , B = {2, 4, 6} and C = {1, 3, 5, …}
Find: a.) A ∩ B b.) A ∩ C c.) B ∩ C
Solutions:
a. The elements in A that are also in B are 2, 4, and 6. Hence, A ∩ B = {2, 4, 6}
b. The elements of A that are also in C are 1, 3, and 5. Hence, A ∩ C = {1, 3, 5}
c. Examining sets B and C, we see that there are no elements common to both.
Therefore,
B ∩ C = { } or B ∩ C = ∅
If A and B are sets and A ∩ B = ∅ then we say that A and B are disjoint, or disjoint sets. Therefore, in
the example above B ∩ C is a disjoint set.
UNION OF SETS
The union of two sets S and T is the collection of all objects that are in either set. It is written S ∪ T.
Using curly brace notion
S ∪ T = {x : (x ∈ S) or (x ∈ T)}
The symbol or is another Boolean operation, one that is true if either of the propositions it joins are true.
Its symbolic equivalent is ∨ which lets us re-write the definition of union as:
S ∪ T = {x : (x ∈ S) ∨ (x ∈ T)}
Example: Suppose P = {1, 2, 3}, Q = {1, 3 ,5}, and R = {2, 3, 4, 5}
Then:
P ∪ Q = {1 ,2, 3, 5} P ∪ R = {1, 2, 3, 4, 5} and Q ∪ R = {1, 2, 3, 4, 5}
COMPLEMENT OF A SET
The complement of a set S is the collection of objects in the universal set that are not in S. The
complement is written Sc or S’ however, it should be apparent that the complement of a set always
depends on which universal set U is chosen.
Example:
Given U = {1, 2, 3, 4, 5}, A = {1, 3, 5} B= {1, 5} and C={ }
Find: a. Ac c. Cc e. (A ∪ B)c
b. Bc d. (A ∩ B)c f. (Ac ∩ Cc)
Solutions:
a. The complement of A is the set of elements in U but not in A. These elements are 2 and 4. Thus, Ac =
{2, 4}
b. Bc = {2, 3, 4}
c. Cc = {1, 2, 3, 4, 5} = U
d. (A ∩ B)c
A ∩ B = {1,5}
Thus, (A ∩ B)c = {2, 3, 4}
e. (A ∪ B)c
A ∪ B = {1, 3, 5}
Thus, (A ∪ B)c = {2, 4}
f. (Ac ∩ Cc) = {2, 4}
SET DIFFERENCE
The difference of set S and T, written as S – T, is a set of elements in S that are not in T.
Since complementation is done before intersection the symbolic definition of the difference of sets can be
rewritten:
S − T = {x : x ∈ S ∩ Tc}
If we were to take the set operations
A ∪ B ∩ Cc
and put in the parenthesis we would get
(A ∪ (B ∩ (Cc)))
Example:
Given: A = { r, o, y, g, b, i, v} B = {r, y, b}, find A – B.
Solution:
Taking A and subtracting B means that elements in A that are not B. Thus,
A – B = { o, g, i, v }
Notice how intersection and complement can be used together to create the difference operation and that
the definition can be rephrased to use simple operations. There is a set of rules that reduces the number
of parenthesis required. These are called operator precedence rules.
Cartesian Product
Given sets A and B, the Cartesian product of A and B, denoted as A x B and read as “A cross B” is the
set of all ordered pairs (a,b), where a is in A and b is in B.
Symbolically;
A x B = { (a,b) | a ∈ A, and b ∈ B}
Example:
Let A = {1, 2, 3} and B = {u, v}
Find:
1. A x B
2. B x A
3. B x B
Solutions:
We combine these two Venn diagrams using set union. This means that any region that is shaded in either of the
diagrams above will be shaded in A ∪ B′
Application of Venn Diagram
Example 1: Out of 50 students, 20 are members of the Math Club and 34 are members of the Forensic
Club. If 8 are in both clubs, how many students are in a) neither of the clubs and b) either clubs?