The probablility that the end of the world will save you from taking the final in my class are very low indeed.
Thursday, May 19, 2011
Error in the answer sheet for Homework 13
It should be FRIDAY AT 5:00 A.M., not Thursday at 5:00 a.m.
Sorry for the screw-up.
Sorry for the screw-up.
Saturday, May 7, 2011
Problems involving interest, monthly payments and down payments.
a) A house is selling for $300,000. You have $20,000 to put down, and the rest you will be financing on a 30 year loan at 6.25%. What is your monthly payment, rounded to the nearest penny?
b) A house is selling for $300,000. You have $20,000 to put down, and the rest you will be financing on a 15 year loan at 6.25%. What is your monthly payment, rounded to the nearest penny?
c) You have $30,000 to put down and you can afford payments of $1500 a month for mortgage. How expensive a house can you afford to buy on 30 year loan at 6.25% interest?
d) You have $30,000 to put down and you can afford payments of $1500 a month for mortgage. How expensive a house can you afford to buy on 15 year loan at 6.25% interest?
Answers in the comments.
b) A house is selling for $300,000. You have $20,000 to put down, and the rest you will be financing on a 15 year loan at 6.25%. What is your monthly payment, rounded to the nearest penny?
c) You have $30,000 to put down and you can afford payments of $1500 a month for mortgage. How expensive a house can you afford to buy on 30 year loan at 6.25% interest?
d) You have $30,000 to put down and you can afford payments of $1500 a month for mortgage. How expensive a house can you afford to buy on 15 year loan at 6.25% interest?
Answers in the comments.
Thursday, May 5, 2011
correction on homework 12
As Aliah Johnson pointed out correctly in class, the principal P is the list price - down payment. This is the amount being financed. Change the definition of P AND change the definition of monthly payment to Total/12t.
Sorry for the confusion. Practice problems will be posted by tomorrow, May 6.
Sorry for the confusion. Practice problems will be posted by tomorrow, May 6.
Wednesday, April 27, 2011
Descartes and Pascal.
There were many people who came before Newton that helped pave the way for the invention of calculus, the mathematical tool that make modern physics possible.

Blaise Pascal was a French philosopher and mathematician. A very devout man, he put forward the idea that everyone should have faith in Jesus as the Lord and savior for mathematical reasons. The payoff for believing was life eternal and the payoff for not believing was hell, so the better situation was infinitely better than the worse. Even if there was only a small but finite chance it was true, the infinite payoff made it worth taking the chance.

The most famous mathematical object that bears his name is Pascal's Triangle. Pascal did not invent it and he called it the arithmetical triangle. (It's bad form to name stuff after yourself in math). While he didn't invent it, his treatise on its properties cataloged almost everything that was known about the array of numbers at the time, so other people studying it took to calling it Pascal's Triangle after he was dead.
René Descartes was also a French mathematician and philosopher. His most famous philosophical statement is "I think, therefore I am." (In Latin, Cogito Ergo Sum.) His point was that he must exist because he is both the originator and only witness to his own thoughts, which are the start of anything he can bring into existence. (Movies like The Matrix and Inception actually explore this philosophical idea a little deeper.)

Cartesian coordinates are named for Descartes, and this simple idea was able to link the fields of algebra and geometry in new and important ways. Cartesian coordinates can be extended into three dimensions (x, y, z) rather easily, and the math is not that hard to extend his ideas into four dimensions and beyond.

Pascal and Descartes had a major falling out over, of all things, a barometer, which was a new invention at the time, developed by the Italian Torricelli in 1643. Pascal bought one and had it shipped from Italy. He began measuring air pressure everywhere he could take his cool new toy. He noticed the air pressure on the roof of the cathedral of Notre Dame was always lower than it was on the ground floor, so he postulated (correctly) that as you go up in altitude, the air pressure goes down. He took this small amount of data to the correct conclusion that if you get high enough above sea level, eventually the air pressure must shrink to effectively zero, and the space around the earth was a vacuum.
Descartes heard his argument and was not convinced. His counter-argument was that the Sun was a fire and fires cannot burn in vacuums. Pascal did not have an answer for this, so Descartes considered that he won the argument. (In fact, both of them are right. the Sun is a nuclear furnace, so it does not need the oxygen of an atmosphere to burn. The ideas of nuclear physics were still centuries away, so neither of them could have known how it worked.)
Descartes wrote a letter to a friend that had this insulting sentence: "Monsieur Pascal has too much vacuum in his brain."
<br>

Blaise Pascal was a French philosopher and mathematician. A very devout man, he put forward the idea that everyone should have faith in Jesus as the Lord and savior for mathematical reasons. The payoff for believing was life eternal and the payoff for not believing was hell, so the better situation was infinitely better than the worse. Even if there was only a small but finite chance it was true, the infinite payoff made it worth taking the chance.

The most famous mathematical object that bears his name is Pascal's Triangle. Pascal did not invent it and he called it the arithmetical triangle. (It's bad form to name stuff after yourself in math). While he didn't invent it, his treatise on its properties cataloged almost everything that was known about the array of numbers at the time, so other people studying it took to calling it Pascal's Triangle after he was dead.
René Descartes was also a French mathematician and philosopher. His most famous philosophical statement is "I think, therefore I am." (In Latin, Cogito Ergo Sum.) His point was that he must exist because he is both the originator and only witness to his own thoughts, which are the start of anything he can bring into existence. (Movies like The Matrix and Inception actually explore this philosophical idea a little deeper.)
Cartesian coordinates are named for Descartes, and this simple idea was able to link the fields of algebra and geometry in new and important ways. Cartesian coordinates can be extended into three dimensions (x, y, z) rather easily, and the math is not that hard to extend his ideas into four dimensions and beyond.

Pascal and Descartes had a major falling out over, of all things, a barometer, which was a new invention at the time, developed by the Italian Torricelli in 1643. Pascal bought one and had it shipped from Italy. He began measuring air pressure everywhere he could take his cool new toy. He noticed the air pressure on the roof of the cathedral of Notre Dame was always lower than it was on the ground floor, so he postulated (correctly) that as you go up in altitude, the air pressure goes down. He took this small amount of data to the correct conclusion that if you get high enough above sea level, eventually the air pressure must shrink to effectively zero, and the space around the earth was a vacuum.
Descartes heard his argument and was not convinced. His counter-argument was that the Sun was a fire and fires cannot burn in vacuums. Pascal did not have an answer for this, so Descartes considered that he won the argument. (In fact, both of them are right. the Sun is a nuclear furnace, so it does not need the oxygen of an atmosphere to burn. The ideas of nuclear physics were still centuries away, so neither of them could have known how it worked.)
Descartes wrote a letter to a friend that had this insulting sentence: "Monsieur Pascal has too much vacuum in his brain."
<br>
Tuesday, April 12, 2011
regular tilings, platonic solids and Penrose tiles
Here are links to several posts with pictures from another blog I write that isn't all about math.
Regular tilings of the plane. (The stuff we talked about this Tuesday and we will continue to discuss it on Thursday before the Spring break.)
Platonic solids. (Kind of the same idea, but in three dimensions.)
Truncated platonic solids. (Things like soccer balls and geodesic domes.)
Penrose tiles. (Sir Roger Penrose made two non-regular quadrilaterals that can tile the plane, but not following the same pattern at every corner.)
Regular tilings of the plane. (The stuff we talked about this Tuesday and we will continue to discuss it on Thursday before the Spring break.)
Platonic solids. (Kind of the same idea, but in three dimensions.)
Truncated platonic solids. (Things like soccer balls and geodesic domes.)
Penrose tiles. (Sir Roger Penrose made two non-regular quadrilaterals that can tile the plane, but not following the same pattern at every corner.)
Tuesday, April 5, 2011
practice for the take home and in class triangle identification problems
Part A) In all the following problems where triangles are defined by lengths, we will use the number 11 and the other numbers must be whole numbers.
obtuse and isosceles: 11, 11, _____
acute and isosceles: 11, 11, _____
obtuse and scalene: 11, ___, ___
right and scalene: 11, ____, ____ (hint: 11 will be one of the legs.)
acute and scalene: 11, ____, ____
Part B) In all the following problems where triangles are defined by angles, we will use one angle of 34° and the other numbers must be whole numbers.
obtuse and isosceles: 34°, ____, _____
acute and isosceles: 34°, ____, _____
obtuse and scalene: 34°, ___, _____ (many correct answers.)
right and scalene: 34°, ____, ____
acute and scalene: 34°, ____, ____ (many correct answers.)
Answers in the comments.
obtuse and isosceles: 11, 11, _____
acute and isosceles: 11, 11, _____
obtuse and scalene: 11, ___, ___
right and scalene: 11, ____, ____ (hint: 11 will be one of the legs.)
acute and scalene: 11, ____, ____
Part B) In all the following problems where triangles are defined by angles, we will use one angle of 34° and the other numbers must be whole numbers.
obtuse and isosceles: 34°, ____, _____
acute and isosceles: 34°, ____, _____
obtuse and scalene: 34°, ___, _____ (many correct answers.)
right and scalene: 34°, ____, ____
acute and scalene: 34°, ____, ____ (many correct answers.)
Answers in the comments.
Tuesday, March 29, 2011
The triangle inequality and Heron's Formula with LOTS of practice problems.
In class, we discussed the Triangle Inequality, a way to check if three given numbers u, v and w, could possibly the lengths of the sides of some triangle. If the numbers are given in any old order, we have two inequalities to check.u + v >= w
AND
w >= |u - v|
Example: u = 6, v = 12, w = 4
6 + 12 >= 4 Yes, this is true.
AND
4 >= |6 - 12| No, this is false, so these three lengths cannot be the sides of a triangle.
Note: If you make w the long side no matter which way they are handed to you, all you have to check is if u + v >= w.
Let's do another example. u = 10, v = 12 and w = 6.
If we make the long side of 12 be w and the side of 6 be v, then all we have to check is
10 + 6 >= 12, and that is true. These could be the sides of a triangle.
If a triangle is defined for us by the lengths of three sides, the "easiest" way to find the area is Heron's Formula, named for the ancient Greek mathematician Heron, sometimes known as Hero. We add up the three sides to get the perimeter p, then we take ½p and call it s, the semi-perimeter. The area is the square root of the products(s - u)(s - v)(s - w).
Let's take the example of sides 6, 10 and 12. The perimeter is 28 and the semi-perimeter is 14. Our formula reads as follows
Area = sqrt(14(14-12)(14-10)(14-6)) = sqrt(14*2*4*8).
Factoring we get sqrt(7*2*2*2*2*2*2*2), which means we have three pairs of twins and one 2 that will be left under the square root sign. This gives us 2*2*2*sqrt(7*2) or 8*sqrt(14). If we want to round to the nearest thousandth 8*sqrt(14) ~= 29.933.
Practice problems . Someone in class asked for a LOT of practice problems so here goes. Here is a list of every possible combination of three positive numbers less than 4. The largest number will be listed last. If u + v = w, then it is a straight line segment with a point on the segment as the vertex. If u + v < w, it's not a triangle at all and only if u + v > w do the three sides create an actual triangle with area.
Part 1. For all these examples, determine if the lengths can create a triangle (answer YES), a straight line (answer STRAIGHT) or not a triangle (answer NO).
a) 1, 1, 1
b) 1, 1, 2
c) 1, 1, 3
d) 1, 1, 4
e) 1, 2, 2
f) 1, 2, 3
g) 1, 2, 4
h) 1, 3, 3
i) 1, 3, 4
j) 1, 4, 4
k) 2, 2, 2
l) 2, 2, 3
m) 2, 2, 4
n) 2, 3, 3
o) 2, 3, 4
p) 2, 4, 4
q) 3, 3, 3
r) 3, 3, 4
s) 3, 4, 4
t) 4, 4, 4
Part 2.
For every triplet of numbers that is a triangle, find the area as a square root and rounded to the nearest thousandth.
Answers in the comments.
Friday, March 25, 2011
Distance, Slope and area of a triangle given two points and the origin (0,0)

The idea of putting horizontal and vertical coordinates on points on a plane is about 400 years old now, and much of the credit goes to mathematician and philosopher René Descartes, working with the amateur mathematician Father Marin Mersenne. The name Cartesian coordinates comes from Descartes' last name. Instead of using a lot of different letters for the coordinates, we will be using subscripts for points, such as (x1, y1), (x2, y2), (x3, y3), etc.
Distance between points: The distance formula is really The Pythagorean Theorem. Our coordinate system makes it easy to create a right triangle between any two points that aren't on the same horizontal or vertical line. (If they are on the same horizontal line, then y1 = y2. If they are on the same vertical line, then x1 = x2.) The horizontal leg of the triangle has length that is the absolute difference |x1 - x2|, and the vertical leg has length |y1 - y2|. The sum of the squares of the legs is the square of the hypotenuse, so we take the square root to find the distance.
Slope: Slope is a number which defines the steepness of a line segment by rise/run, which means the difference in y divided by the difference in x. Any time we have a fraction in a formula, we have to be careful that the denominator is not zero, because we are not allowed to divide by zero. (Quick mnemonic: 0/K is okay because it's zero, N/0 is no can do.) The formula can be written as (y1 - y2)/(x1 - x2) or (y2 - y1)/(x2 - x1). In other words, it doesn't matter if you put the coordinates from point 1 first or the coordinates from point 2 first, AS LONG AS YOU ARE CONSISTENT.
A slope of 0 means the y coordinates are equal and the line is horizontal. A positive slope means the line is "uphill" as we go from left to right and a negative slope means we go "downhill" as we go from left to right. The larger the absolute value of the slope, the steeper a line is. A vertical line has no "run" because the x values are the same, and that means dividing by zero, which we have already said doesn't work. A vertical line has undefined slope. (Sometimes people will say it has no slope, which is technically true but it sounds like the slope is zero. As much as possible, I will used the phrase undefined slope to try to avoid this confusion. If you put "no slope" as an answer when it should be "undefined slope", expect to get a half point marked off.)
The area of a triangle defined by (0, 0), (x1, y1) and (x2, y2): You may have learned that the area of a triangle is 1/2 the base times the height, but sometimes you aren't given the base and the height and other formulas are used instead. If given three coordinate points and one of them is the origin (0, 0), the formula for the area is ½|x1y2 - x2y1|. The absolute value sign is necessary because area, like distance, is usually thought of as non-negative. I write "non-negative" instead of "positive" because if you pick three points at random, it's possible you have three points that are all on the same line, which we call co-linear, and if that happens, what you draw is not really a triangle but instead a line segment, which would mean the base exists but the height is zero, so the area is zero.
Example: Consider the points (7, 1) and (-2, 3).
Distance from (7, 1) and (-2, 3):
sqrt((7 -(-2))²+(1 - 3)²) = sqrt(9² + 2²) = sqrt(81 + 4) = sqrt(85).
(note: 85 is 17x5, so it is a square free number and can't be simplified.)
Slope of the line that runs through (7, 1) and (-2, 3):
(1-3)/(7-(-2)) = -2/9. This means a downhill slope, and every time we move 9 units to the right, we move 2 units down. (Conversly, if we move 9 units to the left, we move 2 units up.)
Note: if we switch the points and write the fraction as (3-1)/(-2-7), we get 2/(-9), which is still -2/9.
Area of the triangle with vertices (0, 0), (7, 1) and (-2, 3).
½|7*3 - 1*-2| = ½|21 -(-2)| = ½|23| = 11½ or 11.5. If we have all points that have integer coordinates (known in the literature as lattice points), then the area will be a whole number or a whole number + ½.
Further problem on triangle area: What if we have three points but none of them is (0, 0)?
In this case, pick one of the points and subtract its x value from all the x values AND subtract its y value from all the y values. What this does is rigidly move the original triangle to one of the exact same size and shape that does have a point at the origin (0, 0). The selection of the point is arbitrary and the area will be the same no matter what point is chosen.
Example: What is the area of the triangle formed by the points (7, 6), (2, -1) and (8, 14)?
I'm going to pick the point (2, -1) to be the point that gets moved to the origin because 2 and -1 are small and easy to subtract from the other values.
(7-2, 6-(-1)) = (5, 7)
(2-2, -1-(-1)) = (0, 0)
(8-2, 14-(-1)) = (6, 15)
The area of the triangle with vertices at (0, 0) , (5, 7) and (6, 15) = ½|5*15 - 7*6| = ½|75 - 42|
= ½|33| = 16.5 or 16½.
Practice problems:
a) Find the distance between (9, 4) and (-1, 2).
b) Find the slope of the line that connects (9, 4) and (-1, 2)
c) Find the area of the triangle with vertices at (0, 0), (9, 4) and (-1, 2).
d) Find the area of the triangle with vertices at (12, 7), (9, 4) and (-1, 2).
Answers in the comments.
Labels:
area of a triangle,
distance,
practice problems,
slope
Wednesday, March 23, 2011
Simplifying and approximating square roots.
In class, we worked on simplifying square roots, which means taking sqrt(n) and turning it into a x sqrt(b), where b is a square free number. We used what I call the prison break method, where a pair of twins under the square root sign can make a break for it, but only one gets out and the other is shot trying to escape. (Thanks, Mrs. Kruger!)
sqrt(20) = sqrt( 2 x 2 x 5), so one of the pair of 2s can be brought out, while the 5 stays inside.
sqrt(20) = 2 x sqrt(5)
We can also go to our calculator and get an approximation of sqrt(20) = 4.472135955..., a decimal number that continues on forever and never gets into an infinitely repeating pattern because it is an irrational number. If we round, we get an approximation of sqrt(20), but the idea is that sqrt(20) = 20 exactly, and the approximations won't be exactly 20 when we square them.
sqrt(20) rounded to one place after the decimal = 4.5
4.5² = 20.25
sqrt(20) rounded to two places after the decimal = 4.47
4.47² = 19.9809
sqrt(20) rounded to three places after the decimal = 4.472
4.472² = 19.998784
Approximating to three places after the decimal is fairly standard, since the square of that approximation is usually off by less than a hundredth. For example,
sqrt(999) = 31.60696126... or 31.607 approximated to three places after the decimal
31.607² = 999.002449
Practice problems.
For the following square roots, simplify and approximate to three places after the decimal, then find the square of the approximation.
sqrt(72)
sqrt(73)
sqrt(74)
sqrt(75)
Answers in the comments.
sqrt(20) = sqrt( 2 x 2 x 5), so one of the pair of 2s can be brought out, while the 5 stays inside.
sqrt(20) = 2 x sqrt(5)
We can also go to our calculator and get an approximation of sqrt(20) = 4.472135955..., a decimal number that continues on forever and never gets into an infinitely repeating pattern because it is an irrational number. If we round, we get an approximation of sqrt(20), but the idea is that sqrt(20) = 20 exactly, and the approximations won't be exactly 20 when we square them.
sqrt(20) rounded to one place after the decimal = 4.5
4.5² = 20.25
sqrt(20) rounded to two places after the decimal = 4.47
4.47² = 19.9809
sqrt(20) rounded to three places after the decimal = 4.472
4.472² = 19.998784
Approximating to three places after the decimal is fairly standard, since the square of that approximation is usually off by less than a hundredth. For example,
sqrt(999) = 31.60696126... or 31.607 approximated to three places after the decimal
31.607² = 999.002449
Practice problems.
For the following square roots, simplify and approximate to three places after the decimal, then find the square of the approximation.
sqrt(72)
sqrt(73)
sqrt(74)
sqrt(75)
Answers in the comments.
Thursday, March 17, 2011
Square root practice.
The square root sign is not available with the editor for Blogger (not an extended ASCII symbol is the nerdy explanation), so I will be writing sqrt(n) to indicate the square root of n.
The Pythagorean Theorem tells us that a² + b² = c², where a and b are the short sides of a right triangle, called the "legs", and c is the long side opposite the right angle, known as the "hypotenuse". This means since the square of the hypotenuse is equal to a² + b², the hypotneuse itself is equal to sqrt(a² + b²). What this means is we can find the square root of any number that is the sum of two perfect squares. Here are some examples.
If the legs are 1 and 1, then 1² + 1² = 2 = c², so c = sqrt(2)
If the legs are 1 and 2, then 1² + 2² = 5 = c², so c = sqrt(5)
If the legs are 1 and 3, then 1² + 3² = 10 = c², so c = sqrt(10)
We can also re-arrange the equation to a² = c² - b², which means we can find the square root of any number that can be written as the difference of two squares.
If the hypotenuse is 2 and one of the legs is 1, then 2² - 1² = 3 = a², so a = sqrt(3)
If the hypotenuse is 3 and one of the legs is 1, then 3² - 1² = 8 = a², so a = sqrt(8)
If the hypotenuse is 5 and one of the legs is 2, then 5² - 2² = 21 = a², so a = sqrt(21)
Here are some practice problems.
1) Make a right triangle that will have two whole number side lengths and one side with length of sqrt(7).
2) Make a right triangle that will have two whole number side lengths and one side with length of sqrt(18).
3) Make TWO different right triangles that will have two whole number side lengths and one side with length of sqrt(20).
4) Make TWO different right triangles that will have two whole number side lengths and one side with length of sqrt(50).
Answers in the comments.
The Pythagorean Theorem tells us that a² + b² = c², where a and b are the short sides of a right triangle, called the "legs", and c is the long side opposite the right angle, known as the "hypotenuse". This means since the square of the hypotenuse is equal to a² + b², the hypotneuse itself is equal to sqrt(a² + b²). What this means is we can find the square root of any number that is the sum of two perfect squares. Here are some examples.
If the legs are 1 and 1, then 1² + 1² = 2 = c², so c = sqrt(2)
If the legs are 1 and 2, then 1² + 2² = 5 = c², so c = sqrt(5)
If the legs are 1 and 3, then 1² + 3² = 10 = c², so c = sqrt(10)
We can also re-arrange the equation to a² = c² - b², which means we can find the square root of any number that can be written as the difference of two squares.
If the hypotenuse is 2 and one of the legs is 1, then 2² - 1² = 3 = a², so a = sqrt(3)
If the hypotenuse is 3 and one of the legs is 1, then 3² - 1² = 8 = a², so a = sqrt(8)
If the hypotenuse is 5 and one of the legs is 2, then 5² - 2² = 21 = a², so a = sqrt(21)
Here are some practice problems.
1) Make a right triangle that will have two whole number side lengths and one side with length of sqrt(7).
2) Make a right triangle that will have two whole number side lengths and one side with length of sqrt(18).
3) Make TWO different right triangles that will have two whole number side lengths and one side with length of sqrt(20).
4) Make TWO different right triangles that will have two whole number side lengths and one side with length of sqrt(50).
Answers in the comments.
Labels:
practice problems,
Pythagorean theorem,
square roots
Tuesday, March 15, 2011
Set theory practice.

I haven't put any set theory practice problems up on the website before because the editor software for this blog can't put up the symbols for union, intersection and complement in regularly typed sentences. So instead, I'm going to use the words union, intersect and -bar to take the place of those symbols. I'm also going to use A - B to mean A intersect B-bar, which means the stuff that is in A but is NOT in B.
U = {a, b, c, d, e, f}
P = {f, a, d, e}_____Card(P) = 4
Q = {c, a, b}_______Card(Q) = 3
R = {c, e, d, e, d}___ Card(R) = 3 (there are two copies of the letters e and d, but each only counts once)
Find the following sets and their cardinalities using the set operations we have learned in class.
P union Q = __________
Card(P union Q) = ______
P intersect R = __________
Card(P intersect R) = ______
P-bar union Q-bar = __________
Card(P-bar union Q-bar) = ______
(P union Q) intersect R = __________
Card((P union Q) intersect R) = ______
P union (Q intersect R) = __________
Card(P union (Q intersect R)) = ______
Answers in the comments.
Tuesday, March 8, 2011
Five eccentric 19th British mathematicians who started mathematical logic.
Mathematical logic got its first great boost forward in the 19th Century, though at the time there was little practical use to it.

George Boole is considered the originator of modern mathematical logic, so much so that the field is called Boolean Algebra. He wrote his important treatise The Laws of Thought in the 1850s.

Augustus de Morgan is another important pioneer. The ways to distribute a not sign ~ through parentheses are called de Morgan's laws.
~(p v q) = ~p ^ ~q
~(p ^ q) = ~p v ~q
He was one of the first professors at University College London, the first major school in Great Britain that accepted students who were not Church of England, which meant that Catholics, Jews, protestants of denominations other that Church of England and those who professed no faith whatsoever could get a first class education in Great Britain.
~(p v q) = ~p ^ ~q
~(p ^ q) = ~p v ~q
He was one of the first professors at University College London, the first major school in Great Britain that accepted students who were not Church of England, which meant that Catholics, Jews, protestants of denominations other that Church of England and those who professed no faith whatsoever could get a first class education in Great Britain.

Charles Babbage was another British logician, and he wanted to take mathematical logic to the next step. He designed the world's first mechanical computers, the Difference Engine and the Analytical Engine, both of which were designed to run on steam. Problems arose when trying to build the machines and neither was ever completed.

This did not stop Countess Ada Lovelace, the only legitimate daughter of the famed British poet Lord Byron, from designing programs for Babbage's machines. The Countess Lovelace was educated by de Morgan and is given credit as the first computer programmer. the language Ada is named after her.

The best known of the British eccentrics fascinated with logic in the 19th Century was Charles Dodgson a.k.a. Lewis Carroll. While still famous for Alice in Wonderland, he was also a mathematician, clergyman and photographer, and enjoyed putting together logic puzzles based on the ideas of syllogism using silly but logical statements. For example:
(a) No ducks waltz.
(b) No officers ever decline to waltz.
(c) All my poultry are ducks.
Therefore (d) None of my poultry are officers.
(a) No ducks waltz.
(b) No officers ever decline to waltz.
(c) All my poultry are ducks.
Therefore (d) None of my poultry are officers.
Here is also a link to the biographies of five 20th Century mathematicians who made great contributions to the field of computer science when it was much more practical.
Friday, February 25, 2011
Practice for logical operators
The editor for blog posts doesn't have a symbol that looks like the arrow for implication, so these are the symbols I will use here for the logical operators.
^ is AND
v is OR
~ is NOT
=> is IMPLIES
p = 1101
q = 1000
r = 0110
Find the bitstrings that correspond to these logical operations.
a) p v q
b) p ^ ~r
c) r => q
d) ~r => q
e) ~(r => q)
f) p v q ^ r
Answers in the comments.
More practice problems here .
^ is AND
v is OR
~ is NOT
=> is IMPLIES
p = 1101
q = 1000
r = 0110
Find the bitstrings that correspond to these logical operations.
a) p v q
b) p ^ ~r
c) r => q
d) ~r => q
e) ~(r => q)
f) p v q ^ r
Answers in the comments.
More practice problems here .
Thursday, February 17, 2011
Algorithms to convert between binary, decimal and hexadecimal representation.
As we discussed in class, the word "algorithm" just means "method", but like most mathematical terms, there are special stipulations. The method always has to work, it must always take a finite amount of steps, and each step must take a finite amount of time to complete.
Decimal, or base 10, is the number system we are used to. Binary, or base 2, is the number system a computer uses, storing all its information as a string of 1s and 0s. Hexadecimal, or base 16, is kind like a compromise, a way to easily represent binary numbers in a way that takes less writing and is easier for the human programming the machines to read.
The algorithm from decimal to binary.
Start with a number written in decimal representation. We are going to build its equivalent binary representation bit by bit from the ones place to the twos place to the fours place, etc., which means building from right to left.
Step 0. Start with a decimal number and an empty representation for the binary equivalent.
Step 1. Is the ones digit of the decimal representation even or odd? If even, put a 0 in the first place to left of the current binary representation. If odd, put a 1 in the first place to the left of the current binary representation.
Step 2. Divide the current decimal representation by 2. If the result is more than 1, go to Step 1. If it is less than 1, STOP. We now have the correct binary representation of the original decimal number.
Example. Let's change 75dec to its binary equivalent.
Step 1a. 75 is odd so our current binary representation will be 1bin.
Step 2a. 75/2 = 37.5, bigger than 1, so we continue.
Step 1b. the ones place of 37.5 is odd so our current binary representation will be 11bin.
Step 2b. 37.5/2 = 18.75, bigger than 1, so we continue.
Step 1c. the ones place of 18.75 is even so our current binary representation will be 011bin.
Step 2c. 18.75/2 = 9.375, bigger than 1, so we continue.
Step 1d. the ones place of 9.375 is odd so our current binary representation will be 1011bin.
Step 2d. 9.375/2 = 4.6375, bigger than 1, so we continue.
Step 1e. the ones place of 4.6375 is even so our current binary representation will be 0 1011bin.
Step 2e. 4.6375/2 = 2.34375, bigger than 1, so we continue.
Step 1f. the ones place of 2.34375 is even so our current binary representation will be 00 1011bin.
Step 2f. 2.34375/2 = 1.171875, bigger than 1, so we continue.
Step 1g. the ones place of 1.17... is even so our current binary representation will be 100 1011bin.
Step 2f. 1.17.../2 = 0.58..., less than 1, so we STOP.
75dec = 100 1011bin
The algorithm from binary to decimal.
How can we check that 100 1011bin is equal to 75dec? The easiest way is to match up the bits that are 1s with the powers of 2 they correspond to in the binary representation. The powers of two, starting with 2^0 = 1, are as follows:
1, 2, 4, 8, 16, 32, 64,...
Match the powers from lowest to highest with the bits from right to left.
1 -> 1
2 -> 1
4 -> 0
8 -> 1
16 -> 0
32 -> 0
64 -> 1
That's all the bits in our string, so we add up the powers of two that correspond to the bits that are 1, which are marked in bold in the list above.
64 + 8 + 2 + 1 = 75 in base 10.
The algorithm from hexadecimal to binary and back.
If we take a bit string of length 4, we can represent all the numbers from 0 to 15 in decimal. The idea of hexadecimal is to have a single numeral represent each of these bit patterns, so this means we need a total of 16 symbols instead of ten. Hexadecimal uses a, b, c, d, e and f as the extra symbols and the pattern is as follows
binary hexadecimal
0000______0
0001______1
0010______2
0011______30100______4
0101______5
0110______6
0111______71000______8
1001______9
1010______a (corresponds to 10 in decimal)
1011______b (corresponds to 11 in decimal)
1100______c (corresponds to 12 in decimal)
1101______d (corresponds to 13 in decimal)
1110______e (corresponds to 14 in decimal)
1111______f (corresponds to 15 in decimal)
This is why we put the courtesy gaps between binary numbers every four places starting from the right. Read each four bit pattern and make the translation. If a bitstring has less than four bits, fill in leading zeros to make it a four bit long string. For example, 11bin would become 0011bin, which translates to 3hex. Or 101bin would become 0101bin, or 5hex.
The translation can work in either direction, so f1dhex = 1111 0001 1101bin.
The algorithm from hexadecimal to decimal.
Step 1: Take the first digit on the left of the hexadecimal number and change it to decimal. This means a becomes 10, b becomes 11, ... up to f becomes 15. If the digit is already 9 or less, you don't have to change it. This number is the first pass at your running total.
Step 2: If there are still more digits, multiply your running total by 16, change the next digit to decimal and add that to the running total. Continue with step 2 until all digits are exhausted.
Example: f1dhex. The first digit on the left is f, which corresponds to 15 in decimal, so the running total starts at 15.
There are more digits still, so we multiply the total by 16 and add the next digit.
15x16 + 1 = 241, our new running total.
We still have digits, so we multiply the running total by 16 and add the next digit d, which corresponds to 13.
241x16 + 13 = 3,856 + 13 = 3,869
That's the last digit, so we should be done. f1dhex = 3869dec.
The algorithm from decimal to hexadecimal.
One way to do this is to go from decimal to binary, then binary to decimal. Let's take 3869dec and change it to binary. If we did everything right in the steps above, we should get the binary number 1111 0001 1101, which translates into f1dhex.
dividing 3869 by two, looking at the ones digit for even or odd, then dividing the new number by two, again and again until the division produces a number less than 1
3869___ 9 is odd, so the first bit on the right is 1bin.
1934.5___ 4 is even, so the bits are now 01bin.
967.25___ 7 is odd, so the bits are now 101bin.
483.625___ 3 is odd, so the bits are now 1101bin.
241.8125___ 1 is odd, bits are 1 1101bin.
120.9...____ 0 is even, bits are 01 1101bin.
60.45...____ 0 is even, bits are 001 1101bin.
30.226...___ 0 is even, bits are 0001 1101bin.
15.113...____ 5 is odd, bits are 1 0001 1101bin.
7.5566...____ 7 is odd, bits are 11 0001 1101bin.
3.778..._____ 3 is odd, bits are 111 0001 1101bin.
1.889..._____ 1 is odd bits are 1111 0001 1101bin.
0.944... less than 1 so done. The final bit string is 1111 0001 1101bin.
That bitstring does correspond to the hexadecimal number we hoped we would get, f1dhex.
Here are some practice problems with solutions.
Decimal, or base 10, is the number system we are used to. Binary, or base 2, is the number system a computer uses, storing all its information as a string of 1s and 0s. Hexadecimal, or base 16, is kind like a compromise, a way to easily represent binary numbers in a way that takes less writing and is easier for the human programming the machines to read.
The algorithm from decimal to binary.
Start with a number written in decimal representation. We are going to build its equivalent binary representation bit by bit from the ones place to the twos place to the fours place, etc., which means building from right to left.
Step 0. Start with a decimal number and an empty representation for the binary equivalent.
Step 1. Is the ones digit of the decimal representation even or odd? If even, put a 0 in the first place to left of the current binary representation. If odd, put a 1 in the first place to the left of the current binary representation.
Step 2. Divide the current decimal representation by 2. If the result is more than 1, go to Step 1. If it is less than 1, STOP. We now have the correct binary representation of the original decimal number.
Example. Let's change 75dec to its binary equivalent.
Step 1a. 75 is odd so our current binary representation will be 1bin.
Step 2a. 75/2 = 37.5, bigger than 1, so we continue.
Step 1b. the ones place of 37.5 is odd so our current binary representation will be 11bin.
Step 2b. 37.5/2 = 18.75, bigger than 1, so we continue.
Step 1c. the ones place of 18.75 is even so our current binary representation will be 011bin.
Step 2c. 18.75/2 = 9.375, bigger than 1, so we continue.
Step 1d. the ones place of 9.375 is odd so our current binary representation will be 1011bin.
Step 2d. 9.375/2 = 4.6375, bigger than 1, so we continue.
Step 1e. the ones place of 4.6375 is even so our current binary representation will be 0 1011bin.
Step 2e. 4.6375/2 = 2.34375, bigger than 1, so we continue.
Step 1f. the ones place of 2.34375 is even so our current binary representation will be 00 1011bin.
Step 2f. 2.34375/2 = 1.171875, bigger than 1, so we continue.
Step 1g. the ones place of 1.17... is even so our current binary representation will be 100 1011bin.
Step 2f. 1.17.../2 = 0.58..., less than 1, so we STOP.
75dec = 100 1011bin
The algorithm from binary to decimal.
How can we check that 100 1011bin is equal to 75dec? The easiest way is to match up the bits that are 1s with the powers of 2 they correspond to in the binary representation. The powers of two, starting with 2^0 = 1, are as follows:
1, 2, 4, 8, 16, 32, 64,...
Match the powers from lowest to highest with the bits from right to left.
1 -> 1
2 -> 1
4 -> 0
8 -> 1
16 -> 0
32 -> 0
64 -> 1
That's all the bits in our string, so we add up the powers of two that correspond to the bits that are 1, which are marked in bold in the list above.
64 + 8 + 2 + 1 = 75 in base 10.
The algorithm from hexadecimal to binary and back.
If we take a bit string of length 4, we can represent all the numbers from 0 to 15 in decimal. The idea of hexadecimal is to have a single numeral represent each of these bit patterns, so this means we need a total of 16 symbols instead of ten. Hexadecimal uses a, b, c, d, e and f as the extra symbols and the pattern is as follows
binary hexadecimal
0000______0
0001______1
0010______2
0011______30100______4
0101______5
0110______6
0111______71000______8
1001______9
1010______a (corresponds to 10 in decimal)
1011______b (corresponds to 11 in decimal)
1100______c (corresponds to 12 in decimal)
1101______d (corresponds to 13 in decimal)
1110______e (corresponds to 14 in decimal)
1111______f (corresponds to 15 in decimal)
This is why we put the courtesy gaps between binary numbers every four places starting from the right. Read each four bit pattern and make the translation. If a bitstring has less than four bits, fill in leading zeros to make it a four bit long string. For example, 11bin would become 0011bin, which translates to 3hex. Or 101bin would become 0101bin, or 5hex.
The translation can work in either direction, so f1dhex = 1111 0001 1101bin.
The algorithm from hexadecimal to decimal.
Step 1: Take the first digit on the left of the hexadecimal number and change it to decimal. This means a becomes 10, b becomes 11, ... up to f becomes 15. If the digit is already 9 or less, you don't have to change it. This number is the first pass at your running total.
Step 2: If there are still more digits, multiply your running total by 16, change the next digit to decimal and add that to the running total. Continue with step 2 until all digits are exhausted.
Example: f1dhex. The first digit on the left is f, which corresponds to 15 in decimal, so the running total starts at 15.
There are more digits still, so we multiply the total by 16 and add the next digit.
15x16 + 1 = 241, our new running total.
We still have digits, so we multiply the running total by 16 and add the next digit d, which corresponds to 13.
241x16 + 13 = 3,856 + 13 = 3,869
That's the last digit, so we should be done. f1dhex = 3869dec.
The algorithm from decimal to hexadecimal.
One way to do this is to go from decimal to binary, then binary to decimal. Let's take 3869dec and change it to binary. If we did everything right in the steps above, we should get the binary number 1111 0001 1101, which translates into f1dhex.
dividing 3869 by two, looking at the ones digit for even or odd, then dividing the new number by two, again and again until the division produces a number less than 1
3869___ 9 is odd, so the first bit on the right is 1bin.
1934.5___ 4 is even, so the bits are now 01bin.
967.25___ 7 is odd, so the bits are now 101bin.
483.625___ 3 is odd, so the bits are now 1101bin.
241.8125___ 1 is odd, bits are 1 1101bin.
120.9...____ 0 is even, bits are 01 1101bin.
60.45...____ 0 is even, bits are 001 1101bin.
30.226...___ 0 is even, bits are 0001 1101bin.
15.113...____ 5 is odd, bits are 1 0001 1101bin.
7.5566...____ 7 is odd, bits are 11 0001 1101bin.
3.778..._____ 3 is odd, bits are 111 0001 1101bin.
1.889..._____ 1 is odd bits are 1111 0001 1101bin.
0.944... less than 1 so done. The final bit string is 1111 0001 1101bin.
That bitstring does correspond to the hexadecimal number we hoped we would get, f1dhex.
Here are some practice problems with solutions.
Thursday, February 10, 2011
Practice problems for prime factorization.
Here's the link to problems with answers. If you need more, let me know.
Tuesday, February 8, 2011
Practical logarithmic problems
There was a 7.6 earthquake in Mindanao in the Philippines and a 5.7 aftershock three days later. Rounded to the nearest multiple of 10, how much stronger was the bigger quake?
One singer is measured at 64 dB. Eight singers at the same level would have eight times more energy. To the nearest decibel, what is the decibel level of the eight singer chorus?
Answers in the comments.
One singer is measured at 64 dB. Eight singers at the same level would have eight times more energy. To the nearest decibel, what is the decibel level of the eight singer chorus?
Answers in the comments.
Saturday, February 5, 2011
Friday, February 4, 2011
Underflow and Overflow on your calculator
Really big numbers and numbers really close to zero are written on your calculator in scientific notation, a x 10^b, where b is an integer and a, known as the significand, is a number more than or equal to 1 but less than 10, which is to say exactly one digit to the left of the decimal place. Some calculators will write this in the form a E b. For example, it's about 96,000,000 miles to the sun. A mile is 5,280 feet and a foot is 12 inches. This means the number of inches to the sun has more than ten digits, so the TI-83 will write the answer as 6.08256E12, which is their way of writing 6.08256 x 10^12, which we could say in words as about six trillion.
With the exception of the high end calculator the TI-89, most calculators have decided they won't display numbers where the exponent is greater than 99 or less than -99. Some numbers in probability are larger than 10^100 or smaller than 10^-100, so the need can arise to express these. We can do this by using our calculators to find two number that multiply to the number we want that the calculator can represent, then multiplying those numbers together by hand. It's not that difficult to multiply numbers in scientific notation. You just add the exponents together to get the new exponent and multiply the significands. Multiplying two number less than 10 can give you a product more than ten. If that happens, you divide the product by ten (move the decimal over to the left) and add 1 to the exponent.
Simple example: 2 x 10^90 x 7 x 10^80 would be 14 x 10^170, but this isn't scientific notation because 14 > 10. To change it to scientific, we change 14 to 1.4 x 10, which raises the exponent by 1, so in scientific notation the answer is 1.4 x 10^171.
Overflow example: 80! is more than 10^100, so we need to split it up into two factors.
Factor #1: 50! = 50 x 49 x 48...x 3 x 2 x 1 = 3.0414 x 10^64
Factor #2: 80 nPr 30 = 80 x 79 x 78... x 53 x 52 x 51 = 2.3532 x 10^54
Multiplying the powers of 10 together is just 10^(64+54) = 10^118.
3.0414 x 2.3532 = 7.15702..., so rounding to four places total, which is called four significant digits, the final answer would be 80! = 7.157 x 10^118.
Underflow example: 1/80! is less than 10^-100, so we need to split it up into two factors.
Factor #1: 1/50! = 1/(50 x 49 x 48...x 3 x 2 x 1) = 3.2879 x 10^-65
Factor #2: 1/(80 nPr 30) = 1/(80 x 79 x 78... x 53 x 52 x 51) = 4.2496 x 10^-55
Multiplying the powers of 10 together is just 10^(-66+-55) = 10^-120.
3.2879 x 4.2496 = 13.96338..., which is more than 10, so we change it to 1.396338 x 10^1, combine 10^1 with 10^-120 to get 10^-119, and the final answer is 1/80! = 1.396 x 10^-119.
Practice problems:
Overflow: 90!
Underflow: 1/90!
Answers in the comments.
With the exception of the high end calculator the TI-89, most calculators have decided they won't display numbers where the exponent is greater than 99 or less than -99. Some numbers in probability are larger than 10^100 or smaller than 10^-100, so the need can arise to express these. We can do this by using our calculators to find two number that multiply to the number we want that the calculator can represent, then multiplying those numbers together by hand. It's not that difficult to multiply numbers in scientific notation. You just add the exponents together to get the new exponent and multiply the significands. Multiplying two number less than 10 can give you a product more than ten. If that happens, you divide the product by ten (move the decimal over to the left) and add 1 to the exponent.
Simple example: 2 x 10^90 x 7 x 10^80 would be 14 x 10^170, but this isn't scientific notation because 14 > 10. To change it to scientific, we change 14 to 1.4 x 10, which raises the exponent by 1, so in scientific notation the answer is 1.4 x 10^171.
Overflow example: 80! is more than 10^100, so we need to split it up into two factors.
Factor #1: 50! = 50 x 49 x 48...x 3 x 2 x 1 = 3.0414 x 10^64
Factor #2: 80 nPr 30 = 80 x 79 x 78... x 53 x 52 x 51 = 2.3532 x 10^54
Multiplying the powers of 10 together is just 10^(64+54) = 10^118.
3.0414 x 2.3532 = 7.15702..., so rounding to four places total, which is called four significant digits, the final answer would be 80! = 7.157 x 10^118.
Underflow example: 1/80! is less than 10^-100, so we need to split it up into two factors.
Factor #1: 1/50! = 1/(50 x 49 x 48...x 3 x 2 x 1) = 3.2879 x 10^-65
Factor #2: 1/(80 nPr 30) = 1/(80 x 79 x 78... x 53 x 52 x 51) = 4.2496 x 10^-55
Multiplying the powers of 10 together is just 10^(-66+-55) = 10^-120.
3.2879 x 4.2496 = 13.96338..., which is more than 10, so we change it to 1.396338 x 10^1, combine 10^1 with 10^-120 to get 10^-119, and the final answer is 1/80! = 1.396 x 10^-119.
Practice problems:
Overflow: 90!
Underflow: 1/90!
Answers in the comments.
Thursday, February 3, 2011
Clarification on homework 2
On the homework, I used a symbol I didn't explain in class. On the third problem in the second section it looks like "60 raised to the power of 40", but the 40 is underlined. This means "60 fall 40", the falling factorial that shows up on most calculators as 60nPr40. The fourth problem in the section section is "60 raised to the power of 40". On many calculators, the button that means "raise to a power" looks like ^, which is pronounced caret.
I will put up some examples of underflow and overflow on Friday.
Subscribe to:
Posts (Atom)


