Showing posts with label number systems. Show all posts
Showing posts with label number systems. Show all posts

Saturday, June 20, 2015

The "Reality" of math and logic

Logic has been used as a methodology even before its formalization. In order to survive, our progenitors had to be able to deduce whether a particular place or event was dangerous. These more earlier versions of ourselves, needed to determine what was safe to eat and where food was located. In this sense they were using logic intuitively.

As societies evolved, we became aware of a need for a system of accounting. We developed symbols to serve as abstract models for real world objects. Empirically , we can demonstrate the need for a modeling system. We can also demonstrate that these models of real world objects work. The models functionality means they can be used for future discoveries, and aids in civilization building.

Enumeration permeates our entire civilization and history on multiple levels. It observably exists separate from language. From the simplest counting systems, patterns began to emerge. The laws of mathematics became more complex, and a method of proof was needed that was empirically verifiable. The earliest proofs were purely empirical as used by the Pythagoreans and Thales of Miletus. Over time, mathematical proofs slowly became less heuristic and a formalized system of logic was becoming more prominent. Logic was largely an emergent aspect of these methods of empirical verification. The methods of logical proof slowly grew over the next two and half centuries from Thales around 550 BCE to Euclid around 300 BCE. Euclid is credited with formulation of the axiomatic method of proof.

The Euclidean style of proof through axioms, appears assumptive, or only justifiable a priori.
The axioms served as descriptions or definitions of geometric objects. The definitions could be demonstrated empirically in general, but they did rely on assumptions. For example, take the statement 2 points determine a line. This is a postulate proposed as self-evident, and deduced from it is many other theorems. If you were to take this as meaning all statements derived rely on a non-empirical premise you would be incorrect. The statement can be demonstrated as empirically true. You would simply have to draw a line through only one point. The line drawn, would be a point and not a line. To construct a line you would have no choice but to have it pass through multiple points. So, we can see the statement is both self-evident and empirically demonstrable.

The evolution of mathematical systems of proof allowed for a more formalized system of logic. All of which finds its origins in our innate pattern recognition. The ability to recognize patterns and natural desire to seek them out led to the mathematical modeling of real world objects. The modeling techniques made a complete system of logic and mathematics more easily constructed and shared. We formulated logical and mathematically complete laws and theorems from some of the simplest models.
We see that these models are intuitive,empirical, and justified in their use.



Tuesday, June 2, 2015

Positional Notation

Positional Notation



Our number system is base ten, as many learned in elementary school. Which means that there is only ten symbols to represent numbers. 0,1,2,3,4,5,6,7,8,9 . To represent ten we use 1 and 0 (10). Which when we learned place value, we recognized this as 1 in the tens place and 0 in the ones place. What this means is that the position of the symbol will determine the value of the number. For example when we see the symbol 34 we recognize it as 3 tens and 4 ones. We would often see something like:
Tens ones
3 4



 We are mostly taught this and just accept it as is and move on. To dig a little deeper into to place value I will introduce a new way of looking at this (Positional Notation) . To rewrite our example ,34, into positional notation we get this:



3 x 10¹ + 4 x 10º



The reason I write it this way is that is represents a number as powers of the base it is in. In this case it is base 10. Positional notation gives us a way of looking at numbers relevant to their base. The reason this is useful to learn, is that it gives us a quick way to convert numbers from other bases to base ten. For example, if you need to convert the number 101 in binary to base 10 you can rewrite 101 in positional notation and convert it easily. Since 101 is in binary we will use powers of 2 instead of 10 and we get



1 x 2² + 0 x 2¹ + 1 x  2º
1 x 4 + 0 x 2 + 1 x 1
4 + 0 + 1
5


As you can see from the table above just by rewriting the number into positional notation relevant to the base it is in you add it all up and you get the number in base 10. So when we convert 101 from binary to base ten we get 5.


 This is just a neat little trick I use to quickly convert numbers from other bases to base 10. With a little practice, you can convert numbers from most bases back to base ten almost effortlessly. There is other ways of converting number to other bases, I just really like this one.    

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.

Tuesday, February 21, 2012

Number Theory: Not as Scary as it Sounds


What is Number Theory?

                Number theory is simply the study of the properties of numbers. The topics in number theory range from a variety of fairly simple to extremely complex. (Most people can understand and follow along with topics in the middle of this range.) The simplest properties of numbers are still a topic of research in number theory today. A person can start becoming an amateur number theorist by simply picking a number and finding all of the ways that number can be mathematically manipulated. Then by paying attention to and recording any patterns that arise to see what new math tools you discover.  While doing this you can do a little research to find other ways to manipulate the numbers you chose, and through the induction/deduction process of logic find your own theories. You might not find anything groundbreaking, but you will certainly find fun ways to learn and enjoy math on your own. I found an interesting “shortcut for multiplying by the number nine by simply making a chart of all of the multiples of nine and analyzed it until I found a pattern. I am not sure if someone else has already found this or not, but it was a very fun “trick” to use. You can find a full explanation with examples here Multiplying by 9,99,999...etc
                In high school, you were taught some of the basic properties of multiplication.  Such as: the distributive property, and  the associative property. You were most likely shown a formula to explain these similar to
a(b+c) = ab+bc, Which describes the distributive property.
Well where did we get this?  It is simply a result of number theory, or another way to define it is the logic of numbers. It is difficult to tell who to actually give credit to for discovering this property; it is one of the most widely used properties in mathematics.  It was, however; discovered by analyzing the properties and patterns found when multiplying and dividing numbers. The use of the letters, or variables, comes from what is called abstraction. Abstraction is simply taking something out of its original context and making a general form of it. This is not a great definition, but hopefully you see that when we find a pattern that is very useful, we need to make a method to apply it to all numbers.
Now some may understand the distributive property better if it is shown with actual numbers. Like this 2(3+4) =  2x3 + 2x4  but without abstraction some people would look at the example using numbers and think it only applies to those numbers.  Effective abstraction leads into using proofs to check your pattern to see if it applies to all numbers or just a certain set of numbers of numbers with specific properties.  I will leave that discussion for another post. Hopefully, this will give you a basic understanding of what number theory is and inspire you to learn more. 

Monday, February 6, 2012

Converting a number from base 10 to base 6

steps to convert to base 6 from base 10


Ill illustrate by example and explain each step as I go.


First you will set up your problem.  lets say we want to convert 200 to base 6

the problem will be set up as follows  200 =      x  6  +        in the first  blank,     , we divide 200 by 6 and drop the remainder which is 33  which makes our problem look like this 200 = 33 x 6 +    
now for the second blank we place the remainder,  which we dropped in the first step  which gives us this:
 200 = 33 x 6 + 2

The next step is you take the 33 and repeat what you did in the first step and placing it under the first part of or problem   like this        

200 = 33 x 6 + 2
33   =  5  x 6 +3


Then you take the 5 and do the same thing. and you end up with  200 = 33 x 6 + 2
                                                                                                   33   =  5  x 6 +3
                                                                                                    5  =   0 x 6  + 5
You then will take the remainders and from bottom to top and you get 532


This method works when converting to other bases as well