Wednesday, April 19, 2017

Mathtoys update

Mathtoys has evolved considerably since my last update, and the changes post frequently to the site. There has been a fundamental change in the primary approach to solving an algebra problem, which itself changes some aspects of the user experience, and a handful of other notable changes in the user experience.

Straight-through problem solving in Mathtoys

Mathtoys has always proved every user step with its internal proof engine.
Older versions of Mathtoys nicely supported inference from the problem statement to a "solution", so that if the givens were true, the solution statement must be true.  These were all valid proofs, but the results were really "candidate" solutions, and in principle they required some sort of formal check that the solution was correct. This is easy enough to do by going back to the problem statement, replacing the variable with the candidate solution value, and checking that the result is a true statement.  On the other hand this is not necessary for many algebra problems, if you are confident that all the steps have been done correctly.

Recent versions of Mathtoys work directly with equivalences where possible. Steps display with a mathematical "equivalence" symbol "≡", indicating that the line is equivalent to the one above it and thus true for exactly the same values of the problem variables. When the final result is equivalent to the problem statement, the problem is solved without need for any further work, and you have a "straight-through" solution with no going back to check.

In some cases it is not possible to work with equivalent steps, but Mathtoys tries to do this when it can.  Of course if you solve a math problem by hand it is a good practice to go back and check for errors you may have made along the way.

Solving simultaneous equations

Mathtoys also solves simultaneous linear equations "straight-through" as well, using equivalences. This means that a problem statement says that all of the equations are true using a mathematical "and" also known as a "conjunction". If you choose to solve example simultaneous equations on the web site, you will see that the equations are connected with the mathematical "∧" symbol.

As you work through a problem, Mathtoys shows that each set of equations is equivalent to the set in the previous step and displays the "≡" symbol to indicate this.

Step suggestions

Until recently Mathtoys offered you a menu of things to do next, sometimes with an indication of what the result would look like. New in the user interface, Mathtoys may offer you some specific suggestions of exact next steps you can choose from as you work on a problem.  Some steps have descriptions in a menu, as before, but for many you get to see exactly what the next step could be if you choose it.

Solution status display

As your work on a problem approaches the desired form, Mathtoys now notices the progress and informs you wth a message. This applies especially to simultaneous equations, where each equation can make its own progress toward a solution.

Vacuously true statements

You can think of a vacuously true statement as a sort of mathematical joke. For example, if Santa Claus does not have any pigs, it is mathematically true that “All of Santa’s pigs can fly”! Vacuously true statements can also play a role in mathematical fallacies, which are incorrect arguments that may look reasonable until you take a closer look at them.

You might want to review the previous posting on the meaning of "implies". The key to understanding vacuous statements is that if the “antecedent” (left side) of an implication is false, the whole statement is true no matter whether the right side (“consequent”) is reasonable or not. In our little example, it is true that all of Santa’s pigs can fly, even if no pig in the entire world can fly. And I guess all purple cows are math whizzes, too — unless of course there really is a purple cow somewhere.

In the truth table for the implication operator (P ⇒ Q), if you look at the rows where P is false, you will see that the whole implication is true regardless of whether Q is true or not. So any implication with "false" on the left side is true; and we say "false implies anything".

The definition of "⇒" gives just the results we need to do mathematics — just watch out for statements that are vacuously true!

Friday, January 2, 2015

The math problem inside every math problem

A great deal of high school math is about solving problems. Yet for mathematicians throughout history and right up to the present, math is about proofs. Are students doing one kind of math, while mathematicians are doing something quite different? Not really. The kind of math that professional mathematicians do is much more challenging and abstract than a high school math problem, but in its essence the math is the same no matter who does it.

How is this possible? The steps in solving a math problem feel like the steps in a proof, but in some ways the process feels different. What is the theorem to be proved, and where is it? It turns out that theorem and its proof are both hiding just a bit inside the math problem.

Let’s look first at solving equations, perhaps the most classic form of algebra problem. A very simple equation to solve could be something like:

4 ⋅ x + 3 = 15

which has the solution:

x = 3

We could solve it by subtracting 3 from both sides and then dividing both sides by 4. The steps would look something like this:

4 ⋅ x + 3 - 3 = 15 − 3
4 ⋅ x = 12
(4 ⋅ x) / 4 = 12 / 4
x = 3

There is indeed a proof lurking inside the solution to this problem! How can this be? None of the statements in the proof is a theorem. A theorem should always be true, like the commutative law is true for all real numbers. None of these statements is true unless x is equal to 3, though each is true if x is indeed equal to 3.

We could say there are two theorems here. Stated in words, one is that for all real numbers x, if 4 ⋅ x + 3 = 15 then x = 3. Mathematical notation for this is:

4 ⋅ x + 3 = 15 ⇒ x = 3

(You can read the arrow as “implies”.)

When we solve equations, we usually work in this manner, starting with the problem statement and applying rules to get a sequence of statements, each true based on earlier steps.

The problem statement is assumed at each step. So the statements being proved along the way technically are like this:

4 ⋅ x + 3 = 15 ⇒ 4 ⋅ x + 3 - 3 = 15 − 3
4 ⋅ x + 3 = 15 ⇒ 4 ⋅ x = 12
4 ⋅ x + 3 = 15 ⇒ (4 ⋅ x) / 4 = 12 / 4
4 ⋅ x + 3 = 15 ⇒ x = 3

And the final step is the first theorem being proved. Repeating the assumption every time is tedious, so you can see why the assumptions are generally not written at each step in solving a problem!

The other theorem is that for all real numbers x, if x = 3 then 4 ⋅ x + 3 = 15. In mathematical notation this is:

x = 3 ⇒ 4 ⋅ x + 3 = 15

For many problems like this one, we can confirm this theorem just by “plugging in” the value 3 for x in the equation 4 ⋅ x + 3 = 15. In math textbooks this is sometimes called “checking your work”. It can help you avoid mistakes, and in some problems is necessary even if all of your steps are done correctly! We will say more about that in another posting.

Mathematical notation also lets us combine the two statements into a single theorem. In mathematical notation it looks like this:

4 ⋅ x + 3 = 15 ⇔ x = 3

This has an arrow pointing in both directions, and means that 4 ⋅ x + 3 = 15 ⇒ x = 3 and also that x = 3 ⇒ 4 ⋅ x + 3 = 15. That is why the arrow in this one points in both directions. In mathematics, a statement of this kind is called an equivalence.

Solving equations is mathematically the same as finding an equivalence between the given equation (or equations) and the "solution". In the solution, each variable should be shown equal to some expression, and the expression should be reasonably simple — the simpler the better.

There are other kinds of math problems too, including simplification of expressions. More on this later.

Wednesday, December 31, 2014

The meaning of “implies”

Nothing is more essential to mathematical thinking than deduction, the art of working out the consequences — the implications — of precise assumptions.

This posting takes a closer look at the mathematical meaning of “implies” through an example in basic algebra. It assumes that you know just a little bit about propositional logic and its “implication” operator, as explained for example in Logic through Pictures.

Let’s look at the statement that

if x is equal to 1 then x squared is also equal to 1.

In mathematical notation we write this as

x = 1 ⇒ x2 = 1

and this is a true mathematical statement just as you would expect. We typically read the arrow here in English as “implies”, reading the whole statement as “x equals 1 implies x squared equals 1”. We are going to look more closely at the precise mathematical meaning of this implication arrow.

The mathematical meaning of a true statement with variables is that any possible value can be used as the value of each variable, giving a true statement in every case. So in this example the statement should be true for x = 0, x = 1, x = 2, and so on. And if we are talking about the real numbers, it should also be true for ½, the square root of 2, and so on.

For each possible value of x we consider the value of x = 1 and the value of x2 = 1. Each of these will be either true or false. The implication arrow is a function that takes two “truth values” (either T or F) as inputs, and gives a truth value as its result.

Since x = 1 ⇒ x2 = 1 is a true statement, its value must be T (true) for all possible values of x. Let’s take a look at the truth table for the ⇒ operator.

P Q P ⇒ Q

Its value is T for all inputs except P = T and Q = F. In our true statement we will see that all three of the cases that give a value of T occur for certain values of x.

Suppose the value of x is 1. Then the expression x = 1 is true and the expression x2 = 1 is also true. The value of T ⇒ T is T, and 1 = 1 ⇒ 12 = 1 is true as expected.

Next suppose x is -1. The expression x = 1 is false, but the expression x2 = 1 is true. The value of F ⇒ T is T, so -1 = 1 ⇒ (-1)2 = 1 is also true.

Now suppose x is 0. Then the expression x = 1 is false and the expression x2 = 1 is also false. The truth value of F ⇒ F is T, and 0 = 1 ⇒ 02 = 1 is true, also as expected. The inputs to “⇒” are false for x = 2, x = 3, x = ½, and all other values of x as well.

As long as there is no value of x that causes x = 1 to be true and x2 = 1 to be false, the implication is true. For this statement there are no such cases, and we see in detail how our original statement is true, looking at all possible cases and using the “truth table” for the “⇒“ operator.

What is high school algebra for?

Basic algebra is a core part of virtually all high school level educational programs. There are areas of controversy over teaching of math, but the value of studying basic algebra itself is not one of them. The skills and understanding of high school algebra provide a base for much practical and important mathematics, and advanced areas of math build on basic algebra, including probability, statistics, calculus, real and complex analysis to mention only a few.

Still, algebra is only one face of mathematics. Ever since the ancient Greeks, math has had other important faces as well. Euclidean geometry is recognized to this day as a shining example of systematic mathematical reasoning and taught in standard school programs. With the arrival of the computer and the Internet, new kinds of mathematics have come to have great practical importance, including discrete mathematics and mathematics of computation. And mathematics itself has exploded in many directions, especially over the last century or so.

With the computer have also come questions about the math students learn in school. For example now that we have calculators, how important is it to learn to calculate by hand? Powerful computer algebra software now can solve many kinds of math problems, often beyond the abilities of all but the most capable humans. Textbook problems in basic algebra are among the simplest problems of these kinds.

In spite of all this there is still a consensus in favor of basic algebra in schools. It does not seem to be just conservatism or inertia. Where does this continued belief in high school algebra come from? High school algebra can contribute in a number of areas, including:

  • Problem-solving skills. Math has always been a tool for solving problems, and algebra provides excellent arenas in which to state problems, consider the means available, and systematically solve those problems.
  • Fundamental concepts of mathematics. Among these are variables, constants, terms, functions, domain, range, relations and equations.
  • Interpreting mathematical expressions and statements. This means understanding for example the structure of a term, how it transforms its inputs to its outputs, the graphs of equations, and the conditions when mathematical statements are true or false.
  • Understanding and using properties of numbers and operations. These include ordering of numbers, operations such as commutativity, associativity, and distributivity; symmetry, transitivity, and so on.
  • Describing the world mathematically. Typically this means transforming questions about the world into mathematical statements that can allow the questions to be solved or analyzed.
  • Reasoning mathematically. Proper mathematical reasoning is deductive, and the fundamental rules of deductive reasoning apply to all branches of mathematics, both simple and advanced.

Some of the posts on this blog discuss how basic algebra can illustrate principles of mathematical reasoning often overlooked in textbooks and courses in the subject. These principles can also be readily implemented in interactive computer software such as Mathtoys that can support its users in correct reasoning.