Math
Numbers and functions defining the universe.

0 244

The Source

The pigeonhole principle simply states that if there are n items, put into m different spots, or pigeonholes; and n>m, then there is at least one pigeonhole with more than one item.  This seems logical, yet it can lead to very counterintuitive conclusions.  The birthday paradox is one of these.

The Birthday Paradox

The birthday paradox is an old problem commonly used to show how statistics can come up with surprising, and counterintuitive results.  The paradox asks the question: "How many people are needed to have a 50% chance that a pair of them share a birthday.  At first the obvious solution seems to be a large number, perhaps half of 365.  Statistics, however, tells us the answer is 23 people.  What just happened?

The Math

Finding the number of ways to assign birthdays to 23 people results in numbers so large they are near impossible to work with.  The number of ways to assign the birthdays is 36523, or something like 74 followed by 75 zeroes.  The common way to actually solve this, then, is to work backwards: what's the probability of no one sharing a birthday.  This makes the birthday paradox actually workable.

We could call the probability of two people sharing a birthday P(B), and the opposite probability 1–P(B).  With only 2 people, the probability of them sharing a birthday easy.  There are 365 pairs that work, where they share a birthday.  There are 3652 ways to assign two people birthdays.  So the opposite probability is 364/365, and the probability is 1/365.

For three people, there are 363 possible birthdays that are different than the other two.  So the probability of different birthdays is 1*(1-1/365)*(1-2/365), or 364/365 * 363/365.

So the general rule for 1-P(n), or f(n) is $$ frac{365-(n-1)}{365}cdot f(n-1) $$.

This can be converted to $$ f(n) = frac{365!}{(365-n))!365^n} $$

Work that out for 30 people, and you get .29.  A .29 chance of no two people sharing the same birthday, so 71% chance of a shared birthday!

The problem is our intuitions think about the probability of someone having the same birthday of a certain person.  The birthday paradox solves for any two people.

In fact, by 50 people, the probability is greater than 97%!

 

0 285

TI BASIC tips:

While programming on a TI 83 or 84 with TI BASIC, I have collected a few tips.calculator used for TI BASIC programming

  • Delete a program: 2nd→Mem→2→7→find program and press DEL.
  • Replacing “Done”: Simply write a value on a new line.  TI BASIC outputs this instead of “Done”, and it can even be manipulated by Ans.
  • Comments:  To add comments, simply write a string, surrounded with quotes, on a new line.  TI BASIC takes a value like this, or any variable, and “returns” it.  You can have as many of these as you want, and only the last value (put a 0 at the end) will be outputted.
  • Multiple commands on one line:  Sometimes, you may want to put multiple commands on one line, for space or formatting reasons.  To do this, write the first command, and then put a colon, “:”, and write the second command.  A good example looks like this: “:If condition:Then”.
  • Instructions in Lowercase: Outputted text with upper- and lowercase looks much more professional.  To use lowercase, simply install an Asm utility like mine.
  • “Functions” program: If a program uses several bits of code repeatedly, you may benefit from a “Functions” program.  Although functions are not supported by TI BASIC, there is a workaround.  In you functions file, put an If…Then statement checking one variable.  For each value, have the repeated code.  Then, pass the value to whatever code you need, and run the program from you main application.
  • Rename/Copy a program: Create new program with desired name.  In program, Recall whatever program you’re copying or renaming.  If renaming, delete old program afterwards.

Submit your own tips:

Please share any tips you have come across in the comments.  What do you find helpful?

0 359

 A Memory

mathway screenshotI came across this while looking for a good CAS calculator app.  I had tried several options, such as PocketCAS, but nothing had really worked well.  I remembered the old site, MyAlgebra, which could solve CAS style equations.  So, partially for good times’ sake, I went back.  I found that it was now called Mathway, and was much improved.  This is what the new solver looks like:

A Connection

The icon, though, looked suspiciously like one for an app.  So, on a whim, I went to the app store and typed in “Mathway”.  I then found the Mathway app.

 

The Mathway App

The start screen provides a quick way to access all the solvers:

The app will solve a variety of types of problems.  The categories are Basic Math, Pre-Algebra, Trigonometry,  Precalculus, Calculus, and Statistics, each with their own specialized keyboard.  The categories reveal a student-based way of solving, by subject.

When you type something in, you will get choices on what to do.  For instance, an algebra equation may allow solving, simplifying, factoring, or something else.  Under the answer, there is a “view steps” button that will show work if you have View Steps purchased.

The app will solve virtually any type of problem.  It will even graph if given an equation that can be graphed.  Other tools include Examples, Glossary, and a Help choice to explain the app’s functions.

The app is free, and though it includes adds, you can quickly remove them by signing up for a free Mathway account, requiring only an email and password.  The one way to potentially spend money is if you purchase a premium account to show steps.

All in all, it is the best CAS calculator I have seen yet.  It provides an immense number of accepted problem types, and solves relatively quickly, even without internet connection.  At times the responding is a smidgen slow, but not significantly.  The extra tools really increase the appeal, especially for students.  Best of all, it’s completely free.

0 334

The additive inverse, or opposite of a number is what adds with it to zero.  The multiplicative inverse, or reciprocal,  of a number is what multiplies with it to one.   The inverse of a matrix is the matrix that when multiplied after the original gives the identity matrix.  This matrix, composed of ones and zeros, looks like this for a two-by-two matrix:

begin{bmatrix} 1&0\ 0&1 end{bmatrix}

Inverse matrices are helpful in situations such as solving matrix equations and/or linear systems with matrices.

To find the inverse of a 2×2 matrix use the following steps.

begin{bmatrix} a&b\ c&d end{bmatrix}

First, switch the first diagonal:

begin{bmatrix} d&b\ c&a end{bmatrix}

 

Then negate the other diagonal:

begin{bmatrix} d&-b\ -c&a end{bmatrix}

Finally, divide by the determinent.

begin{bmatrix} frac{d}{(ad-bc)}& frac{-b}{(ad-bc)} \ frac{-c}{(ad-bc)}& frac{a}{(ad-bc)} end{bmatrix}
That gives the inverse of a 2×2 matrix.

To use this put the coefficients on the coefficient side of a linear system into a matrix.
ax+by=c
dx+ey=f

begin{bmatrix} a&b\ d&e end{bmatrix}
Put the variables in a matrix:
begin{bmatrix} x\ y end{bmatrix}
Finally, put the answers into a matrix:
begin{bmatrix} c\ f end{bmatrix}

Set this up like this:

[coefficients]*[variables]=[answers]

Multiply both sides by the inverse of the coefficient matrix.  This leaves the variables alone.  The product of [coefficients]¯¹*[answers] gives a matrix the same size as the variables, which is the answer.

 

The advantage to this is that it can be used for any number of variables in a system.  For a program that uses this rule, click here.

This solver suite contains programs to solve linear and planar(3 variable) systems, and quadratic equations.  Format would be:

ax+by=c,  dx+ey=f

ax+by+cz=d,  ex+fy+gz=h

ax²+bx+c=0

[wpdm_file id=5 title=”true” desc=”true” ]

[wpdm_file id=4 title=”true” desc=”true” ]

[wpdm_file id=7 title=”true” desc=”true” ]

[wpdm_file id=6 title=”true” desc=”true” ]

The code is in the included readmes

0 251

Graphing in 3D has many similarities too graphing in 2D. Equations use x, y, and z.

To graph a plane in the form:
x + y + z = n

You can find the x|y|z intercepts. For example, the intercepts for
3x + 2y + 4z = 12
can be found the same way as finding intercepts for a x+y equation.
x-intercept = 12÷3 = 4
y-intercept = 12÷2 = 6
z-intercept = 12÷4 = 3

Graph these three points, then connect them. Shade the triangle lightly in, and you have your plane.

20130926-191614.jpg

When you only have two variables, the graph is slightly different. For example, 2x + 3y = 6. Find and plot the x and y intercepts, 3 and 2. Connect them with a line. Extend those two points with lines parallel to the z axis, the missing variable. Also draw a parallel to the line you made. The lines extend to make your plane. Notice that it runs parallel to the missing variable.

20130926-192114.jpg

20130926-192121.jpg

When you only have one variable, the graph is different again. First, find the intercept, for example, x=5. Then, draw lines through that point and parallel to the y and z axis. Shade that for the plane.

20130926-201252.jpg

20130926-201302.jpg

These only include graphing planes. Many other 3D shapes can be created:

0 353

Basic Inequalities

Inequalities are solved similar to equations, with rules of inequality. For example, the solving of 3x+4<7 is as follows:

3x + 4 < 7

-4  -4

3x       < 3

div 3          div 3

x         < 1

This can be graphed on a number line with a dot where the 1 is. For a greater-than or less-than inequality, an open dot(o) is used to represent the number. For a greater-than-or-equal-to or less-than-or-equal-to inequality, use a closed dot(&#149).

This would be graphed:

   < ——- circ

               1

Note the open dot over 1.

In an inequality, one major difference is that when dividing or multiplying by a negative number, the inequality sign is switched.

frac{ x }{text{-}3} leq -3
ast text{-}3       ast text{-}3
x     geq  9
Notice the flipped sign. When multiplying both sides by -3, the ≤ becomes ≥.
This would be graphed as:
                bullet ———->

               9


Compound Inequalities

Inequalities can be combined with and or or.

An and inequality has multiple inequality signs. For example:

1 < x < 10

Inequality operations can still be performed, but must affect all sections. When dividing or multiplying by a negative number, you must flip the signs.

And inequalities can also be graphed, by connecting two dots. For example, 1 < x < 10 is graphed:
        O——O

        1        10

Or inequality:
An or inequality is two inequalities joined by an or

x  3
Which is graphed as two separate inequalities.


Interval Notation

Interval notation is a way of describing inequalities as a set of numbers from a to b.

For example, x>3 would be described as:
(3 text{ , } infty)
Because it starts at 3 and goes to infinity.
A parenthesis is used for both sides because it approaches but never reaches 3 and infinity. If the inequality was x≤5 the interval notation would be:
(text{-}infty text{,} 5]
Now a square bracket is by 5 because x can reach 5.
For or inequalities, two interval notation groups are used, separated by or.

0 238

A Boolean is a value that is true or false. It is used in algebra, set theory, and computer programming. In fact, it is the building block of any computer. In computer programming, a Boolean is represented by a 0(false), or a 1(true).

Boolean Logic was developed by George Boole in the mid 1800’s. It has several gates, which are operations on values. The gates are:

  • NOT: Returns the opposite, so 1 returns 0 and vice versa.
  • AND: If both values are 1, the output is 1. Otherwise, the output is 0.
  • OR: If either or both values are 1, the output is 1. If both are zero, the output is 0.
  • NOR(OR + NOT): If either or both are 1, the output is 0. If both are zero, the output is 1
  • NAND(AND + NOT): If both values are 1, the output is 0. Otherwise, the output is 1.
  • XOR(Exclusive OR): If both values are the same, the output is 1. Otherwise, the value is 1.
  • XNOR(Exclusive NOR): If both values are the same, the output is the opposite of the values. Otherwise, the output is 0.

Boolean values are binary, or base-2. Therefore, the digit places are powers of two. So 1 is one 20 , but 10 is one 21, or 2.

This leads to interesting addition.
0+0=0
0+1=1
1+1=10
10+1=11
11+1=100

A Boolean memory value is called a bit. 8 bits make a byte. A byte therefore has 256 different possible values. Other storage values are:

Kilo (K)
2^10 = 1,024 bytes
Mega (M)
2^20 = 1,048,576
Giga (G)
2^30 = 1,073,741,824
Tera (T)
2^40 = 1,099,511,627,776
Peta (P)
2^50 = 1,125,899,906,842,624
Exa (E)
2^60 = 1,152,921,504,606,846,976
Zetta (Z)
2^70 = 1,180,591,620,717,411,303,424
Yotta (Y)
2^80 = 1,208,925,819,614,629,174,706,176

0 266

You have probably learned basic probability already—factorials, permutations, and combinations. If not, here’s a brief review:

•A factorial is the product of all the numbers less than and equal to n, so 6!=1•2•3•4•5•6

•A permutation is the number of different order-specific arrangements with r taken of n objects. nPr = n!(n-r)!

•A combination is the number of different arrangements with r taken of n objects. nCr = n!(n-r)!r!

First off–solving a factorial. If you know the number is a perfect factorial, the process is this: Divide the number by 2. Then divide by 3. Then 4, and so forth until the answer is one. When the answer is one, the number you divided by is the answer.

Example: n! = 120
120÷2 = 60
60÷3 = 20
20÷4 = 5
5÷5 = 1

Therefore, 5! = 120

Solving a Permutation/Combination
nP2 = 60
Take the factored form of the Functions:
n!(n-2)! = 12
Now n!÷(n-3)! can be factored. If you look at this:

5! = 1•2•3•4•5
——————————————–
(5-2)! = 3! = 1•2•3

Only 4•5, or 5•(5-1) will remain.

This gives a general rule:
n!÷(n-r)!
can be factored to
n•(n-1)•(n-2) to (n-r+1)

Back to our problem, n!(n-2)! = 12
We can factor this to n•(n-1) = 12
This can be solved to n2-n = 12, and put into
n2+ -1n + -12 = 0
this factors to
(n+3)(n-4) = 0
so n+3 = 0 or n-4 = 0
n = -3 or n = 4
but we can’t have a negative amount of items so n = 4

If this were a combination problem, the only difference is that we would multiply both sides by r! after factoring the function.

Of course, if you get to the n(n-1)… stage and have more than two factors, things get more complicated. You could use the cubic formula(for 3), but beyond that solving is insane. The easiest way to go is guess-and-check.

Normally, guess-and-check should be a last resort. However, here it is sometimes the only possible way to solve without unbelievably long formulas. Here’s how:

Take the number of factors, and call it f

Take the median of the numbers x in (n-x), each factor. This includes the first, where x = 0. Call that m

Now take the fth root of the number on the other side. Round it to the nearest whole number. That answer will be close to n-m. Call it a. Now comes the guess-and-check part.

Plug a into the equation as n and solve. If the answer is too low, lower a and try again. If it is too high, raise a and try again.

0 247

According to the story, Lewis Carroll asked his friend, a distinguished algebraist, this problem:

Suppose x=1 and y=1

This gives x—y = 0 and x2—y2 = 0

We can see that 2(x2—y2) = 0

And that 5(x—y) = 0

Therefore 2(x2—y2) = 5(x—y)

Dividing both sides by x—y yields:
2(x+y) = 5

But x=1 and y=1 so x+y = 2

So this gives 2(2) = 5

Why is this?

When we divided by x—y, we were dividing by 1—1, or 0. The x2—y2 factoring rule works only if x—y is not equal to 0.

In dividing by zero, we proved that infinity=infinity!