Wednesday, July 1, 2015

Propositional calculus: an introduction

Propositional calculus is the branch of mathematics that deals with the rules of logic and evaluation of statements or propositions. It is sometimes referred to as sentential calculus for its use of the sentential conjunctions. It is primarily concerned generating laws for evaluating conjugated statements. Propositional calculus is part of a broader science of logic and proof.


Some of the symbols used in propositional calculus:

Symbol
Meaning
¬
Not or negation
^
and
v
or
implies
If and only if
P
Sentential Statement
Q
Sentential
Statement
T
True
F
False

In propositional calculus the above symbols are used in constructing truth tables for evaluating compound or conjugated sentences. The truth tables provide a short hand tool for deriving new laws from the simple compound sentential statements. Truth tables like the one below shows some of the simple rules and the new rules derived from those.


P
Q
PQ
P^Q
PvQ
(P^Q)P
P ↔ Q
T
T
T
T
T
T
T
F
T
T
F
T
T
F
T
F
F
F
T
T
F
F
F
T
F
F
T
T



This is just a simple introduction to propositional calculus, it is part of a much broader branch of propositional logic . It is useful in the formulation of logic rules, and methods of proof.

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.    

Monday, June 1, 2015

Kindergarten Math worksheets

I know that I haven't posted in a while, I have been very busy getting my daughter ready to start kindergarten. In doing this, I found that worksheets have been extremely helpful. So I created a few math worksheets of my own to help out. I decided I would share them with you so you may download and print the the worksheets below.  You may need to open them on a new page to get them zoomed to the right size for printing.







Tuesday, July 30, 2013

Python and Prime number Lists

Prime numbers, although simple in definition, provide several complexities in the field of mathematics, as well as in computer science. For reference, prime numbers are natural numbers which are only divisible by one and themselves. On the surface, this definition seems straightforward and not an important area for research. However, there are a great many applications of prime numbers.  Prime numbers are essentially the building blocks of all other numbers.  For centuries, this unique set of numbers has mesmerized and even baffled some of the greatest mathematicians.  The distribution of prime numbers is another big area of mathematics research. It would be great if we could find a formula for the nth prime. Yet, it seems as though it would be impossible. We can however use computers to do this for us up to the limits of the processing power available.  No real efficient algorithms exist to find primes other than methods of iterating through every number up to the square root of a given number to determine if it is prime.  Finding the patterns with some high level mathematics, is being used but no solid proofs exist yet to revolutionize this area of research.  With this in mind I would like to continue with discussing python in mathematics. 

I previously showed a fairly simple program for Slope-intercept using python. The program served to output a formula in slope-intercept form given two points.   In another post on computer programming in mathematics, I included some Java code for testing if a number is prime. Below I have a Python code to ask for 2 numbers to serve as the starting point and ending point for  listing primes within that range.  I have not included any error checking or input checking,  so it is important to ensure this code works you must enter an integer greater than 1. If you do not do this you will not get a meaningful output or you will get errors.   This was written and tested in Idle 3.2 so it may not work as expected in other versions.  This code also utilizes the standard sieving algorithm to perform its prime checking so it is by no means efficient for larger inputs and can be very processor intensive
.   CAUTION!!!  only using this code to list primes in small ranges CAUTION!!!   The caution is here because I have locked up my computer trying to list primes from 2 – 10,000,000 I would recommend running it on ranges in the 100's It was originally written for educational and research purposes only.   I generally use it to write primes to text files to print out as educational resource materials.

#primecheck(x) checks if x is prime returns boolean#
def primecheck(x):
    i=2
    for i in range(2,x):
        if x%i == 0:
            return False
    return True
#primelist(start,stop) lists all prime numbers between start and stop#
def primelist():
    start = int(input('Enter starting point must be an integer greater than 1:  '))   
    stop = int(input('Enter ending point must be an integer greater than 1:   '))  
    i=2
    primeList = []
    for i in range(start,stop):
        if primecheck(i) == True:
            primeList.append(i)
    return primeList


print (primelist())

Sunday, July 28, 2013

Python Slope-Intercept

Python  is a wonderful programming language for quickly coding solutions to many problems. You can download python by going to python.org/download and selecting the version that’s best for your operating system.  Python can run from command line or though Idle that comes with most python downloads.   I have been working with python for almost a year now and it has become my “go to “for  
a lot of work in mathematics. It is not necessarily the “best” language for processor intensive mathematical algorithms, but it can offer efficient and quick solutions that can be easily applied to larger projects.  Recently, I have been doing some review of linear algebra and slope-intercept formulas. This is a fairly simple subject in mathematics but I thought it might be interesting to use python to solve some of these problems.   My solution might not be elegant but it is fairly simple.  I designed the program to take in two points (x1, y1), (x2, y2)  and output an equation of the line in slope-intercept form.   For those who may not be familiar slope-intercept form it is  y = mx + b where m is the slope and b is the y- intercept. The slope is calculated from the two given points by the formula (y1-y2)/(x1-x2) and the y -intercept can be found by 
b = y – mx.


Slope-intercept is useful in linear depreciation models.  For example:  if you bought a car at $81,292 and after 10 years it is only worth $33,121 to find out how much it will be worth after 13 years you can use slope-intercept to get a depreciation formula. The two points are at 0 years it is 81,292 (0, 81,292) and at 10 years it is 33,121 (10 , 33,121) substituting these numbers into our formulas you first find the slope which will represent the rate of depreciation.  You use the slope formula (y1-y2)/(x1-x2) 
(33,121 – 81,292) / (10-0) = -48,171 / 10 = -4817.1   and the y intercept is b = y – mx. 81292- 0(4817.1) = b= 81292 and putting it together you get y = (-4817.1) x + 81292 using this formula we can then determine the value of the car at 13 years by substituting 13 in for x
y = (-4817.1)13 + 81292 and we get 18,669.70 so after 13 years our car is worth $18,669.70
The Python code to find our linear depreciation formula is fairly straight forward
def slope():
    result = ''
    x = float(input("enter x one"))
    y = float(input("enter y one"))
    a = float(input("enter x two"))
    b = float(input("enter y two"))
    slope = (y-b)/(x-a)
    yint = y - (slope*x)
    if yint < 0:
        sign='-'
    else:
        sign='+'
    result = str("y="),str(slope),str("x"),sign,str(yint)
    return result
print(slope())

I use the input() method to take in the two points (x,y), (a,b)
then create a variable named “slope” and then immediately assign it to the formula to find the slope given 2 points (y-b)/(x-a). I then create a variable yint and assign it to the formula for the y-intercept. The if-else statement I use to aid with formatting because generally the + (plus sign) isn't displayed when you get a positive. The final line print(slope()) is there only for when you are running the code in console or idle if you were to convert this to a python module it won't be needed.  
I am sure there are more elegant and efficient ways of doing this as well as built-in python methods to make it display much better but that’s the beauty of python it’s easy to modify and play around with to get desired output style. 

Sunday, June 30, 2013

Standardized thinking.......

    Despite efforts from Washington, math education is still in trouble in the U.S.  We are now experiencing the so called “math wars”.  Educators are competing with policy makers, and mathematicians are challenging both.  The argument is that educators are focused on the mission and purity of education as a whole.  Education is the basis for lifelong learning and free thought.  When mathematics is concerned there is a wedge between mechanical learning and reasoning.  University mathematicians believe that teaching reasoning before standard algorithms is crippling student‘s abilities to learn the more advanced concepts in college level mathematics.  It is argued that before learning mathematical and numerical reasoning students must understand the standards of math.
The dangers of sticking to a mechanical standard algorithm approach are flexibility, intellectual growth, and individual ability. Flexibility refers to having a standard such as right to left based calculation. This concept alone can prove very confusing especially in younger students who are still honing their reading skills. In most languages, specifically English, students are learning to read from left to right. Every time they are exposed to any form of writing they are taught that it should be understood from left to right. When children begin learning math they are taught to read math in contradiction to all the other reading that they learn. In essence this can cause confusion in both subjects for most students.  Not only is the left to right approach quicker and easier, it also flows logically with the way we are taught to read.
Another issue is that when teachers are grounded with this single algorithm method, students who understand it differently are often punished with bad grades.  Some teachers are so set in the standard right to left and carry method, that if a student chooses to use a different method they are given a bad grade.  The stigma put on outside the norm computation will stunt the students drive and understanding of math. It places in them the “why am I wrong when I got the same answer?” argument.     I had a personal experience with this receiving a failing grade on a test because on the page where you “show your work” I did all multiplication from left to right. The teacher of the class I was in had no clue how that method worked and therefore failed me on my exam “for cheating”. The reason given was that the only way to multiply is the standard right to left so the work shown was an attempt to cover up cheating.  Now this is a specific individual example that does not reflect all teachers, but there are still some that are so set in the standard that “out of box” thinking is “out the window”.
Aside from flexibility, we have the issue of intellectual growth.  Intellectual growth is arguably the central idea of education.  The ability to think and reason is devastatingly uncommon among many adults and children.  Most educators wish to remedy this situation, by trying to step outside of the memorize and regurgitate on the test paradigm.  Standardized testing is standardizing thinking and learning which is destroying innovation and lifelong learning.  While most agree that some concepts should be tested and retained to be successful in college, the ways by which we test and use these concepts need to be modified. 

The last issue is individual ability. Going back to the personal example of being labeled a cheater for utilizing a method that was easiest to me was a stab at my individual abilities. That failure caused me to have to take a much lower level math class then I should have been in twice.  Luckily, the next time around I had a better informed teacher that removed me from that class put me into pre-calculus instead where I aced the exams.  The point is that no matter how you try to standardize people, we are all individuals with individual ability to understand the world around us.