Saturday, 6 August 2016

Sets

SETS

What Is Set?

Set, is a basic concept of mathematics. The concept of a set is inseparable from a concept of an element. Sets have (or contain) elements, elements belong to sets. Roughly speaking, the terms setcollectionconglamerationclass,assemblygrouppileheap and such might have been interchangeable, except that some of them have acquired special meanings in mathematics.
The fact that element a belongs to set A is expressed as a ∈ A. If all elements of set A also belong to set B then A is called a subset of BA ⊂ B. Every set is a subset of itself: A ⊂ A. As such, it is called an improper subset of itself. If it is important to distinguish between proper and improper subsets then in addition to B ⊂ A we sometimes use B ⊆ A. If the latter is used then B ⊂ A implies B ≠ A.
Algebraically, A ⊆ B is equivalent to either A = A∩B or B = A∪B.
The empty set - Ø - that has no elements is a subset of every set. This is because x ∈ Ø is false for any x and, therefore, the implication x ∈ Ø ⇒ x ∈ A is true for any set A.
There are various operations that defined over sets: intersection AB, union AB, symmetric difference A^B. It is common to restrict consideration only to the subsets of a particular "large" set, say X, in which case we also introduce a unary operation c - passing to a complement:
x ∈ Ac iff, x ∈ X and x ∉ A.
Complements satisfy de Morgan's Laws:
(AB)c = AcBc and (AB)c = AcBc.
Sets may be finite or infinite.

The set of all subsets of set A is denoted by 2A. This is because the number of the subsets of a finite set A with nelements is exactly 2n.

Addition of Sets

Sometimes in order to add one has to take the difference.Yes, that's true provided the difference is symmetric.

Several operations are customarily defined for general sets - union, intersection, difference:
  1. Union: x∈A∪B iff either x∈A or x∈B
  2. Intersection: x∈A∩B iff x∈A and x∈B
  3. Difference: x∈A-B iff x∈A and x∉B
Adding elements of one set to another, only the union is intuitively suitable to be considered as the set addition. The empty set Ø plays the role of zero. Indeed, for every set A, A∪Ø = Ø∪A = A. The union is clearly associative. However, it's impossible to find a set (-A) such that A∪(-A) = Ø if A itself is not empty. This is because the union of two sets is a superset of each operand.

There is one additional set operation that is worth paying attention to:
  1. Symmetric Difference: x∈A^B iff either x∈A or x∈B but x∉A∩B
There are several ways to define this operation:
  1. A^B = (A∪B) - (A∩B)
  2. A^B = (A - B)∪(B - A)
The latter is obviously suggestive of the name's origin. A nice feature of this operation is that, for any set A, A^A = Øso that in an algraic sense A = -A, and if symmetric difference satisfies the rest of the conditions, it may be legitimately called a "set addition". Clearly A^Ø = Ø^A = A. Also, the operation is commutative by definition. It's a good exercise to check that it's also associative.
Symmetric difference is reminiscent of the XOR operation defined for Boolean Algebras. So that the latter may be considered as addition defined for Boolean Algebras.

Arithmetic and Geometic Progression

ARITHMETIC AND GEOMETIC PROGRESSION

Definition:

In mathematics, an arithmetic progression (AP) or arithmetic sequence is a sequence of numbers such that the difference between the consecutive terms is constant. For instance, the sequence 5, 7, 9, 11, 13, 15, etc, is an arithmetic progression with common difference of 2.

Formula: Tn = a + (n-1) d
                        a = 1st term
                        n = nth term
                        d = common difference
What is the 10th term?
T10 = 1 + (10-1) 2
        = 1 + (9) (2)
        = 1 + 18
        = 19
What is the first 3 terms?
T2 = 1 + (2-1) 3          T3 = 1 + (3-1) 3
      = 4                              = 7
What is the 16th term?
T16 = 8 (16-1) = 3
        = 8 + (15) (-3)
        = 8 + (-45)
        = -37 

Example:

-  Write down the first four terms of AP with first term 8 and difference 7.

T2 = 8 + (2-1) 7          T3 = 8 + (3-1) 7          T4 = 8 + (4-1) 7

      = 15                            =22                             = 29
- Write down the first four terms of AP with first term 2 and difference -5.
T2 = 2 + (2-1) -5         T3 = 2 + (3-1) -5         T4 = 2 + (4-1) -5

      = -3                             = -8                             = -13
- Write down the 10th and 19th terms of the AP.
i) 8, 11, 14...
T10 = 8 + (10-1) 3        T19 = 8 + (19-1) 3
        = 8 + (9) (3)                  = 8+ (18) (3)
        = 8 + 27                         = 8 + 54
        = 35                              = 62
ii) 8, 5, 2...
T10 = 8 + (10-1) -3       T19 = 8 + (19-1) -3
        = 8 + (9) (-3)                = 8 + (18) (-3)
        =8 + (-27)                      = 8 + (-54)
        = -19                             = -46



SUM OF ARITHMETIC PROGRESSION


Definition:
The sum of a finite arithmetic progression is called an arithmetic series. The behavior of the arithmetic progression depends on the common difference d. If the common difference  is: Positive, then the members (terms) will grow towards positive infinity.

Formula: Sn = n/2 [2a + (n-1)d]

                        a = 1st term

                        n = nth term

                        d = difference

                     Sn = Sum of AP

Find the sum of the first 50 terms of the AP?

S50 = 50/2 [2 x 1 + (50-1) (2)]

S50 = 2,500

Example:

1) Find the sum of the first 37 of AP 4, -3, -10...

a = 4

d = -7

S37 = 37/2 [2 x 4 + (37-1) (-7)]

S37 = -4,514

2) An AP has first term 4 and difference 1/2. Find:
- a) Sum of the first 25 terms          - b) Sum of the first 100 terms

a = 4                                                              a = 4

d = 1/2                                                          d = 1/2

n = 25                                                            n = 100

S25 = 25/2 [2 x 4 + (25-1) (1/2)]             S100 = 100/2 [2 x 4 + (100-1) (1/2)]

S25 = 250                                                  S100 = 2.875



GEOMETRIC PROGRESSION


Introduction:
In mathematics, a geometric progression, also known as a geometric sequence, is a sequence of numbers where each term after the first is found by multiplying the previous one by a fixed, non-zero number called the common ratio.

Formula: Tn = ar n-1

                        a = 1st term

                        r = common ratio

                        n = nth term

2, 6, 18, 54,...     r = 2nd term/1st term 
                                = 6/2 
                                = 3

Find the 15th term of the GP?

T15 = 2 x 3 15-1
       = 9, 565,938

Example:

1) Find the 10th and 17th term of GP with first term 3 and common ratio 2.

- a) a = 3                 b)   a = 3

       r = 2                         r = 2

      n = 10th                         n = 17th

T10 = 3 x 2 10-1           T10 = 3 x 2 17-1

        1,536                    = 196, 608

2) Find the 7th term of the GP 2, -6, 18....

- r = 2nd term/1st term

     = -8/2

     = -3



THANKS FOR LEARNING, COME AGAIN :)

Linear Programming

LINEAR PROGRAMMING

Linear Programming? ouch...sounds really difficult, but it’s just a neat way to use math to find out the best way to do things – for example, how many things to make or buy.  It usually involves a system of linear inequalities, called constraints, but in the end, we want to either maximize something (like profit) or minimize something (like cost).   Whatever we’re maximizing or minimizing is called the objective function.
Linear programming was developed during the second World War for solving military logistic problems.  It is used extensively today in business to minimize costs and maximize profits.

A short explanation is given what Linear programming is and some basic knowledge you need to know.
A linear programming problem is mathematically formulated as follows:
  • linear function to be maximized or minimized
e.g.
maximize c1 x1 + c2 x2
  • Problem constraints of the following form
e.g.
a11 x1 + a12 x2 <= b1
a21 x1 + a22 x2 <= b2
a31 x1 + a32 x2 <= b3
  • Default lower bounds of zero on all variables.
The problem is usually expressed in matrix form, and then becomes:
     maximize     CT x
     subject to   A x <= B
                  x >= 0
So a linear programming model consists of one objective which is a linear equation that must be maximized or minimized. Then there are a number of linearinequalities or constraints.
cT, A and B are constant matrixes. x are the variables (unknowns). All of them are real, continue values.
Note the default lower bounds of zero on all variables x. People tend to forget this build-in default. If no negative (or negative infinite) lower bound is explicitely set on variables, they can and will take only positive (zero included) values.
The inequalities can be <=, >= or =
Because all numbers are real values, <= is the same as < and >= is the same as >
Also note that both objective function and constraints must be linear equations. This means that no variables can be multiplied with each other.
This formulation is called the Standard form. It is the usual and most intuitive form of describing a linear programming problem.
Example:
     minimize     3 x1 - x2
     subject to    -x1 + 6 x2 - x3   + x4 >= -3
                         7 x2      + 2 x4  =  5
                    x1 +   x2 + x3         =  1
                                x3 +   x4 <=  2
Sometimes, these problems are formulated in the canonical form. All inequalities are converted to equalities by adding an extra variable where needed:
     maximize     CT x
     subject to   A x = B
                  x >= 0
Above example can then be written as:
     minimize     3 x1 - x2
     subject to    -x1 + 6 x2 - x3   + x4 - s = -3
                         7 x2      + 2 x4     =  5
                    x1 +   x2 + x3            =  1
                                x3 +   x4 + t =  2
So everywhere an equality was specified, an extra variable is introduced and subtracted (if it was >) or added (if it was <) to the constraint. These variables also only take positive (or zero) values only. These extra variables are called slack or surplus variables.
lp_solve add's these variables automatically to its internal structure. The formulator doesn't have to do it and it is even better not to. There will be fewer variables in the model and thus quicker to solve.

The right hand side (RHS), the B-vector, must be a constant matrix. Some people see this as a problem, but it isn't The RHS can always be brought to the left by a simple operation:
     A x <= B
Is equal to:
     A x - B <= 0
So if B is not constant, just do that.
Basic mathematics also states that if a constraint is multiplied by a negative constant, that the inequality changes from direction. For example:
     5 x1 - 2 x2 >= 3
If multiplied by -1, it becomes:
    -5 x1 + 2 x2 <= -3
If the objective is multiplied by -1, then maximization becomes minimization and the other way around. For example:
    minimize     3 x1 - x2
Can also be written as:
    maximize     -3 x1 + x2
The result will be the same, but changed from sign.

Bounds

Minima and maxima on single variables are special cases of restrictions. They are called bounds. The optimization algorithm can handle these bounds more effeciently than other restrictions. They consume less memory and the algorithm is faster with them. As already specified, there is by default an implicit lower bound of zero on each variable. Only when explicitly another lower bound is set, the default of 0 is overruled. This other bound can be negative also. There is no default upper bound on variables. Almost all solvers support bounds on variables. So does lp_solve.

Ranges

Frequently, it happens that on the same equation a less than and a greater than restriction must be set. Instead of adding two extra restrictions to the model, it is more performant and less memory consument to only add one restiction with either the less than or greater than restriction and put the other inequality on that same constraint by means of a range. Not all solvers support this feature but lp_solve does.

Integer and binary variables

By default, all variables are real. Sometimes it is required that one or more variables must be integer. It is not possible to just solve the model as is and then round to the nearest solution. At best, this result will maybe furfill all constraints, but you cannot be sure of. As you cannot be sure of the fact that this is the most optimal solution. Problems with integer variables are called integer or descrete programming problems. If all variables are integer it is called a pure integer programming problem, else it is a mixed integer programming problem. A special case of integer variables are binary variables. These are variables that can only take 0 or 1 as value. They are used quite frequently to program discontinue conditions. lp_solve can handle integer and binary variables. Binary variables are defined as integer variables with a maximum (upper bound) of 1 on them. Semi-continuous variables
Semi-continuous variables are variables that must take a value between their minimum and maximum or zero. So these variables are treated the same as regular variables, except that a value of zero is also accepted, even if there is a minimum bigger than zero is set on the variable. 

Special ordered sets (SOS)

A specially ordered set of degree N is a collection of variables where at most N variables may be non-zero. The non-zero variables must be contiguous (neighbours) sorted by the ascending value of their respective unique weights. In lp_solve, specially ordered sets may be of any cardinal type 1, 2, and higher, and may be overlapping. The number of variables in the set must be equal to, or exceed the cardinal SOS order. 
lp_solve uses the simplex algorithm to solve these problems. To solve the integer restrictions, the branch and bound (B&B) method is used.

Inequalities

INEQUALITIES

In this section, you will learn how so solve inequalities. "Solving'' an inequality means finding all of its solutions. A "solution'' of an inequality is a number which when substituted for the variable makes the inequality a true statement.

Here is an example: Consider the inequality




When we substitute 8 for x, the inequality becomes 8-2 > 5. Thus, x=8 is a solution of the inequality. On the other hand, substituting -2 for x yields the false statement (-2)-2 > 5. Thus x = -2 is NOT a solution of the inequality. Inequalities usually have many solutions.
As in the case of solving equations, there are certain manipulations of the inequality which do not change the solutions. Here is a list of "permissible'' manipulations:

Rule 1. Adding/subtracting the same number on both sides.

Example: The inequality x-2>5 has the same solutions as the inequality x > 7. (The second inequality was obtained from the first one by adding 2 on both sides.)

Rule 2. Switching sides and changing the orientation of the inequality sign

Example: The inequality 5-x> 4 has the same solutions as the inequality 4 < 5 - x. (We have switched sides and turned the ``>'' into a ``<'').
Let's solve some inequalities:

Example 1: step by step
Consider the inequality:






The basic strategy for inequalities and equations is the same: isolate x on one side, and put the "other stuff" on the other side. Following this strategy, let's move +5 to the right side. We accomplish this by subtracting 5 on both sides (Rule 1) to obtain




after simplification we obtain





Once we divide by +2 on both sides (Rule 3a), we have succeeded in isolating x on the left:







or simplified,




All real numbers less than 1 solve the inequality. We say that the "set of solutions'' of the inequality consists of all real numbers less than 1. In interval notation, the set of solutions is the interval tex2html_wrap_inline187 .





Now you can try to solve some exercise:

Exercise 1:
Find all the solutions of inequality





Answer:




Exercise 2:
Solve the inequality: 






Answer:





Keep trying, it fun :)




Logarithms

LOGARITHMS

What is Logarithm?
A logarithm is the power to which a number must be raised in order to get some other number.
For example, the base ten logarithm of 100 is 2, because ten raised to the power of two is 100:
log 100 = 2
because,
102 = 100

Properties for Condensing Logarithms

Property 1: 0=loga  1= Zero-Exponent Rule
Property 2: 1 = loga
Property 3: loga x + loga y loga (xy) – Product Rule
Property 4: loga x – loga y = loga (x/y) – Quantient Rule
Property 5: y loga x = loga x3 – Power Rule

What is Exponent in Logarithms?
An exponent refers to the number of times a number is multiplied by itself.

For example, 2 to the 3rd (written like this: 23) means:
2 x 2 x 2 = 8.
23 is not the same as 2 x 3 = 6.

*Remember that a number raised to the power of 1 is itself*.
  For example:
                         a1 = a
                         51 = 5

There are some special cases:

Question 1.  a0 = 1
(When an exponent is zero, as in 60, the expression is always equal to 1).
    a0 = 1
    60 = 1
   14,3560 = 1


Question 2.  a-m = 1 / am
(When an exponent is a negative number, the result is always a fraction. Fractions consist of a numerator over a denominator. In this instance, the numerator is always 1. To find the denominator, pretend that the negative exponent is positive, and raise the number to that power, like this):
    a-m = 1 / am
    6-3 = 1 / 63
(You can have a variable to a given power, such as a3, which would mean a x a x a. You can also have a number to a variable power, such as 2m, which would mean 2 multiplied by itself m times. We will deal with that in a little while).

Example of Logarithm

Example Question 1: Solve log(9x+2) = 4

                                               Log3 (9x+2) = 4

                                                9x + 2 = 34

                                                9x + 2 =81

                                                X= 79/9

Final  Answer:                        log(9x+2) = 4 is x=79/9

Example Question 2: Write in exponential form:   log232 = 5.
 Final Answer:                          25 = 32.

   Example Question 3:  Write in logarithmic form:  4−2  =   1
16
.
  Final Answer:                             log4 1
16
 = −2.




  Here the questions for you to solve: 


  Have a nice day :)