text:
High School Mathematics Extensions/Logic

Introduction
Logic is the study of the way we reason. In this chapter, we focus on the methods of logical reasoning, i.e. digital logic, predicate calculus, application to proofs and the (insanely) fun logical puzzles.

Boolean algebra
In the black and white world of ideals, there is absolute truth. That is to say everything is either true or false. With this philosophical backdrop, we consider the following examples:
 * "One plus one equals two." True or false?

That is (without a doubt) true!

 * "1 + 1 = 2 AND 2 + 2 = 4." True or false?

That is also true.

But what about:
 * "1 + 1 = 3 OR Sydney is in Australia" True or false?

It is true! Although 1 + 1 = 3 is not true, the OR in the statement made the whole statement to be true if at least one of the statements is true.

Now let's consider a more puzzling example
 * "2 + 2 = 4 OR 1 + 1 = 3 AND 1 - 3 = -1" True or false?

The truth or falsity of the statements depends on the order in which you evaluate the statement. If you evaluate "2 + 2 = 4 OR 1 + 1 = 3" first, the statement is false, and otherwise true. As in ordinary algebra, it is necessary that we define some rules to govern the order of evaluation, so we don't have to deal with ambiguity.

Before we decide which order to evaluate the statements in, we do what most mathematician love to do -- replace sentences with symbols. Let x represent the truth or falsity of the statement 2 + 2 = 4. Let y represent the truth or falsity of the statement 1 + 1 = 3. Let z represent the truth or falsity of the statement 1 - 3 = -1.

Then the above example can be rewritten in a more compact way:
 * x OR y AND z

To go one step further, mathematicians also replace OR by + and AND by ×, the statement becomes:
 * $$x + y \times z$$

Now that the order of precedence is clear. We evaluate (y AND z) first and then OR it with x. The statement "x + yz" is true, or symbolically
 * $$x+yz=1$$

where the number 1 represents "true".

There is a good reason why we choose the multiplicative sign for the AND operation. As we shall see later, we can draw some parallels between the AND operation and multiplication.

The Boolean algebra we are about to investigate is named after the British mathematician George Boole. Boolean algebra is about two things -- "true" or "false" which are often represented by the numbers 1 and 0 respectively. Alternative, T and F are also used.

Boolean algebra has operations (AND and OR) analogous to the ordinary algebra that we know and love.

Basic Truth tables
We have all had to memorize the 9 by 9 multiplication table and now we know it all by heart. In Boolean algebra, the idea of a truth table is somewhat similar.

Let's consider the AND operation which is analogous to the multiplication. We want to consider:
 * x AND y

where and x and y each represent a true or false statement (e.g. It is raining today). It is true if and only if both x and y are true, in table form:

We shall use 1 instead of T and 0 instead of F from now on.

Now you should be able to see why we say AND is analogous to multiplication, we shall replace the AND by ×, so x AND y becomes x×y (or just xy). From the AND truth table, we have:
 * 0 × 0 = 0
 * 0 × 1 = 0
 * 1 × 0 = 0
 * 1 × 1 = 1

To the OR operation.  x OR y  is FALSE if and only if both x and y are false. In table form:

We say OR is almost analogous to addition. We shall illustrate this by replacing OR with +:
 * 0 + 0 = 0
 * 0 + 1 = 1
 * 1 + 0 = 1
 * 1 + 1 = 1 (like 1 OR 1 is 1)

The NOT operation is not a binary operation like AND and OR, but a unary operation, meaning it works with one argument. NOT x  is true if x is false and false if x is true. In table form:

In symbolic form, NOT x is denoted x' or ~x (or by a bar over the top of x).

Alternative notations:
 * $$x \times y = x \wedge y$$

and
 * $$x + y = x \vee y$$

Compound truth tables
The three truth tables presented above are the most basic of truth tables and they serve as the building blocks for more complex ones. Suppose we want to construct a truth table for xy + z (i.e. x AND y OR z). Notice this table involves three variables (x, y and z), so we would expect it to be bigger than the previous ones.

To construct a truth table, firstly we write down all the possible combinations of the three variables:

There is a pattern to the way the combinations are written down. We always start with 000 and end with 111. As to the middle part, it is up to the reader to figure out.

We then complete the table by hand computing what value each combination is going to produce using the expression xy + z. For example:
 * 000
 * x = 0, y = 0 and z = 0
 * xy + z = 0

 * 001
 * x = 0, y = 0 and z = 1
 * xy + z = 1

We continue in this way until we fill up the whole table

The procedure we follow to produce truth tables are now clear. Here are a few more examples of truth tables.

Example 1 -- x + y + z

 Example 2 -- (x + yz)'

When an expression is hard to compute, we can first compute intermediate results and then the final result.

 Example 3 -- (x + yz')w

Exercise
Produce the truth tables for the following operations:
 * 1) NAND: x NAND y = NOT (x AND y)
 * 2) NOR: x NOR y = NOT (x OR y)
 * 3) XOR: x XOR y is true if and ONLY if one of x or y is true.

Produce truth tables for:
 * 1) xyz
 * 2) x'y'z'
 * 3) xyz + xy'z
 * xz
 * 1) (x + y)'
 * 2) x'y'
 * 3) (xy)'
 * 4) x' + y'

Laws of Boolean algebra
In ordinary algebra, two expressions may be equivalent to each other, e.g. xz + yz = (x + y)z. The same can be said of Boolean algebra. Let's construct truth tables for:
 * xz + yz
 * (x + y)z

xz + yz

(x + y)z

By comparing the two tables, you will have noticed that the outputs (i.e. the last column) of the two tables are the same!

Definition
 * We say two Boolean expressions are equivalent if the output of their truth tables are the same.

We list a few expressions that are equivalent to each other
 * x + 0 = x
 * x × 1 = x
 * xz + yz = (x + y)z
 * x + x' = 1
 * x × x' = 0
 * x × x = x
 * x + yz = (x + y)(x + z)

Take a few moments to think about why each of those laws might be true.

The last law is not obvious but we can prove that it's true using the other laws:

\begin{matrix} (x + y)(x + z) &=& x(x + z) + y(x + z)\\ &=& xx + xz + xy + yz\\ &=& x + xz + xy + yz\\ &=& x(1 + z + y) + yz\\ &=& x + yz \end{matrix} $$

It has been said: "the only thing to remember in mathematics is that there is nothing to remember. Remember that!". You should not try to commit to memory the laws as they are stated, because some of them are so deadly obvious once you are familiar with the AND, OR and NOT operations. You should only try to remember those things that are most basic, once a high level of familiarity is developed, you will agree there really isn't anything to remember.

Simplification
Once we have those laws, we will want to simplify Boolean expressions just like we do in ordinary algebra. We can all simplify the following example with ease:

\begin{matrix} xyzw' + xyzw &=& xyz(w + w')\\ &=& xyz \end{matrix} $$

the same can be said about:

\begin{matrix} (x + y)(x' + y') &=& x(x' + y') + y(x' + y')\\ &=& xx' + xy' + yx' + yy'\\ &=& 0 + xy' + yx' + 0\\ &=& xy' + yx' \end{matrix} $$

From those two examples we can see that complex-looking expressions can be reduced very significantly. Of particular interest are expressions of the form of a sum-of-product, for example:
 * xyz + xyz' + xy'z + x'yz + x'y'z' + x'y'z

We can factorise and simplify the expression as follows

xyz + xyz' + xy'z + x'yz + x'y'z' + x'y'z $$

=\ xy(z + z') + xy'z + x'yz + x'y'(z' + z) $$

=\  xy + xy'z + x'yz + x'y' $$

=\ x(y + y'z) + x'(yz + y') $$

It is only hard to go any further, although we can. We use the identity:
 * x + yz = (x + y)(x + z)

If the next step is unclear, try constructing truth tables as an aid to understanding.

\begin{matrix} &=&\ x(y + z) + x'(z + y')\\ &=&\ xy + xz + x'z + x'y'\\ &=&\ xy + (x + x')z + x'y'\\ &=&\ xy + z + x'y'\\ \end{matrix} $$

And this is as far as we can go using the algebraic approach (or any other approach). The algebraic approach to simplification relies on the principle of elimination. Consider, in ordinary algebra:
 * x + y - x

We simplify by rearranging the expression as follows
 * (x - x) + y = y

Although we only go through the process in our head, the idea is clear: we bring together terms that cancel themselves out and so the expression is simplified.

De Morgan's theorems
So far we have only dealt with expressions in the form of a sum of products e.g. xyz + x'z + y'z'. De Morgan's theorems help us to deal with another type of Boolean expressions. We revisit the AND and OR truth tables:

{

You would be correct to suspect that the two operations are connected somehow due to the similarities between the two tables. In fact, if you invert the AND operation, i.e. you perform the NOT operations on x AND y. The outputs of the two operations are almost the same: {

The connection between AND, OR and NOT is revealed by reversing the output of x + y by replacing it with x' + y'. {

Now the two outputs match and so we can equate them:
 * (xy)' = x' + y'

this is one of de Morgan's laws. The other which can be derived using a similar process is:
 * (x + y)' = x'y'

We can apply those two laws to simplify equations:

Example 1 Express x in sum of product form

\begin{matrix} x &=& (ab' + c)'\\ &=& (ab')'c'\\ &=& (a' + b)c'\\ &=& a'c' + bc' \end{matrix} $$

Example 2 Express x in sum of product form

\begin{matrix} x &=& (a + b + c)'\\ &=& (a + b)'c'\\ &=& a'b'c'\\ \end{matrix} $$This points to a possible extension of De Morgan's laws to 3 or more variables.

Example 3 Express x in sum of product form

\begin{matrix} x &=& [(a' + c)\cdot (b + d')]'\\ &=& (a' + c)' + (b + d')'\\ &=& ac' + b'd\\ \end{matrix} $$

Example 4 Express x in sum of product form

\begin{matrix} x &=& [(a + bc)\cdot (d + ef)]'\\ &=& (a + bc)' + (d + ef)'\\ &=& a'(bc)' + d'(ef)'\\ &=& a'(b' + c') + d'(e' + f')\\ &=& a'b' + a'c' + d'e' + d'f'\\ \end{matrix} $$

Another thing of interest we learnt is that we can reverse the truth table of any expression by replacing each of its variables by their opposites, i.e. replace x by x' and y' by y etc. This result shouldn't have been a surprise at all, try a few examples yourself.

De Morgan's laws
 * $$(x + y)' = x'y'$$
 * $$(xy)' = x' + y'$$

Exercise

 * 1) Express in simplified sum-of-product form:
 * 2) z = ab'c' + ab'c + abc
 * 3) z = ab(c + d)
 * 4) z = (a + b)(c + d + f)
 * 5) z = a'c(a'bd)' + a'bc'd' + ab'c
 * 6) z = (a' + b)(a + b + d)d'
 * 7) Show that x + yz is equivalent to (x + y)(x + z)

Propositions
We have been dealing with propositions since the start of this chapter, although we are not told they are propositions. A proposition is simply a statement (or sentence) that is either TRUE or FALSE. Hence, we can use Boolean algebra to handle propositions.

There are two special types of propositions -- tautology and contradiction. A tautology is a proposition that is always TRUE, e.g. "1 + 1 = 2". A contradiction is the opposite of a tautology, it is a proposition that is always FALSE, e.g. 1 + 1 = 3. As usual, we use 1 to represent TRUE and 0 to represent FALSE. Please note that opinions are not propositions, e.g. "42 is an awesome number" is just an opinion, its truth or falsity is not universal, meaning some think it's true, some do not.

Examples

 * "It is raining today" is a proposition.
 * "Sydney is in Australia" is a proposition.
 * "1 + 2 + 3 + 4 + 5 = 16" is a proposition.
 * "Earth is a perfect sphere" is a proposition.
 * "How do you do?" is not a proposition - it's a question.
 * "Go clean your room!" is not a proposition - it's a command.
 * "Martians exist" is a proposition.

Since each proposition can only take two values (TRUE or FALSE), we can represent each by a variable and decide whether compound propositions are true by using Boolean algebra, just like we have been doing. For example "It is always hot in Antarctica OR 1 + 1 = 2" will be evaluated as true.

Implications
Propositions of the type if something something then something something are called implications. The logic of implications are widely applicable in mathematics, computer science and general everyday common sense reasoning! Let's start with a simple example
 * "If 1 + 1 = 2 then 2 - 1 = 1"

is an example of implication, it simply says that 2 - 1 = 1 is a consequence of 1 + 1 = 2. It's like a cause and effect relationship. Consider this example:
 * John says: "If I become a millionaire, then I will donate $500,000 to the Red Cross."

There are four situations:
 * John becomes a millionaire and donates $500,000 to the Red Cross
 * John becomes a millionaire and does not donate $500,000 to the Red Cross
 * John does not become a millionaire and donates $500,000 to the Red Cross
 * John does not become a millionaire and does not donate $500,000 to the Red Cross

In which of the four situations did John NOT fulfill his promise? Clearly, if and only if the second situation occurred. So, we say the proposition is FALSE if and only if John becomes a millionaire and does not donate. If John did not become a millionaire then he can't break his promise, because his promise is now claiming nothing, therefore it must be evaluated TRUE.

If x and y are two propositions, x implies y (if x then y), or symbolically
 * $$x \Rightarrow y$$

has the following truth table:

For emphasis, $$x \Rightarrow y$$ is FALSE if and only if x is true and y false. If x is FALSE, it does not matter what value y takes, the proposition is automatically TRUE. On a side note, the two propositions x and y need not have anything to do with each other, e.g. "1 + 1 = 2 implies Australia is in the southern hemisphere" evaluates to TRUE!

If
 * $$(x \Rightarrow y) \ \mbox{AND} \ (y \Rightarrow x)$$

then we express it symbolically as
 * $$x \Leftrightarrow y$$.

It is a two way implication which translates to x is TRUE if and only if y is true. The if and only if operation has the following truth table:

The two new operations we have introduced are not really new, they are just combinations of AND, OR and NOT. For example:
 * $$x \Rightarrow y = x' + y$$

Check it with a truth table. Because we can express the implication operations in terms of AND, OR and NOT, we have open them to manipulation by Boolean algebra and de Morgan's laws.

Example 1 Is the following proposition a tautology (a proposition that's always true)
 * $$[(x \Rightarrow y)(y \Rightarrow z)] \Rightarrow (x \Rightarrow z)$$

Solution 1
 * $$=\ [(x \Rightarrow y)(y \Rightarrow z)] \Rightarrow (x \Rightarrow z)$$
 * $$=\ [(x' + y)(y' + z)]' + (x' + z)$$
 * $$=\ (x' + y)' + (y' + z)' + x' + z$$
 * $$=\ xy' + yz' + x' + z$$
 * $$=\ y' + y + x' + z$$
 * $$=\ 1$$

Therefore it's a tautology.

Solution 2 A somewhat easier solution is to draw up a truth table of the proposition, and note that the output column are all 1s. Therefore the proposition is a tautology, because the output is 1 regardless of the inputs (i.e. x, y and z).

Example 2 Show that the proposition z is a contradiction (a proposition that is always false):
 * z = xy(x + y)'

Solution

\begin{matrix} z &=& xy(x + y)'\\ &=& xy(x'y')\\ &=& 0\\ \end{matrix} $$ Therefore it's a contradiction.

Back to Example 1, :$$[(x \Rightarrow y)(y \Rightarrow z)] \Rightarrow (x \Rightarrow z)$$. This isn't just a slab of symbols, you should be able translate it into everyday language and understand intuitively why it's true.

Exercises

 * 1) Decide whether the following propositions are true or false:
 * 2) If 1 + 2 = 3, then 2 + 2 = 5
 * 3) If 1 + 1 = 3, then boys don't like mud
 * 4) Show that the following pair of propositions are equivalent
 * 5) $$x \Rightarrow y$$ : $$y' \Rightarrow x'$$

Logic Puzzles
Puzzle is an all-encompassing word, it refers to anything trivial that requires solving. Here is a collection of logic puzzles that we can solve using Boolean algebra.

Example 1

We have two type of people -- knights or knaves. A knight always tell the truth but the knaves always lie.

Two people, Alex and Barbara, are chatting. Alex says :"We are both knaves"

Who is who?

We can probably work out that Alex is a knave in our heads, but the algebraic approach to determine Alex 's identity is as follows:
 * Let A be TRUE if Alex is a knight
 * Let B be TRUE if Barbara is a knight
 * There are two situations, either:
 * Alex is a knight and what he says is TRUE, OR
 * he is NOT a knight and what he says is FALSE.
 * There we have it, we only need to translate it into symbols:
 * A(A'B') + A'[(A'B')'] = 1

we simplify:
 * (AA')B' + A'[A + B] = 1
 * A'A + A'B = 1
 * A'B = 1

Therefore A is FALSE and B is TRUE. Therefore Alex is a knave and Barbara a knight.

Example 2

There are three businessmen, conveniently named Archie, Billy and Charley, who order martinis together every weekend according to the following rules:

 * 1) If A orders a martini, so does B.
 * 2) Either B or C always order a martini, but never at the same lunch.
 * 3) Either A or C always order a martini (or both)
 * 4) If C orders a martini, so does A.

 * 1) $$A \Rightarrow B$$ or $$A' + B = 1$$ (simplified from: $$AB + A'B' + A'B = 1$$
 * 2) $$B'C + BC' = 1$$
 * 3) $$A + C = 1$$
 * 4) $$C \Rightarrow A$$ or $$C' + A = 1$$ (simplified from: $$CA + C'A' + C'A = 1$$

Putting all these into one formula and simplifying:

$$ \begin{matrix} 1 &=& (A' + B) (B'C + BC') (A + C) (C' + A) \\ &=& (A' + B) (B'C + BC') (AC' + AA + CC' + AC) \\ &=& (A' + B) (B'C + BC') (AC' + A + 0 + AC) \\ &=& (A' + B) (B'C + BC') (AC' + A + AC) \\ &=& (A' + B) (B'C + BC') (C' + 1 + C)A \\ &=& (A' + B) (B'C + BC') (1)A \\ &=& (A' + B) (B'C + BC') A \\ &&\mbox{Now that we know that }A = 1\mbox{ we can substitute that in:} \\ &=& (0 + B) (B'C + BC') 1 \\ &=& (B) (B'C + BC') \\ &&\mbox{Now that we know that }B = 1\mbox{ we can substitute that in:} \\ &=& (1) (0C + 1C') \\ &=& C' \\ &&\mbox{If }1 = C'\mbox{ then }C = 0 \\ &&ABC' = 1 \end{matrix} $$

Exercises
Please go to Puzzles/Logic puzzles.

Problem Set
1. Decide whether the following propositions are equivalent:
 * $$x'\Rightarrow y'$$
 * $$y\Rightarrow x$$

2. Express in simplest sum-of-product form the following proposition:
 * $$(x \Leftrightarrow y) \Rightarrow z$$

3. Translate the following sentences into symbolic form and decide if it's true:
 * a. For all x, if x2 = 9 then x2 - 6x - 3 = 0
 * b. We can find a x, such that x2 = 9 and x2 - 6x - 3 = 0 are both true.

4. NAND is a binary operation:
 * x NAND y = (xy)'

Find a proposition that consists of only NAND operators, equivalent to:
 * (x + y)w + z

5. Do the same with NOR operators. Recall that x NOR y = (x + y)'


text:
Puzzles/Logic puzzles/10 Hats

Puzzles | Logic puzzles | 10 Hats

Ten students are caught cheating on a math exam and the teacher wants to give them a final chance. He makes them sit on separate rows, each one behind the other, facing the board. Each one sees all others at the front (i.e. 10th row student sees 9 students, 9th sees 8 students, ..., 1st one sees no one).

He puts a hat on each student's head randomly, white or red. If at least 9 of them guess what color hat is on his or her head, the teacher will release them without punishment. Each student is allowed to talk once and may only say one word, which is his or her guess. They may decide on a strategy before starting to talk. Once they begin, they are not allowed to say or do anything else but guessing a color. Only one student is allowed to make a mistake.

What kind of a strategy should they follow?

See also Infinite Hats.

Solution

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

title: Puzzles/Logic puzzles/10 Hats


text:
Puzzles/Logic puzzles/10 Hats/Solution

Puzzles | Logic puzzles | 10 Hats | Solution

= Solution 1 = The 10th student says white if she sees an even number of white hats and red if she sees an odd number of white hats (she will be the only one that could make a mistake). The 9th student now sees 8 hats in front of her. Say X of them are white. Now there are four possibilities: The 9th student can figure out which case occurs and tell her correct hat color. From then on the students have to subtract the correctly guessed hats from the total and apply the even/odd reasoning again (using what the 10th student has said and counting the number of white hats in front of them).
 * 10th student said white and X is even: She wears a red hat
 * 10th student said white and X is odd: She wears a white hat
 * 10th student said red and X is even: She wears a white hat
 * 10th student said red and X is odd: She wears a red hat

= Solution 2 =

There is a slight variation on this solution by transformation: instead of wearing red and white hats, the students wear hats labeled 0 or 1. Let x1,...,x10 be the numbers on the students' hats. Let a1,...,a10 be the students' answers. The students answer in decreasing order as in the first solution. The answers are defined recursively as
 * a10 = (x1+...+x9) mod 2
 * a9 = (x1+...+x8+a10) mod 2
 * a8 = (x1+...+x7+a9+a10) mod 2

These equations can be succinctly described as follows: each student sums up the numbers they see and the numbers they've heard. The student says one if the grand total is odd and zero otherwise. To prove that ai === xi mod 2, let si = x1+...+xi and use induction.

Base case: a9 === x9 mod 2

Proof:
 * s8 + x9 === a10 mod 2
 * x9 === a10 + s8 mod 2
 * x9 === a9 mod 2

Inductive step: Assume ai === xi mod 2 for i = n+1,..., 9 Then
 * an === s(n-1) + a(n+1) +... + a10 mod 2 (by definition)
 * an === s(n-1) + (s9 - sn) + a10 mod 2 (by inductive assumption)
 * an === xn + s9 + a10 mod 2
 * an === xn mod 2 (since s9 + a10 is even)

Thus ai === xi mod 2 for i = n, n+1,..., 9

Therefore ai === xi mod 2 for i = 1,...,9 and at most one answer (a10) is incorrect. = Solution 3 = The 10th student will see 9 hats with only one or two colours. One of those colours has to have an odd number showing. The initial setup might be easier for the students if the 10th student just said which colour has an odd number showing. The rest of the students will be correct through the same logical reasoning as in Solution 1.

title: Puzzles/Logic puzzles/10 Hats/Solution


text:
French/Lessons/Weather

The preposition means at or in:

The contraction is used in place of à le (singular):

Likewise, the contraction is used in place of à les (plural).

Mireille:

Monique:

 * Monique could also use the question form instead of the intonation given above:
 * Est-ce qu'il va pleuvoir aujourd'hui ? (Pronounced eh-skeel)
 * or
 * Va-t-il pleuvoir aujourd'hui ?

Mireille:

Monique:

Marcelle:

Similar to English, pleuvoir is an : it has only a third-person singular conjugation:
 * il pleut (present)
 * il va pleuvoir or il pleuvra (future)
 * il pleuvrait (conditional).

In order to say that one did not do something, the construction must be used. The is placed before the verb, while the  is placed after.

Formation and rules
Simple negation is done by wrapping around the verb:

In a past tense, surrounds the auxiliary verb, not the participle:

When an infinitive and conjugated verb are together, usually surrounds the conjugated verb:

can also precede the infinitive for a different meaning:

precedes any pronoun relating to the verb it affects:

In spoken French, the can be omitted, leaving simply  after the verb in context:

Negation of indefinite articles
The indefinite articles un, une, and des change to de (or d’) when negating a sentence.

Note that means both the weather and the time.

The verb is translated to to go. It is irregularly conjugated (it does not count as a regular verb).

Usage
There is no present progressive tense in French, so aller in the present indicative is used to express both I go and I am going:

Aller must be used with a place and cannot stand alone.

In addition to meaning at or in, the preposition means to when used with :

An infinitive preceded by is used to say that something is going to happen in the near future:

Recall that the negative goes around the conjugated verb.

In place of a preposition and place, the pronoun, meaning there, can be used; y comes before the verb:

Remember that aller must be used with a place (there or a name) when indicating that you are going somewhere, even if a place wouldn't normally be given in English.

The negative form of aller with the y pronoun has both the verb and pronoun enclosed between ne and pas:

title: French/Lessons/Weather


text:
C++ Programming

This book covers the C++ programming language, its interactions with software design and real life use of the language. It is presented in a series of chapters as an introductory prior to advance courses but can also be used as a reference book. This is an open work; if you find any problems with terms or concepts you can help by contributing to it; your participation is needed and welcomed! You are also welcomed to state any preference, shortcomings, vision for the actual book content, structure or other conceptual matters; see this Wikibook's discussion page for the right forum for participating.

=== Preface: About the book  [ edit ] [ edit chapters list ] [ edit print version ]  ===

=== Appendix A: References Tables (used on book chapters, print version excludes the Appendix) === • Keywords • Preprocessors Directives • Standard Headers • Data Types • Operators • Standard C Library Functions • ASCII chart

Appendix B: External References
• Weblinks • Books

=== Appendix C: C++ Programming by examples [ edit ] (Compilable programs used on book chapters, print version excludes the Appendix) ===

=== Appendix D: C++ Programming - exercises [ edit ] Supporting exercises for the book content. ===

title: C++ Programming


text:
Algebra/Factoring Polynomials

=Formulas= Computing factors of polynomials requires knowledge of different formulas and some experience to find out which formula to be applied. Below, we give some important formulas:

$${x^2-y^2=(x+y)(x-y)}$$

$${x^2+2xy+y^2=(x+y)^2}$$

$${x^2-2xy+y^2=(x-y)^2}$$

$${x^3-y^3=(x-y)(x^2+xy+y^2)}$$

$${x^3+y^3=(x+y)(x^2-xy+y^2)}$$

$${a^3+b^3+c^3-3abc=(a+b+c)(a^2+b^2+c^2-ab-ac-bc)}$$

Examples
:$${a(a + b)}$$

$${x^2+3x+2}$$ $${ x^2 + y^2 = 2xy }$$ $${x(x + 1) + 2(x + 1)}$$ $${(x + 1)(x + 2)}$$

:$${(a^2 - 2ax) + (2ax - 4x^2)}$$ :$${a(a - 2x) + 2x(a - 2x)}$$ :$${(a - 2x)(a + 2x)}$$

$${x^3+8y^3}$$ $${(x^3 - 2x^2y + 4xy^2) + (2x^2y - 4xy^2 + 8y^3)}$$ $${x(x^2 - 2xy + 4y^2) + 2y(x^2 - 2xy + 4y^2)}$$ $${(x^2 - 2xy + 4y^2)(x + 2y)}$$ $${(x + 2y)(x^2 - 2xy + 4y^2)}$$

:$${(x^3 + 4x^2 - 5x) - (2x^2 + 8x - 10)}$$ :$${x(x^2 + 4x - 5) - 2(x^2 + 4x - 5)}$$ :$${(x^2 + 4x - 5)(x - 2)}$$ :$${(x - 2)(x^2 + 4x - 5)}$$ :$${(x - 2)[(x^2 - x) + (5x - 5)]}$$ :$${(x - 2)[x(x - 1) + 5(x - 1)]}$$ :$${(x - 2)(x - 1)(x + 5)}$$

$${3x^4 - 3x^3 - 2x^2 - x - 1}$$ $${(3x^4 - 3x^3 - 3x^2) + (x^2 - x - 1)}$$ $${3x^2(x^2 - x - 1) + 1(x^2 - x - 1)}$$ $${(x^2 - x - 1)(3x^2 + 1)}$$

:$${(x^4 + 4x^2 + 4) - 4x^2}$$ :$${(x^2 + 2)^2 - (2x)^2}$$ :$${(x^2 + 2x + 2)(x^2 - 2x + 2)}$$

(name thorem)

write out the coefficients and if the end is equal to zero, than it is a root

example: $${9x^2 - 6x + 9}$$

$${4r^2 - 12 + 9^2}$$

= Possible Factors =

To factor we must first look for possible factors. Possible factors are any number that might be a factor. Once we have a possible factor then we divide that number into the number we are factoring. If they divide evenly then we have a factor! The factor is the possible factor we found and the result of the division problem. Here is an example. Let's say the number we are factoring is 20. 2 is the possible factor. 20 / 2 = 10. They divide evenly which means we have a factor. The factors are 2 (the possible factor), and 10 (the result of the division problem). Now that we have a factor we start over with a new possible factor and find all of the factors.

Examples
Factor 12

First find all the possible factors

The possible factors are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, and 12

Next we will try them one by one

12/1 = 12 (1 and 12 are factors)

12/2 = 6 (2 and 6 are factors)

12/3 = 4 (3 and 4 are factors)

12/4 = 3 (we already have the factors 3 and 4)

Once we get a factor we already have then we know we have all the factors.

So the factors for 12 are 1, 2, 3, 4, 6, and 12.

Factor 54

First find all the possible factors

The possible factors are {1, 2, 3 ... 52, 53, 54}

Do not worry this is not as much work as it seems!

54/1 = 54   (1 and 54 are factors)

54/2 = 27   (2 and 27 are factors)

54/3 = 18   (3 and 18 are factors)

54/4 = 13r2 (4 is not a factor)

54/5 = 10r4 (5 is not a factor)

54/6 = 9    (6 and 9 are factors)

54/7 = 7r5  (7 is not a factor)

54/8 = 6r6  (8 is not a factor)

54/9 = 6    (we already have the factors 9 and 6)

So the factors for 54 are 1, 2, 3, 6, 9, 18, 27, and 54

Factor 180

First find all the possible factors

The possible factors are {1, 2, 3 ... 178, 179, 180}

Do not worry this is not as much work as it seems!

180/1 = 180   (1 and 180 are factors)

180/2 = 90    (2 and 90 are factors)

180/3 = 60    (3 and 60 are factors)

180/4 = 45    (4 and 45 are factors)

180/5 = 36    (5 and 36 are factors)

180/6 = 30    (6 and 30 are factors)

180/7 = 25r5  (7 is not a factor)

180/8 = 22r4  (8 is not a factor)

180/9 = 20    (9 and 20 are factors)

180/10 = 18   (10 and 18 are factors)

180/11 = 16r4 (11 is not a factor)

180/12 = 15   (12 and 15 are factors)

180/13 = 13r11 (13 is not a factor)

180/14 = 12r12 (14 is not a factor)

180/15 = 12   (we already have the factors 15 and 12)

So the factors for 180 are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 30, 36, 45, 60, 90, and 180.

= Dividing polynomials =

The process of factoring will require dividing polynomials. This form of division is not too different from long division method, and is known as synthetic division.

Consider the polynomial x3 - 21x2 + 143x - 315. In this case, determining factors may require trial and error (until you learn of alternate techniques), and when you do, you will need to divide the polynomial with the discovered factor.

In this example, we will divide by (x-5). The full division starts like this:

1x -5 | 1x^3 -21x^2 +143x - 315

As with long division, you need to find the number used for subtraction and place it on top - in this case, you need to make sure the left-most term becomes zero. Next, multiply the newly added top-most term with the left hand side to get the amount to subtract, and perform the subtraction.

1x^2 1x -5 | 1x^3 -21x^2 +143x - 315 1x^3  -5x^2 -16x^2 +143x - 315

Repeat until the division is complete:

1x^2 -16x + 63 1x -5 | 1x^3 -21x^2 +143x - 315 1x^3  -5x^2 -16x^2 +143x - 315 -16x^2 + 80x -                       63x - 315 63x - 315 -                               0

(If there is a remainder at this point, place it as the numerator over the term being factored out.)

Some people may find writing the x3 and other variables to be bulky - if writing on pen and paper, they can be omitted as part of shorthand.

1 -16 + 63 1 -5 | 1 -21 +143 - 315        1  -5        -          -16 +143 - 315          -16 + 80          -                63 - 315                63 - 315                       0

In this case, factoring is straight forward since you can easily determine the number to use for the next step in division.

=See also=
 * Factoring polynomials - example of use

title: Algebra/Factoring Polynomials


text:
Constructivist Theories in Education

Front Matter

 * 1) /Introduction/

Foundations

 * 1) Piaget and Genetic Epistemiology
 * 2) Vygotsky
 * 3) Bruner
 * 4) Gergen and Social Constructivism
 * 5) The New Century:Classroom Applications of Constructivism
 * 6) Constructionism

Applications

 * 1) /Guided Reading/
 * 2) /Making Words/
 * 3) /Puzzles, Paradoxes, Debates/

Appendices

 * 1) /Resources/

title: Constructivist Theories in Education


text:
German/Grammar/Alphabet and Pronunciation

The Alphabet
Like English, the German alphabet consists of 26 basic letters. However, there are also combined letters and three umlauted forms. An umlaut is the pair of dots placed over certain vowels; in German, Umlaut describes the dotted letter, not just the dots.

As in English, letters may be pronounced differently depending on word and location. The first column is the German letter, the second describes the IPA pronunciation and rough English approximation of the letter name. The third gives an English word that matches or approximates the German letter sound.

Reading down this column and pronouncing the "English" words will recite the alphabet auf Deutsch ("in German"). Note that letter order is exactly the same as in English, but pronunciation is not for many of the letters. In the list of pronunciation notes, no entry means essentially "pronounced as in English".

Umlaut Letters

 * Umlauts were originally written as 'ae', 'oe', and 'ue'.

Combined Letters
Notes: •There is no uppercase ß. •All vowels (withot umlauts) are pronounced like those in Spanish, but in Spanish the long ones are pronounced much shorter in Spanish. •In German you capitalize these: •Modern German, Luxembourgish, and Bavarian are the only languages in the world that capitalizes every noun. •Also, the only English word that is always capitalized whose German translation (unless it starts a sentence) is not capitalized is the pronoun "I". •in a title, like in Spanish only the first word and other "always" capitalized words are capitalized The silent letters in German appear in five situations: • H after a vowel or T • First letter of double consonants, ck, and tz* • E after I, in which I is always long • Final W. • D before the T Vowels are long with one consonant after it, and short with two. But… A is always short Diphthongs are long Compound words are broken up: Weg|weiser Borrowed and short words may break this rule. Any following H's: Tuch, John, Sohn, Joshua, Buch have a long vowel sound. In French loanwords, if a vowel is followed by a nasal consonant in the same syllable, then the nasal consonant will be silent and the vowel will be nasal. A nasal vowel produces air through your mouth and your nose.
 * 1) Nouns (and words used as nouns)*
 * 2) Beginning of a sentence.
 * 3) The word "Sie", but only meaning you in the formal sense, and its forms.
 * Expect names of italicized letters: das a or das A.

A double vowel is long, except for AA (see above)

Konsonanten ~ Consonants
Most German consonants are pronounced similarly to the way they are pronounced in English, with exceptions noted in column 3 above. Details of certain consonant sounds and uses are discussed further here.

 * d, t, l, and n – In German, these letters are pronounced with the tongue extended up to the back of the base of the teeth, creating a more dental sound. As noted above, 'd' is a 'dental d' except at the end of a word or before a consonant (except an R), where it becomes a 'dental t'.

Note that as above, L only uses the front of your tongue, just like in Spanish or French, which is similar to the L in Laugh.
 * sch – this combination is pronounced like 'sh' /ʃ/, not 'sk' as in English. A German example is Schüler /ˈʃyːlɐ/ (student).

 * sp and st – Where these combinations appear at the beginning of a word or syllable, the 's' sound becomes an 'sh' /ʃ/ sound, while the next letter is pronounced the same as itself in English and German. German examples are spielen /ʃpiːlən/ (play) and Stelle /ˈʃtɛlə/ (place).

German Sounds not found in English
There are sounds in the German language that have no real equivalent in the English language. These are discussed here.

 * r – Most Germans pronounce 'r' as /ʁ/, a guttural sound the g in amigo.

 * ö (read as oh-umlaut) – This vowel is pronounced similarly to the 'u' in the word 'murder' (spoken with a British accent), but with the lips rounded. Commonly, the 'long ö' /øː/ is made by first sounding 'oo' as in moon, then pursing the lips as if to whistle, and changing the sound to 'a' as in 'late'. An example of "long ö" is schön /ʃøːn/ (beautiful). The 'short ö' sound /œ/ is made by first sounding 'oo', pursing the lips, and changing the sound to 'e' as in 'pet', and it sounds very similar to the 'i' in 'sir'. An example of the "short ö" is zwölf /t͡svœlf/ (twelve). If you have problems pronouncing ö, do not replace it by 'o' but by 'e' (as in e lf), which occurs in some German dialects. In written and printed German, 'oe' can be an acceptable substitute for 'ö' if the latter is unavailable.

•It always sounds like an S. •It can't be the first letter of a word. •It always follows a vowel. •It doesn't have an uppercase version. •It looks like a Greek letter, the $$\beta$$, but never replace it with the Greek letter $$\beta$$.
 * ü (read as oo-umlaut) – As with 'ö', 'ü' is a rounded vowel sound with no real English equivalent. The 'long ü' /yː/ is made by first sounding 'oo' as in moon, then pursing the lips as if to whistle, and changing the sound to 'ee' as in 'seen'. A simpler approach is to simply shape your lips and tongue as if you are going to whistle, and then put some voice. An example of "long ü" is früh /fʁyː/ (early). The "short ü" sound /ʏ/ is made by first sounding 'oo', pursing the lips, and changing the sound to 'i' as in 'pit. An example of "short ü" is fünf /fʏnf/ (five). If you have problems pronouncing ü, do not replace it by 'u' but by 'i' (as in fish), which occurs in some German dialects. In written and printed German, 'ue' can be an acceptable substitute for 'ü' if the latter is unavailable.
 * ß looks like a B but be aware of the five warnings, which are as follows:
 * ach – When 'ch' is not preceded by ä, ö, ü, l, n, r, e, i, y, eu, äu, or s it sounds like the x in the country México, when spoken by a Spanish-speaking person.

 * Ich has a meaning by itself: it means me . When ig is at the end of the word, it also sounds like the pronoun ich in German!

Audio: [[Media:De-ach.ogg|OGG]] ~ ach | [[Media:De-Ich auch..ogg|OGG]] ~ ich auch | [[Media:De-richtig.ogg|OGG]] ~ richtig

Syllable Stress
The general rule in German is that words are stressed on the first syllable. However, there are exceptions. Almost all exceptions are of Spanish or French origin. For those borrowed from French it will generally stressed on the last syllable, for example, Vokal, Konsonant, and Lektion (vowel, consonant, lesson). In loanwords from Spanish, however, the stress is generally on the next-to-last syllable if it ends in N, S, or a vowel and the last one otherwise. These words (not stressed on the first syllable) appear in the (Level II and III) lesson vocabularies as Vokal, Lektion (in some regions: Lektion), etc.

Words starting in common prefixes (ge-, be-, ver-, etc.) stress the syllable following said prefix. Examples are Gemüse, Beamte, and Vereinigung. Also, the German word "Ski" means "ski" and is spelled "ski" but it is actually pronounced like the pronoun "She" in English. Notice that we have genders in German, masculine, feminine, neutral. English doesn't have genders. Also as mentioned above, all nouns are capitalized in German, Bavarian and Luxembourgish. And finally, we saw that in words of French origin the letter J, as well as the letter G (before E or I) makes the sound of S as in vision, which is the English J sound without the initial D, and the IPA is this: /ʒ/, a very rare sound in both German and English. Example: In Garage the first G is pronounced the same as how it is pronounced in English, while the second one is pronounced /ʒ/ because it comes before an E, and the word has a French origin. Again, remember that this sound is very rare in both of these languages. Don't forget the $$\ddot{}$$, which will go on back vowels only and move the sound from the back to the front, except for AU. The AU sounds like ow as in cow, while the ÄU sounds like the oy in boy. The $$\ddot{ }$$ may not appear on the A in the AI or AY diphthongs. Last the A, which is always short, except in a diphthong and as $$\ddot{A}$$, as well as long vowels without double-dots on top, are pronounced like those in Spanish, but the Spanish vowel sounds are pronounced short, while in German, all of them except for the A are longer. Again A is always short, never long.


text:
Indonesian/Tenses

Tenses
As we learned from Lesson 4, Indonesian has no tenses. In order to express idea in different time frame, we need to attach time signals, such as "yesterday", "tomorrow", "this morning", etc. These time signals are very easy to learn.

When you say a sentence without any time signal, we can never be sure what time frame it is assumed to be, if it is taken out of context. For example:

Saya makan apel.

The general translation would be in present tense: I eat apple. However, it depends on the speaker on what it means. It may also mean progressive tense. The speaker may be eating an apple as he/she speaks.

Also, you can incorporate as many time signals as you want to express more specific ideas, as long as the addition doesn't contradict the existing ones and follows the "general rule of thumb". This is especially useful since Indonesian has no notion of complex grammar such as future perfect.

Present Tense
To express habitual activity, we use present tense. In English, we use the form of infinitive + (-s/-es). In Indonesian, we use the time signal setiap X, where X can be subtituted with hari, pagi, siang, malam, minggu, etc to denote that the activity is recurrent.

 * Saya makan apel setiap pagi.
 * I eat [an] apple(s) every morning.

Remember that when you mention a noun, it is uncertain whether it is singular or plural, as discussed here. The assumption is always singular, but it can still mean plurals.

Here's a helpful word signals appropriate for present tenses:
 * Setiap hari = Everyday
 * Setiap kali = Every time
 * Setiap pagi = Every morning
 * Setiap siang = Every (around) noon
 * Setiap sore = Every afternoon (but before sunset)
 * Setiap malam = Every night
 * Setiap minggu = Every week
 * Setiap bulan = Every month
 * Setiap tahun = Every year

Note: The word setiap may be shortened as tiap. Both are acceptable in formal written/spoken Indonesian.

To indicate that the action is a habit, you can put the word biasa right before the verb:

 * Saya biasa makan apel. (I usually eat [an] apple(s)) [currently]

Progressive Tense
To express a currently ongoing activity, we use progressive tense. In English, we use the form of to be + infinitive + -ing. In Indonesian, we use the time signal sedang.

 * Saya sedang makan apel.
 * I am eat ing [an] apple(s).

The word other than sedang that can be used is lagi.

 * Saya lagi makan apel.
 * I am eat ing [an] apple(s).

Be careful with the word placement. The word "sedang" or "lagi" are used right before the verb in order to form progressive tense. Be extra careful in the word "lagi", because if the placement is wrong, then it will mean "again" instead of to mean a progressive tense.

 * Saya makan apel lagi .
 * I am eating [an] apple(s) again.

You can also attach time signals to further reinforce your idea; such as: "sekarang" = now.

Past Tense
Indonesian only has one notion of past tense, which is simple past. It has no notion of past progressive or past perfect tenses. (See below for further clarification)

As always, to form the tenses, we just need to attach time signals.

 * Saya makan apel tadi pagi.
 * I ate [an] apple(s) this morning.

To express undefinite past, Indonesian has these phrases:
 * Sudah or Telah → To express undefinite past (distant or recent)
 * Dulu → To express undefinite distant past
 * Tadi → To express undefinite recent past
 * Baru saja or Barusan → To express a very recent past (equivalent to "just now").

Both the words sudah and telah literally means already. It explains that the action has already happened. It is uncertain whether it's in the recent or distant past.

 * Saya telah makan apel.
 * I already ate [an] apple(s).

Note that due to English influence, sudah or telah are often used to express past perfect tenses due to the closeness of their meaning. See below for more.

When people are talking about distant past, the assumption is that the activity discussed is recurrent (unless the context dictates otherwise), especially if we attach habitual time signal. For example:

 * Saya dulu makan apel setiap pagi.
 * I used to eat [an] apple(s) every morning.

The notion of recent past is roughly limited to about last night. So, "tadi malam" means last night.

 * Saya makan apel tadi malam.
 * I ate [an] apple(s) last night.

Baru saja is roughly equivalent to "just now". However, it can also means within an hour or so.

 * Saya baru saja makan apel.
 * I ate [an] apple(s) just now.

To express definite past, we can use the phrase "lalu", which roughly means ago. For example:
 * Dua jam lalu = Two hours ago
 * Dua hari lalu = Two days ago
 * Dua minggu lalu = Two weeks ago
 * Dua bulan lalu = Two months ago
 * Dua tahun lalu = Two years ago

Note that sometimes the phrase "yang lalu" is used instead of "lalu". They are equivalent. Literally, the word lalu means pass and yang means that or which. So, "dua jam yang lalu" literally means "[at] two hours that pass".

Other words that may be useful to express ideas in the past:
 * Kemarin = Yesterday
 * Kemarin pagi = Yesterday morning

(and you can repeat this for siang, sore, and malam)
 * Kemarin lusa = The day before yesterday
 * Minggu lalu = Last week
 * Bulan lalu = Last month
 * Tahun lalu = Last year

Future Tense
The same goes with future tense: We need to attach time signals. For example:

 * Saya akan makan apel.
 * I will eat [an] apple(s).

To express undefinite future, Indonesian has these phrases:
 * Akan or Bakal → Undefinite future, either distant or recent
 * Kelak → Distant future
 * Nanti → Near future

Note that the word akan must be placed right before the verb, just like sedang. See the example above.

The difference between kelak and nanti is on the distance to the future they are. Their usage can be combined with the word akan.

 * Saya akan makan apel kelak.
 * Saya makan apel kelak.
 * Saya akan makan apel nanti.
 * Saya makan apel nanti.

The first two sentences are equivalent, as are the last two. The difference is that the first two implies more distant future than the last two. How distant? It depends on the context. The good rule of thumb is kelak usually refers to a time frame of months or years in the future, whereas nanti refers to a much shorter time in the future than that (i.e. days).

To specify definite future, the word akan can also be combined with other future time signals, such as besok ( = tomorrow).

 * Saya akan makan apel besok.
 * I will eat [an] apple(s) tomorrow.

The word kelak or nanti can be combined with future time signals too in order to specify a definite future:
 * Dua jam nanti = Two hours later
 * Dua hari nanti = Two days later
 * Dua minggu nanti = Two weeks later
 * Dua bulan nanti = Two months later
 * Dua tahun nanti = Two years later

Note that when specifying definite future, the word kelak and nanti is equivalent. So, "dua jam nanti" is equivalent as "dua jam kelak". Usually people still follow the "rule of thumb" above. So, "dua jam nanti" is used more often than "dua jam kelak"; and "dua tahun kelak" is used more often than "dua tahun nanti". However, people usually use "dua bulan nanti" and "dua bulan kelak" interchangeably. Example:
 * Saya makan apel dua jam nanti.
 * I will eat [an] apple(s) two hours later.

Note that the word akan can also be combined with kelak or nanti. But kelak and nanti cannot be used together. For example:

The two examples are equivalent. Another good time signal to use for future tense is "depan", which means next (in next week, etc.):
 * Saya akan makan apel dua jam nanti.
 * I will eat [an] apple(s) two hours later.
 * Saya akan makan apel dua jam kelak.
 * I will eat [an] apple(s) two hours later.
 * Minggu depan = next week
 * Bulan depan = next month
 * Tahun depan = next year

Tense Combinations
As stated above, Indonesian has no complex tenses such as future perfect (i.e. will have + infinitive). The way Indonesian gets around with it is to throw in the appropriate time signals. This practice is influenced by Romance languages and sounds inherently unnatural to Indonesian people. However, you may do that and people may still be able to understand it, may be just a bit strange.

Present Perfect
Due to English language influence, people began using the words sudah or telah to express present perfect. This is because Indonesian actually doesn't have present perfect. So:

 * Saya sudah makan apel.
 * I have eaten [an] apple(s).

It's a bit weird, but it works. So you can use it if you want to.

Future Perfect
We use the phrase "akan telah" or "akan sudah" to indicate future perfect.

 * Saya akan sudah makan apel besok.
 * I will have eaten [an] apple(s) tomorrow.

Conditional Perfect
Conditional perfect is expressed using "would have". Unfortunately, Indonesian has no way to express this. The usual translation is using "mungkin telah", but that would actually mean "may have". This is very awkward situation. It sounds very unnatural. The best way translating it is to translate the sentence in its entirety in a different way.

title: Indonesian/Tenses


text:
User:RMK~enwikibooks

I am trying to figure out how to start contributing some worthwhile material for an introductory text about Western Philosophy, as I am both a professor and student of the subject (having lived and taught in Asia for a few years, Eastern Philosophy is also an interest, but I have much less formal training in that subject). Unfortunately, my three jobs (see below) keep me ridiculously busy, so my time to contribute will be very limited and the pace of progress on the project undoubtedly slow.

Nonetheless, this Wikibook project interests me less because it will save college students some cash (though I think that is great), and more because it will provide quality educational materials to everyone, everywhere. I am very enthusiastic about open source software, and the collaborative power of the open source model in general. It can clearly produce amazing results outside the software world as evidenced by excellent resources like Wikipedia and her sister projects. Ultimately, I am a proponent of free of speech and thought, and am committed to the transformative power of education. I think it is one of the most liberating and empowering forces on the planet and should be freely available to people all over the world regardless of economic status, culture, language, or location.

What else, can I or should I tell you about myself? I have a day job as a Technology Consultant at a mid-size university where I also teach both philosophy and technology courses (yes, I realize it is a seemingly strange mix). In addition I have a small computer consulting business in my home town.

title: User:RMK~enwikibooks


text:
Botany/Plant reproduction laboratory flower

Chapter 5. Plant Reproduction Laboratory ~ Flowers
Infloresence of the orchid, Spathoglottis plicata ([[media:Orchid_lab.jpg|enlarge to examine]]).

An orchid flower
This first laboratory exercise for Chapter 4 deals with the flowers of a ground orchid from Southeast Asia. The photograph on the right demonstrates the descriptive terminology that can be applied to this species. You may wish to read about orchids to place this plant taxonomically and better understand unusual aspects of the structure of this flower. In reading the description below, be sure you understand how or why each bolded word applies to this specimen. Also, observe that the flowering-through-fruiting sequence is well demonstrated in the photograph because each flower is in a slightly different phase of its life cycle from bud to fruit.

 * Spathoglottis plicata Blume — The flowers of this orchid are carried on an erect raceme growing out of the pseudobulb, each flower subtended by a green to purplish bract that becomes strongly reflexed with age. The purple sepals and petals are similar and spreading, elliptic to elliptic-ovate; the labellum is in three distinct parts: the lateral lobes narrow and erect, the middle lobe horizontal and cleft or 2-lobed. Lying above the latter is the narrowly clavate column. The inferior ovary in Spathoglottis develops into a cylindrical capsule (fruit) as the perianth withers.

4-1. Review the photograph of the inflorescence of the orchid. Which one of these statements is true:

 * a) this inflorescence demonstrates determinate growth
 * b) this inflorescence could as well be called a spike
 * c) the uppermost flower shows anthesis.
 * d) there are five petals, therefore this is a dicot.

Photograph 1: Bidens torta ([[Media:Bidens flwr.jpg|Examine]])

Following are a series of photographs of flowers from various plants. Note that by clicking on the word "Examine" in each title, you can enlarge the particular photograph for closer examination. Read each question and the offered answers carefully. All parts of answer choice must be correct for that choice to be correct.

4-2. The structure at B is:
 * a) leaf
 * b) corolla
 * c) ligule
 * d) sepal
 * e) petiole

''Photograph 2. Hibiscus'' ([[Media:FlowerLab1.jpg|Examine]])

4-3. Although the flowers in these three photographs appear very different, the following parts or floral structures are essentially the same:
 * a) AA and F
 * b) BB and C
 * c) G and H
 * d) F and B
 * e) D and BB

4-4. Which statement of the following applies to the structure indicated at E :
 * a) Pollen grains have landed on this pistil
 * b) Androecium of a monoecious plant
 * c) This is a spathe
 * d) E is an anther releasing pollen
 * e) This flower head is on a dioecious plant

''Photograph 3. Xanthosoma or 'Ape ([[Media:Arum flower.jpg|Examine]])''

<< Return to Chapter 5

Answers to Chapter 4 Laboratory Questions:

 * 4-1 ~ c (this flower alone is capable of pollination)
 * 4-2 ~ b (A flower head with tubular disk corollas)
 * 4-3 ~ d (both F and B indicate petals of their respective flowers)
 * 4-4 ~ d (the androecium is supported on a tubular structure (G) that surrounds the pistil (H)


text:
Talk:Latin/Lesson 1-Nominative

Declension?
Like the editor of "Pronunciation?", I'm attempting to learn Latin via this book, however, on the vocabulary lists māter, triclīnium, and templum don't match any of the nominative endings that we're given in the previous table. I'm assuming they're third declension, but clarification would be nice.

The last word in the first homework sentence should perhaps be 'malus', not 'magnus'. Would it be a good idea to give the English of these sentences in Lesson 4?

Pronunciation?
I haven't read the book, and don't speak latin, but I'm hoping to and this might be a good section to add proper pronunciation of words.

I've improved upon the pronunciation section in the last page so that it's more than just a link.

Example
I'm attempting to learn Latin from this book and seem to have spotted something inconsistent on this page. With the fourth example given in the "Examples" section, "poēta est bonus" the declensions are different in gender. If this is an exception to the rule that all adjectives must have the same gender, case and number as the noun it is describing, I think this should be explicitly stated, otherwise this could be confusing. - Nibjib (talk) 20:19, 1 June 2008 (UTC)

-Poeta is actually a masculine word, owing to the fact that it describes a traditionally masculine profession. There are a variety of words in the first declension that operate in this way, including nauta, poeta, and agricola. Furthermore, there are some words in the second declension, mainly trees, that are feminine. However, the most obvious example of cross gender words in unusual declensions is "manus" of the 4th, which is feminine, and not masculine as is the case with most of the declension.

-Asv

Furthur Examples
Why are these different from the examples preceding it? The "Furthur Examples" say "Triclinium magnum est" is wrong, and "Tricilinium est magnum" is correct. Yet in the "Examples", all the Latin sentences are constructed in this manner, i.e. "Puellae bonae sunt", and not "Puellae sunt bonae".

Which is correct? -Anam

Actually, in this case, and most cases, it does not matter because you can tell what it means either way. However, it is much more common to use subject-adjective-verb format, so one would normally use "Triclinium magnum est". There is not a "wrong" sentence structure in Latin, although with longer sentences it may often be confusing, so it is usually better to use the common nom-adj-vb format.

-Froggyfred

...Except in the case of est, where the neutral sentence is X est Y. Moving est to the end gives you emphasis. Verbs that normally come in the middle of two nominatives are called copulative verbs (because they equate, or link, or copulate, one thing to another). Some others are: apparēre, vidēri, manēre. Consider:

 * Est puella. There is a girl.
 * Puella est. It is a girl (as opposed to a boy).
 * Puella est bona. The girl is good.
 * Est puella bona. There is a good girl.
 * Puella bona est. The girl is good (as opposed to bad).
 * Bona est puella. Good is what the girl is (as opposed to bad).
 * Bona puella est. What is good is the girl (as opposed to the boy).

 * Puer videtur fessus. The boy seems tired.
 * Puer fessus videtur. The boy seems tired (as opposed to energetic).
 * Fessus videtur puer. Tired is what the boy seems (as opposed to energetic).
 * Videtur puer fessus. He seems (to be) a tired boy.

Note that the translations are colloquial, not literal, because a literal translation would not convey the nuances of the word order.

See, for example, D'Ooge ¶28. --Robert.Baruch (discuss • contribs) 19:34, 14 June 2011 (UTC)

May I rewrite this Lesson?
Would anyone mind if I rewrite this lesson. I would like to restrict the amount of information presented to the reader and to refocus the lesson so it is easy and to provide more extensive translation sentences. The usual beginners sentences "the girl is..., the boy is..., the girl carries..., the boys are, the girls are,.

Basically restrict the lesson to subject, verb and object using 1st declension feminine nouns and 2nd declension masculine nouns. For example one of the sentences given in Latin is "The father is large". Also I would like to avoid using neuter nouns straight away and the emphatic forms of "to be" - I mean "ego sum" is fine but shouldn't Lesson One be restricted to just "sum, es, est, sumus, estis and sunt". I mean in the sense that these are listed without vos, tu, ego.

I thought I'd ask because I do tend to extensively rework material.

Replies welcome

Sluffs (discuss • contribs) 01:19, 25 July 2016 (UTC)

Placeholder for material
I've removed this section because the Genitive Singular is the same as the Nominative Plural. Without a noun declined fully through the six cases it hardly helps. I'll add the noun table at some stage.

START

Grammar: Pluralizing Nominatives
To pluralize most first and second declension nouns, replace the singular suffix with the equivalent plural suffix. All adjectives that describe the noun must be pluralized as well because adjectives must agree in case, number, and gender. With the adjectives given, use first declension with feminine nouns and second declension with masculine nouns. In English we use the same nominative plural endings for words we have borrowed from Latin, so it may be helpful to remember we say one vertebr-a but two vertebr-ae, one radi-us but two radi-ī, and one medium but multi-medi-a.

END

Sluffs (discuss • contribs) 21:27, 11 August 2016 (UTC)

title: Talk:Latin/Lesson 1-Nominative


text:
Latin/Lesson 3-Present Verbs

= Grammatical Introduction to Verbs =

This introductory section may be a bit overwhelming, but is an overall look at verbs. The majority of this section will be covered in later chapters. Nevertheless, looking over this chapter may help you to familiarize yourself with verbs.

Verbs are parts of speech which denote action. There are two main forms of verbs in Latin:

• Principal Verbs (the main verb which is found in every sentence. e.g.,: vir ambulat = the man is walking)

• Adjectival Verbs (also known as participles, gerunds and gerundives which describe the state of the described noun. e.g.,: vir ambulans = the walking man. The verb behaves as an adjective)

Every sentence must have a verb. In a sense, the principal verb is the sentence and all the nouns, adverbs and participles are only describing the scenario of the verb. Thus in Latin this constitutes a sentence:

est.

If you want to explain 'who' is or exists, you add a nominative substantive:

Cornēlia est.

We now know Cornelia 'is'. But what is she? So we add an adjective.

Cornēlia est bona.

Now we can see that Cornelia is good, but to elaborate further we can add an adverb:

Cornēlia vix est bona.

Now we know that Cornelia is 'hardly' (vix: hardly, scarcely, barely) good.

Thus, in English, the shortest Latin sentence is:

You are.

in Latin:

es

Examples
These two examples will demonstrate the difference between an adjectival verb and a principal verb.

Personal Endings
Verbs in Latin are inflected to reflect the person who performs the action. English does the same to some extent in the verb to be:

Latin, however, inflects all verbs, and is much more extensive than English, allowing writers and speakers of Latin to often drop the personal pronoun, as the performer of the action is understood by the formation of the verb. The Personal pronoun is only usually added for emphasis. In a way, the ending on Latin verbs are a type of pronoun.

Moods
There are several moods. Each has its own uses to convey certain ideas. The most commons moods are:

• Indicative • Subjunctive or Conjunctive • Imperative

The two moods we will first learn are the imperative (commands and orders) and the indicative (declarative statements and factual questions).

Voice
There are two constructions verbs can have regarding voice.

Verbs can have either an active or passive voice.

E.g. 'I smash the car.' 'smash' is an active verb construct.

The passive is used when the nominative is affected by the verb.

E.g. 'The car is smashed by me.' 'is smashed' is a passive construct.

Tense
Tense in Latin comprises two parts: TIME and ASPECT. Time reflects when the action is occurring or did occur: past, present, or future. Aspect refers to the nature of the action: simple, completed, or repeated. The "completed" aspect is generally termed "perfective" and repeated aspect "imperfective."

Theoretically, a verb could have nine tenses (combinations of time and aspect). However, Latin only has six, since some possible combinations are expressed by the same verb forms. Latin tenses do not correspond exactly to English ones.

Below is a rough guide to tense in Latin.

As is evident, some Latin tenses do "double duty." The Latin Present and Future Tenses can either express simple or progressive aspect. Particularly difficult to grasp is the Latin Perfect tense, which can either express an action completed from the point of view of the present ("I have just now finished walking"), or a simple action in past time (its "aorist" sense, from the old Indo European aorist tense, which Latin lost but is still present in Greek).

Infinitive
The infinitive (impersonal) is the form of the verb which simply means 'to (verb)' e.g. 'to do', or 'to be', or 'to love', or 'to hate' etc. All forms which are not in the infinitive are in the finite (personalised) form.

The infinitive has a -re at the end of the stem of the verb. The infinitive of 'to be' is an exception and is 'esse'.

dēbeō currere nunc = I ought to run now.

esse, aut nōn esse = To be, or not to be?

Exercises
Answer these two questions about the infinitive and finite.

Irregularities
Verbs which use the passive formation in an active sense are known as deponent. Verbs which don't have a form for every tense and mood are known as defective. You will meet a few words like this soon.

Personal Pronouns
In case you do ever use a personal pronoun to emphasise the SUBJECT of the verb, you must remember that the personal pronoun must be in the nominative case and the number and person of the verb must match that of the subject. (Review Lesson 7 if unfamiliar with the terms person and subject).

Principal Parts
When one looks up a verb in the dictionary, the principal parts are given. From these principal parts you can find the correct form of the verb for every circumstance.

Exercises
Answer this question about principal parts.

Using the Dictionary
All nouns are given in the nominative, as well as the declension and gender of the noun. Verbs are alphabetized using the 1st person singular (the first principal part) and the infinitive is given. Supplementary principal parts are given if the various other principal parts do not follow the standard pattern of formation from the infinitive and 1st person singular.

=Verbs: Conjugation in the Present Imperfect = The present imperfect is the simplest tense. To form the present imperfect all that is required is to place the personal endings at the end of the verb stem. Thus, if you have the stem 'ama' (love), to make it 'I love' you place an ō at the end.

I love =  amō (amaō*) we love = amāmus

 * Latin drops the 'a' in amaō forming amō.

Latin could add personal pronouns, however only for added emphasis and in conjunction with the corresponding person ending on the verb. Otherwise the sentence will not make sense. For example: ego amō = I (not you) love

nōs amāmus = We (not you) love but that would be for special emphasis: It's I, not you, who loves.

Here are the forms of the verb 'porta', carry, in the present imperfect tense:

portō    I carry                     first person singular portās   thou carriest, you carry    second person singular portat   he, she, it carries         third person singular portāmus we carry                    first person plural portātis you (all) carry             second person plural portant  they carry                  third person plural

'porto' can also be translated 'I am carrying' (present imperfect), 'I do carry' (present emphatic). 'I carry' is known as the 'present simple' tense in English. Again the 'a' gets dropped when the 'ō' is placed on porta. Porta, and ama are known as 1st conjugation verbs; in other words, verbs which have a stem ending in 'a'.

There are three other conjugations, and below are some examples of verbs from each of the four conjugations (present imperfect tense):

Each verb uses the same final letter or letters to indicate the 'subject' - I, thou, he/she/it, we, you, they.

Before these final letters, the first conjugation has an 'a' (although when an 'o' is placed, the 'a' is often dropped), the second an 'e', and the third and fourth usually an 'i'. The third person plural forms in the third and fourth conjugations have a 'u'. These verb forms really should be learned by heart.

The most common verb of all is irregular (see next lesson). Here is a table of the verb 'to be' in Latin, English, and four Romantic languages (French, Spanish, Italian and Portuguese)

The personal endings are the same as in the four regular conjugations.

Exercises

 * Conjugate (find how a verb is in different forms) the verb 'amõ'.

Imperative Mood
The imperative mood conveys an order (e.g. Go!, Run!, Away Now!). The imperative mood is formed by simply using the stem of the verb. If the order is to a large group of people, or you are trying to show respect, you must use the -te suffix.

amō eum = I love him.

amā eum = Love him!

amāte eum = Love (respectful, or plural) him!

currō casam = I run home.

curre casam = Run home!

currite casam = Run (respectful, or plural) home!

regō prudente = I rule wisely.

rege prudente = Rule wisely!

regite prudente = Rule (respectful order) wisely!

title: Latin/Lesson 3-Present Verbs


text: Latin/Appendix H

title: Latin/Appendix H


text:
User:Noldoaran~enwikibooks

My other user pages: MetaWiki | Wikipedia | Wikibooks | Wiktionary | Commons

title: User:Noldoaran~enwikibooks


text:
Talk:US History/Civil War

Your section on McClellan is so filled with errors and mis-representations as to be laughable. That being the case, I did not bother to read the rest of your piece. Suggest you do a bit more homework in future. --

Would the user making the above statement like References? Perhaps if he or she would point out the specific "errors and mis-representations," one may attempt to amend them in to provide greater accuracy. Lord Emsworth

I changed the name of John (born Johan) Ericsson to the (dare I say) correct spelling (was Ericcson), but missed the summary box. The main wikipedia entry supports this spelling. It is also the spelling on his mausoleum in Filipstad, Sweden. Also his brother Nils, changed the spelling to 'Ericson' when he was knighted, something that John reportedly never forgave him for. In that light I find it unlikely that he would have let himself to be known under the name of 'Ericcson'. I do however find numerous sources on the web that lists his name with the odd spelling, so there might be a controversy regarding that on the other side of the atlantic? (Or is it just an early error that has been propagated?) I have several links to back this up, but as they are in Swedish it's perhaps not very useful to include them here. (I also went to the Nils Ericson high school, but that's another story).

I've been adding a few things to this section starting under 'Shiloh'. Let me know if this is all right, but I'm assuming so. There is a good article on the battle in Wikipedia (and probably on others) so what I have tried to do is a brief expansion of the section to set up the situation and then encourage use of the link. erraunt 16:27, 4 October 2005 (UTC)

Ran into the kilobyte limit when trying to edit this section. Are there any plans to create subsections? Any reasons not to before I start making more involved changes? Personally, if it is desireable to grow and develop this book, I believe it will be necessary to break this "chapter" on the Civil War out into multiple subsections to provide the space necessary for the topics. erraunt 19:56, 4 October 2005 (UTC)

I changed some misspellings on this page and corrected one error. Ben Butler, the Beast of New Orleans, was from Massachusetts, not New Jersey.

Technical firsts in the Amercan Civil War
According to the article the American Civil War was the first to see the use of flamethrowers, organised medical and nursing units and ambulance corps and the introduction of the income tax. This is incorrect, as the Chinese invented the flamethrower in the 10th Century (the following article has a picture of a 12th Century version: http://en.wikipedia.org/wiki/File:Chinese_Flamethrower.JPG) and is attributed to have been first used in World War 1 elsewhere in Wikipedia (http://en.wikipedia.org/wiki/Flamethrower).

Furthermore income tax is reckoned to have been introduced by the Chinese (again) in the year 10 and used by the UK in the 12th Century, to fund wars against Saladin, and at the end of the 18th Century, to fund wars against Napoleon. Speaking of Napoleon, he introduced organised medical units and ambulances into his armies (http://en.wikipedia.org/wiki/Dominique_Jean_Larrey). Lastly nursing, specifically military nursing, was what Florence Nightgale (http://en.wikipedia.org/wiki/Florence_Nightingale) became famous for in the Crimean War in the 1850s, so cannot hae been introduced during the American Civil War.

Due to these factual errors, the article stands somewhat degraded and should be edited following further research. 81.159.107.166 (discuss) 19:41, 4 June 2012 (UTC)

I'm going to try to amend it to *the 1st American use* of these things. Thank you. Pittsburgh Poet (discuss • contribs) 19:47, 28 June 2014 (UTC)

title: Talk:US History/Civil War


text:
Linear Algebra/Eigenvalues and eigenvectors

Eigenvalues and eigenvectors are related to fundamental properties of matrices.

 * The word eigenvalue comes from the German Eigenwert which means "proper or characteristic value."

Motivations
Large matrices can be costly, in terms of computational time, to use, and may have to be iterated hundreds or thousands of times for a calculation. Additionally, the behavior of matrices would be hard to explore without important mathematical tools. One mathematical tool, which has applications not only for Linear Algebra but for differential equations, calculus, and many other areas, is the concept of eigenvalues and eigenvectors. Eigenvalues and eigenvectors are based upon a common behavior in linear systems. Let's look at an example.

Let
 * $$A=\begin{pmatrix}

1 & 2 \\ 0 & -2 \\ \end{pmatrix}$$ and
 * $$\mathbf{x}=\begin{pmatrix} -2 \\ 3 \\ \end{pmatrix},\quad \mathbf{y}=\begin{pmatrix} 1 \\ 0 \\ \end{pmatrix}.$$

What happens with x and y if they are transformed by A? Well,
 * $$A\mathbf{x}=\begin{pmatrix} 4 \\ -6 \\ \end{pmatrix}$$
 * $$A\mathbf{y}=\begin{pmatrix} 1 \\ 0 \\ \end{pmatrix}$$

But what is remarkable is that
 * $$A\mathbf{x}=(-2)\begin{pmatrix} -2 \\ 3 \\ \end{pmatrix}=-2\mathbf{x}$$
 * $$A\mathbf{y}=(1)\begin{pmatrix} 1 \\ 0 \\ \end{pmatrix}=\mathbf{y}=(1)\mathbf{y}$$

So when we operate on the vector x with the matrix A, instead of getting a different vector (as we would normally do), we get the same vector x multiplied by some constant. And the same goes for vector y.

We call the values 1 and -2 the eigenvalues of the matrix A, and the vectors x and y are called eigenvectors for the matrix A.

Definitions
We now generalize this concept of when a matrix/vector product is the same as a product by a scalar as above: essentially if we have a n×n matrix A, we seek solutions in v to find the eigenvectors, and solutions in λ to find the eigenvalues for the equation
 * Av=λv

How are we to do this? Let us rearrange the equation
 * Av-λv=0
 * (A-λI)v=0 (note we must multiply the scalar by the identity matrix otherwise A-λ makes no sense)

But (A-λI) is a matrix, so we are trying to solve Bv=0 where B=(A-λI), and this solution is merely the kernel of B, ker B. So the eigenvectors are in ker (A-λI), where λ is an eigenvalue. But how do we find the eigenvalues?

Bv=0 has nonzero solution if |B| = det(B) is zero. So to find the eigenvalues, we let |A-λI|=0 and then solve for λ. We will thus obtain a polynomial equation over the complex numbers (eigenvalues can be complex), known as the characteristic equation. The roots of the characteristic equation are the eigenvalues.

Note that we exclude 0 as an eigenvector, because it is trivially a solution to Av=λv and is not really interesting to consider. Additionally, if the zero vector were to be included, it would allow for an infinite number of eigenvalues, since any value of λ satisfies A0=λ0.

If we have an eigenvalue λ of a matrix A, together with a corresponding eigenvector, x, then any multiple of x is also an eigenvector for the same eigenvalue. To see that kx is also an eigenvector, follow this argument: If Ax=λx, then A(kx)=kAx=kλx=λ(kx). (Here k may be any scalar.) Thus, every multiple of an eigenvector is also an eigenvector.

Note the asymmetry here: eigenvalues are unique, while an eigenvalue has many eigenvectors.  Bold text Æə=== Finding eigenvalues and eigenvectors === Here are some examples of finding eigenvalues and eigenvectors using our definitions.

Let
 * $$A = \begin{pmatrix} 3 & 0 \\

-1 & 2 \end{pmatrix}$$

Firstly, we expand |A-λI|=0 to find the eigenvalues:
 * $$\left| \begin{pmatrix} 3 & 0 \\

-1 & 2 \end{pmatrix}- \begin{pmatrix} \lambda & 0 \\ 0 & \lambda\end{pmatrix} \right|=0$$

 * $$\begin{vmatrix} 3 - \lambda & 0 \\

-1 & 2 - \lambda \end{vmatrix}=0$$
 * $$ (3-\lambda)(2-\lambda)-(0)(-1)=0$$
 * $$ (3-\lambda)(2-\lambda)=0$$

Now, elementary algebra tells us the roots of this equation are 3 and 2, and thus these are our eigenvalues.

(Exercise: prove that in a 2×2 triangular matrix the eigenvalues are on the principal diagonal. Harder: generalize this result)

Now we can find our eigenvectors. Consider the first eigenvalue λ=3. To find our first eigenvector
 * $$ \mbox{ker} (A-3I) = \mbox{ker}

\begin{pmatrix} 3-3 & 0 \\ -1 & 2-3 \end{pmatrix} = \mbox{ker} \begin{pmatrix} 0 & 0 \\ -1 & -1 \end{pmatrix} $$ At this point we can row-reduce and back-substitute, but usually it suffices to guess the kernel since our matrix is small and we have linearly dependent columns. Now, observe:
 * $$ \begin{pmatrix}

0 & 0 \\                          -1 & -1 \end{pmatrix} \begin{pmatrix} a \\ -a \end{pmatrix}=\mathbf{0}$$ So, for any scalar a, the vector
 * $$\begin{pmatrix} a \\ -a \end{pmatrix}$$ is an eigenvector. Stated another way, the set of all eigenvectors of the matrix A includes the set $$\mbox{span} \{\begin{pmatrix} 1 \\ -1 \end{pmatrix}\}$$. In the plane, this represents a line of slope -1 through the origin.

As noted above the eigenvalues of a matrix are uniquely determined, but for each eigenvalue there are many eigenvectors. We usually choose an eigenvector for some convenience such as "most whole number entries", "first entry is 1", or "length of the eigenvector is 1". Most Computer Algebra Systems choose unit vectors for eigenvectors.

So here we may take $$\begin{pmatrix} 1 \\ -1 \end{pmatrix}$$ to be the eigenvector, for example.

Similarly for our second eigenvalue λ=2, to find our second eigenvector:
 * $$ \mbox{ker} (A-2I) = \mbox{ker}

\begin{pmatrix}1 & 0 \\ -1 & 0 \end{pmatrix}= \mbox{span} \{\begin{pmatrix} 0 \\ 1 \end{pmatrix}\}=\mathbf{0}$$ And so, our second eigenvector is chosen as
 * $$\begin{pmatrix} 0 \\ 1 \end{pmatrix}.$$

Our eigenvalues then are λ=2,3, with eigenvectors $$\begin{pmatrix} 1 \\ -1 \end{pmatrix}, \begin{pmatrix} 0 \\ 1 \end{pmatrix}$$, as may be checked by multiplying each by the given matrix.

(We also could choose $$\begin{pmatrix} 1/\sqrt(2) \\-1/\sqrt(2) \end{pmatrix}$$ as an eigenvector for the eigenvalue λ=3 . Check this.)

Problem set
Given the above, find the eigenvalues and eigenvectors of the following matrices (Answers follow to even-numbered questions):
 * 1) $$\begin{pmatrix} 3 & 0 \\ -4 & 5 \end{pmatrix}$$
 * 2) $$\begin{pmatrix} 1 & 1 \\ 3 & -1 \end{pmatrix}$$
 * 3) $$\begin{pmatrix} -2 & 0 & 3 \\ 2 & 4 & 0 \\ 1 & 0 & 0 \end{pmatrix}$$
 * (Harder. Hint: one eigenvalue is 4.)

Answers

 * 1) eigenvalues: 3, 5; eigenvectors: $$\begin{pmatrix} 1 \\ 2 \end{pmatrix}, \begin{pmatrix}  0\\1  \end{pmatrix}$$
 * 2) eigenvalues: -2, 2; eigenvectors: $$\begin{pmatrix} -1 \\ 3 \end{pmatrix}, \begin{pmatrix}  1\\1  \end{pmatrix}$$
 * 3) eigenvalues: -3, 1, 4; eigenvectors: $$\begin{pmatrix}21\\-6\\-7\end{pmatrix},\begin{pmatrix}3\\-2\\3\end{pmatrix},\begin{pmatrix}0\\1\\0\end{pmatrix}$$

Applications
Eigenvalues and eigenvectors are not mere pretty facts about these vectors; they have relevant and important applications.

Matrix powers
Let us first examine a certain class of matrices known as diagonal matrices: these are matrices in the form
 * $$\begin{pmatrix}

a_0 & 0 & 0 & \ldots & 0 \\ 0 & a_1 & 0 & \ldots & 0 \\ 0 & 0 & a_2 & \ldots & 0 \\ 0 & 0 & 0 & \ldots & a_k \end{pmatrix}$$

Now, observe that
 * $$\begin{pmatrix}

a_0 & 0 & 0 & \ldots & 0 \\ 0 & a_1 & 0 & \ldots & 0 \\ 0 & 0 & a_2 & \ldots & 0 \\ 0 & 0 & 0 & \ldots & a_k \end{pmatrix}^k= \begin{pmatrix} a_0^k & 0 & 0 & \ldots & 0 \\ 0 & a_1^k & 0 & \ldots & 0 \\ 0 & 0 & a_2^k & \ldots & 0 \\ 0 & 0 & 0 & \ldots & a_k^k \end{pmatrix}$$

This is a useful property! However, the number of matrices to which we can apply this fact is clearly limited, so we ask ourselves whether we can transform a given matrix into a diagonal matrix.

The answer to this question is "sometimes", but for the moment, we will only look at matrices for which this answer is "yes".

What we seek is a matrix P such that
 * PAP-1=D

where D is diagonal.

If such a matrix P exists, we say that A is diagonalizable. (Note that xyx-1 is often called a similarity transformation).

Then
 * PAP-1=D
 * AP-1=P-1D

by multiplying throughout forward by P-1, then
 * A=P-1DP

by multiplying backward by P.

Now, we have
 * Ak=(P-1DP)k
 * =(P-1DP)(P-1DP)(P-1DP)... (k times)
 * =P-1D(PP-1)D(PP-1)DP... (k times)

The PP-1 terms cancel to give
 * =P-1DDD...P (k times)
 * =P-1DkP

We can calculate Dk easily, so we need to find P.

It turns out (the entire proof is quite difficult) that we simply create a matrix from concatenating the linearly independent eigenvectors to create P.

D, then, is the diagonal matrix containing the eigenvalues on the main diagonal corresponding to the associated eigenvectors (the eigenvalue in the first place corresponds to the eigenvector it is created from, in the first column).

Example
Let's work through an example to show these ideas.
 * $$A=\begin{pmatrix}

3 & 1 \\ 4 & 0 \\ \end{pmatrix}$$

So what do we do if we want to find A14? Let's use the method we've just described.

Find the eigenvalues:
 * |A-λI|=0
 * (3-λ)(-λ)-4=0
 * λ2-3λ-4=0
 * λ=-1, 4

Find the eigenvectors:
 * for λ=-1 $$

\mbox{ker}\begin{pmatrix} 4 & 1 \\ 4 & 1 \\ \end{pmatrix}=\mbox{span}\{\begin{pmatrix}-1 \\ 4\end{pmatrix}\}$$
 * for λ=4 $$

\mbox{ker}\begin{pmatrix} -1 & 1 \\ 4 & -4 \\ \end{pmatrix}=\mbox{span}\{\begin{pmatrix}1 \\ 1\end{pmatrix}\}$$

The eigenvectors are then
 * $$\begin{pmatrix}-1 \\ 4\end{pmatrix}, \begin{pmatrix}1 \\ 1\end{pmatrix}$$

so put the eigenvectors together to form the matrix P
 * $$P=\begin{pmatrix}-1 & 1 \\ 4 & 1\end{pmatrix}$$

Now -1 generated the eigenvector in the first column, and 4 generated the eigenvector in the second column, so form D in this way:
 * $$D=\begin{pmatrix}

-1 & 0 \\ 0 & 4 \\ \end{pmatrix}$$

We can easily calculate (-1)14=1, so we get
 * $$D^{14}=\begin{pmatrix}

1 & 0 \\ 0 & 4^{14} \\ \end{pmatrix}$$

and we have the fast method for creating inverses of 2×2 matrices:
 * $$P^{-1} = -\frac{1}{5}\begin{pmatrix}1 & -1 \\

-4 &-1 \end{pmatrix}$$

So now we can now directly multiply out
 * $$-\frac{1}{5}

\begin{pmatrix} 1 & -1 \\ -4 & -1\end{pmatrix} \begin{pmatrix} 1 & 0 \\ 0 & 4^{14} \end{pmatrix} \begin{pmatrix} -1 & 1 \\ 4 & 1\end{pmatrix}$$ Simplifying we get

\begin{pmatrix} 214748365 & 53687091 \\ 214748364 & 53687092 \end{pmatrix}$$

Problem set
Given the above, find the following matrix powers (Answers follow to even-numbered questions):
 * 1) $$\begin{pmatrix} 1 & 0 \\ -2 & 5 \end{pmatrix}^6$$
 * 2) $$\begin{pmatrix} 1 & 3 \\ 3 & -7 \end{pmatrix}^5$$
 * 3) $$\begin{pmatrix} -1 & 9 \\ -10 & 16 \end{pmatrix}^4$$
 * 4) $$\begin{pmatrix} -2 & 0 & 3 \\ 0 & 4 & 0 \\ 0 & 0 & 2 \end{pmatrix}^3$$
 * (More tedious: only slightly easier because this matrix is in row echelon form)

Answers

 * 2.$$\begin{pmatrix} -3248 & 9840 \\ 9840 & -29488\end{pmatrix}$$
 * 4.$$\begin{pmatrix}1/4\end{pmatrix}*\begin{pmatrix} -32 & 0 & 48\\ 0 & 256 & 0\\ 0 & 0 & 32\end{pmatrix}$$

Coupled ordinary differential equations
We can use the method of diagonalisation to solve coupled ordinary differential equations. For example, let x(t) and y(t) be differentiable functions and x' and y' their derivatives. The differential equations are relatively difficult to solve:
 * x' = 4x - y
 * y' = 2x + y

but
 * u' = ku for a constant k is easy to solve

it has solution
 * u = Aekx where A is a constant

remembering this fact, we translate the ODEs into matrix form

\begin{pmatrix} x'\\ y' \end{pmatrix} = \begin{pmatrix} 4&-1\\ 2&1 \end{pmatrix} \begin{pmatrix} x\\ y \end{pmatrix} $$ Diagonalise the square matrix, we get:

\begin{pmatrix} x'\\ y' \end{pmatrix} = \begin{pmatrix} 1&1\\ 1&2 \end{pmatrix} \begin{pmatrix} 3&0\\ 0&2 \end{pmatrix} \begin{pmatrix} 1&1\\ 1&2 \end{pmatrix}^{-1} \begin{pmatrix} x\\ y \end{pmatrix} $$

we put

\begin{pmatrix} u\\ v \end{pmatrix} = \begin{pmatrix} 1&1\\ 1&2 \end{pmatrix}^{-1} \begin{pmatrix} x\\ y \end{pmatrix} $$ then it follows that

\begin{pmatrix} u'\\ v' \end{pmatrix} = \begin{pmatrix} 1&1\\ 1&2 \end{pmatrix}^{-1} \begin{pmatrix} x'\\ y' \end{pmatrix} $$ thus

\begin{pmatrix} u'\\ v' \end{pmatrix} = \begin{pmatrix} 3&0\\ 0&2 \end{pmatrix} \begin{pmatrix} u\\ v \end{pmatrix} $$ as discussed above the solutions are easy. We have
 * $$u = Ce^{3t}$$
 * $$v = De^{2t}$$

for some constants C and D. Now that

\begin{pmatrix} u\\ v \end{pmatrix} = \begin{pmatrix} 1&1\\ 1&2 \end{pmatrix}^{-1} \begin{pmatrix} x\\ y \end{pmatrix} $$ we get

\begin{pmatrix} 1&1\\ 1&2 \end{pmatrix} \begin{pmatrix} u\\ v \end{pmatrix} = \begin{pmatrix} x\\ y \end{pmatrix} $$ and so
 * $$x = Ce^{3t} + De^{2t}$$
 * $$y = Ce^{3t} + 2De^{2t}$$

This method generalises well into higher dimensions.

Coupled differential equations
Matrices, strangely enough, have a great use in relation to calculus in the calculation of solutions to coupled differential equations, where one differential equation has some function that depends on another differential equation. For example:
 * D y = 3y + x
 * D x = y + 3x

Without going any further, the solution to these differential equations looks very difficult! However if we formulate this in terms of matrices, it becomes a little bit easier to analyze.

Example
Let's take the above example, so
 * D y(t) = 3y + x
 * D x(t) = y + 3x

Now form a vector:
 * $$ \mathbf{v}(t) = \begin{pmatrix} y \\ x \end{pmatrix} $$

Then
 * $$ D \mathbf{v}(t) = \begin{pmatrix} D y \\ D x \end{pmatrix}$$

Now the problem becomes
 * $$ D(\mathbf{v}) = \begin{pmatrix} 3 & 1 \\ 1 & 3 \end{pmatrix}\mathbf{v}$$

This is reminiscent of the differential equation we have already encountered in calculus, that of
 * D y = ky

in which the solution is y = cekt. We can make a wild guess then the solution to the above matrix equation will have a solution in a similar form.

So let's try a solution v = weλt. Then D v = λweλt.

Let us then try and substitute this guess solution into our equation:
 * $$\lambda\mathbf{w}e^{\lambda t} = \begin{pmatrix} 3 & 1 \\ 1 & 3 \end{pmatrix}\mathbf{w}e^{\lambda t}$$

If we let
 * $$ A = \begin{pmatrix} 3 & 1 \\ 1 & 3 \end{pmatrix}$$

we see that the equation above becomes, on dividing through by $$e^{\lambda t}$$ (since it is never zero)
 * $$ A\mathbf{w} = \lambda\mathbf{w}$$

But wait - this is the equation before to find the eigenvalues - and we have that the solution v = weλt is a solution if and only if λ is an eigenvalue of A and w is its corresponding eigenvector.

The eigenvalues are 4, 2, with eigenvectors
 * $$\begin{pmatrix} 1 \\ 1 \end{pmatrix}, \begin{pmatrix} -1 \\ 1 \end{pmatrix}$$

respectively.

So we have two solutions
 * $$\begin{pmatrix} 1 \\ 1 \end{pmatrix}e^{4 t}$$

and
 * $$\begin{pmatrix} -1 \\ 1 \end{pmatrix}e^{2 t}$$

Note that if we have two solutions to the differential equation D v = Av, linear combinations of the two solutions will give the same solution. So then we have then the general solution:
 * $$\mathbf{v}=j\begin{pmatrix} 1 \\ 1 \end{pmatrix}e^{4 t}+k\begin{pmatrix} -1 \\ 1 \end{pmatrix}e^{2 t}=$$
 * $$\begin{pmatrix} y(t) \\ x(t) \end{pmatrix}=j\begin{pmatrix} 1 \\ 1 \end{pmatrix}e^{4 t}+k\begin{pmatrix} -1 \\ 1 \end{pmatrix}e^{2 t}=$$

Separating into the first and second components we get our two solutions
 * $$ y(t) = je^{4 t}-ke^{2 t}, x(t) = je^{4 t}+ k e^{2 t}$$.

Problem set
Given the above solve the following problems (answers to even-numbered questions follow)
 * 1) Find y(t) and x(t) where D y(t)=3x(t)+6y(t) and D x(t)=x(t)+4y(t)
 * 2) Find y(t) and x(t) where D y(t)=2x(t)+2y(t) and D x(t)=x(t)-2y(t)

Answers
Form the matrix
 * $$A=\begin{pmatrix} 2 & 2 \\ 1 & -2 \end{pmatrix}.$$

The eigenvalues of this matrix are
 * $$\pm\sqrt{6}$$

and the eigenvectors are
 * $$\begin{pmatrix} 2-\sqrt{6} \\ 1 \end{pmatrix}, \begin{pmatrix} 2+\sqrt{6} \\ 1 \end{pmatrix}$$

So now
 * $$\begin{pmatrix} y(t) \\ x(t) \end{pmatrix}=\alpha\begin{pmatrix} 2-\sqrt{6} \\ 1 \end{pmatrix}e^{-\sqrt{6}t}+\beta\begin{pmatrix} 2+\sqrt{6} \\ 1 \end{pmatrix}e^{\sqrt{6}t}$$

and y(t) and x(t) can be read off by inspection.