top of page

Mathematical Concepts

Tutoring Databases > Mathematical Concepts

Maths can be used to represent databases and it's east to see why. After all, a database is a collection of related tables holding information, which we can manipulate with numbers and operators.

Sets in mathematics
  • A set is an unordered collection of items with no duplicates.

  • Common notation for a set is curly braces, so a set containing 1, 2 and 3 could be written like this : {1, 2, 3}

  • A set can also contain only one number : {4} This is a singleton set.

  • A set can be infinite, and there is also an "empty" set : { }

  • Sets can contain any number of any kind of item :

                                       {1, 2, "Ted", 44, b51, xyz}

  • You can also have sets of sets : {{2, 4}, {5, 7}}

  • And sets of sets of sets etc...

Union

When you apply the union operator to two or more sets, you join them together. The resulting set contains every element from both sets.

Remember that sets cannot contain duplicates so if two sets :

X is {1, 2, 3} and Y is {2, 3, 4} are joined in union, the resulting set will be 

{1, 2, 3, 4} to retain it's property as a set.

Union is associative. We can write:

A âˆª (B âˆª C) = (A âˆª B) ∪ C

Associative, commutative and distributive
  • Associative means it doesn't matter how we group the numbers.

A âˆ© (B âˆ© C) is equivalent and equal to (A âˆ© B) ∩ C

 

  • Commutative means we can swap the numbers and still get the same answer. Addition is commutative:

3 + 5 = 5 + 3

 

So is multiplication:                       2 x 4 = 4 x 2

 

However, subtraction yeilds a different result if we swap the numbers. This is not commutative.

4 - 3 = 1

3 - 4 = -1

Also, division is not commutative, as swapping the munbers gives different results.

12 / 4 = 3

4 / 12 = 1/3

 

  • Distribution lets us do something cool. The picture above shows distribution of 4 across 3x and 1. The distributive law states that the same product results in multiplication when performed on a set of numbers as when performed on members of the set individually.

 

a × (b + c)  =  a × b  +  a × c

3 x (2 + 4) = (3 x 2) + (3 x 4)

 

3 lots of (2+4) is the same as 3 lots of 2 plus 3 lots of 4

We can say that the (x3) is distributed across the 2 + 4, so we get 3 x 2 and 3 x 4.

Intersection

The intersection of two sets A and B is shown above in the picture.

The intersection of sets is a set containing every item common in both or all of the sets.

Lets say set A is {1, 2, 3, 4, 5}

         and set B is {3, 4, 5, 6, 7} 

The items common to both sets are 3, 4 and 5, so

A intersection B is {3, 4, 5}

It is usually written as A∩B.

Intersection is associative. We can write:

A âˆ© (B âˆ© C) = (A âˆ© B) ∩ C

Difference and complement

The symmetric difference between two sets (as in the picture) is a set containing everything in A and B except the items common to both.

So if A = {1, 2, 3, 4, 5}

  and B = {3, 4, 5, 6, 7}

then the symmetric difference is {1, 2, 6, 7}

 

The complement of A refers to everything that is not inside A. 

 

 

So here, the complement of A is 

shown to be everything outside

of A, including what is in B, if it

is also in A.

 

 

 

 

 

 

If we said the complement of A in B,

we could write it as B-A.

That would give us this:

This is also known as the relative 

compliment of A in B.

bottom of page