Sunday, September 23, 2012

Forms and Algebra



                When studying mathematics at any level, one might find themselves asking where did this stuff come from? , or why is this useful?.  The answer to these questions can be summed up in one word , Algebra.    Why algebra? Why is it so important?  Well, let’s look at what algebra actually means.  Algebra throughout history has developed many rules, relations, and symbols to answer some of the everyday problems we encounter.  The history of algebra and how it was formed, in my opinion, has little to do with what it actually means. I will instead explain algebra by use of philosophy. We can call it the philosophical theory of algebraic reasoning.

 

The Theory of forms and Algebra

      The theory of Forms is basically that real-world objects have forms. For example when you look at your table, how do you know it’s a table?  In fact your table could be extremely different from all other tables, but you know it’s a table because it has the form of a table. The form of a table is that it has a flat surface at the top, and a support structure at the bottom.  The Form of the table can be restated as the abstraction of a table.  By having the abstract model or form of a table, we can then manipulate or customize our table to look how we want so long as it stays within the basic bounds of the form.  We can also now take our base form and use it to define specific types of tables.
    Algebra works in the same way as the theory of forms. In algebra we use letters to symbolize or initialize the form of a number. We call the letters variables because they can change their value. Let’s look at the statement 1+1=2. Even though we have numbers and not variables this is still an abstraction. This is a perfect abstraction for general purposes it gives us a specific form unity. The 1 is the form or abstraction of a real world object. It can be any object as long as it is a single object. So to translate this statement we would say that a single object and a single object together has the form of two objects.  For most the meaning of this statement is obvious, however; the statement a + a = b is not as obvious. Also, this statement does not mean the same as 1+1=2.   Table + Table = 2 tables this statement is equivalent to 1+1=2 only because we are assuming the Knowledge of what the symbols 1, 2, + , =, represent. So we build our philosophical theory of algebra off of the assumption that we don’t need to define the symbols for numbers and what they mean.
     The symbols 1 and 2 have a very specific meaning, but their properties, and interactions have a more complicated philosophical meaning. So we have a gap in our ability to abstract numbers and their properties, which is why we use the letters or variables.  The variables are in fact a form of a form. Sounds redundant, but it is necessary to provide abstraction from something that is already an abstraction. This concept is where it gets a little tricky.  We can say a variable is the form of a number but not all numbers only numbers that have the specific properties we provide with the rest of the statement. Take our a + a = b statement. This statement gives us a relationship between any two numbers that can be represented in this form a + a = b which has many numerical equivalences.                            It can mean 1+1 =2, 2+2 = 4, 3+3 =6, 4+4 = 8…etc. In fact this statement provides an abstract definition of even numbers.  Statements like this should then be called definitions of forms.  We shall go back to our table example again. The basic form of a table is flat surface at the top and support structure at the bottom. What if we said table + wood? We are giving an abstract definition of tables that are made out of wood. So table + wood is the same as a + a =b they are both abstract definitions of forms.   The only difference is abstract definitions of numerical forms take a little more interpretation. However both assume an understanding of something else. The table + wood example assumes an understanding of the form of wood and the form of table. The a+a=b example assumes an understanding that 2,4,6,8,10…etc are called even numbers. a+a=b just gives us a definition of even numbers without trying to list all of the even numbers up to infinity. So abstraction is actually necessary to define specific numbers and number relationships, because we cannot realistically list every even number to infinity.

Why is algebra the heart of mathematics?


                The abstraction of algebra gives us strong foundation by which to build many more complex definitions with a wide range of uses in everyday life. A lot of these concepts we use every day without even realizing it. In fact nearly every branch of mathematics would not exist without the foundation laid down by algebra. For example statistics, uses many definitions that would not exist without the framework of algebra. We even use algebraic concepts in many other subjects. For example in composition classes we use abstraction as a tool to write papers we start with an outline, which is simply an abstraction. Our outline gives us a simple abstract definition of our paper which makes writing our paper much easier.  Language itself is an abstract definition of our thoughts and feelings.   

Friday, September 21, 2012

Computer Programming and Mathematics

    Computers and Mathematics 
            As some of you may already know,there is a significant relationship between Mathematics and Computer Programming. Many mathematicians use programming to aid in their research. It can be an invaluable tool to achieving success in whatever proof you may be working on. My interest in how they connect is the algorithms you must create to apply to your program.     In order to utilize a computer program to aid you in mathematics you must first write an algorithm,assuming you already know the programming language you will be using. The algorithm must then be translated to work in the programming language you chose.    

               Prime Number Checking

        One of the most basic programming solutions is writing a program to find out if a given number is a prime number.  The first step is to develop your algorithm. There are many different ways to check the if a number is prime or not. Most of them fairly complex, however there is one very simple technique.  A prime number is only evenly divisible by one and itself. So the easiest way is to use modular division, which is simply  dividing two numbers and keeping only the remainder.  For example 32 modulo 5 = 2,
 because 5 goes into 32, 6 times with a remainder of 2. Since prime numbers are only evenly divisible by one and themselves, prime numbers would always have a remainder greater than 0 when divided by all other numbers(other than 1 and themselves). With this knowledge we know that we have to test all numbers between one and the number we want to check if its prime.This can be limited even further by adding that the factors on any number can not exceed the square root of that number. Now our plain language algorithm is :

get number and call it n
calculate square root of n
test all numbers >=2 and <= square root of n 
and if none of the numbers tested return a 0 remainder the number is prime

Java code to find if a number is prime

   Our next step is to translate our algorithm into computer code. I will use java because that's my favorite so far. If you are not familiar with java you can find out more at http://docs.oracle.com/javase/tutorial/getStarted/index.html
The part of our algorithm where we calculate the square root and test all the numbers up to the square root is best achieved by a for() loop.the variable we will use to represent the number we want to test will be n and we will make it a "double" data type we will be using double for two reasons one the included Math.sqrt method we will be calling requires a double,.and the second reason is that we can check much higher numbers with double.The next variable we want will be used to store the numbers we are using in our modular division we will call it k and make it a double

lets code out our for() loop

double n;
double k;  
    for(double k = 2;i<=Math.sqrt(n);k++){
          if(n%k == 0){
              return false;
          }
  } return true;


That is our complete algorithm for prime checking translated into Java.  I have tested this algorithm for numbers up to 500 digits long before it started to slow my pc. which is a few years old. I will gladly answer any question or comments on how to implement this into your java project as well as put more posts with how to make other java programs related to mathematics. Just leave a comment with you questions, requests, or suggestions . Thank you for stopping by.