Give meaning to a probably meaningless existence.
Showing posts with label Mathematics. Show all posts
Showing posts with label Mathematics. Show all posts
Sunday, May 15, 2011
Parallels have inconsistent systems.
So we're basically parallel to everyone whom we will never meet?
Friday, April 29, 2011
Harmonic mean
*Disclaimer*
It may look a bit complex at first, but really, it's not.
Say we want to find the arithmetic mean of the the following numbers 5, 2, 4, 10. Let's start by taking care of the denominator of the formula first:
As you now know, that's a summation over the reciprocals of our numbers:
We're not ready yet though because that's only half of the formula. So, now we ended up with this complex fraction:
Now we simplify that complex fraction by multiplying the numerator by the reciprocal of the denominator:
Therefore we can say that 'the harmonic mean is the reciprocal of the arithmetic mean of the reciprocals' [Wikipedia].
Mathematics
This post is going to be about another form of average, called the harmonic mean and this is found using the following formula:It may look a bit complex at first, but really, it's not.
Say we want to find the arithmetic mean of the the following numbers 5, 2, 4, 10. Let's start by taking care of the denominator of the formula first:
As you now know, that's a summation over the reciprocals of our numbers:
We're not ready yet though because that's only half of the formula. So, now we ended up with this complex fraction:
Now we simplify that complex fraction by multiplying the numerator by the reciprocal of the denominator:
Therefore we can say that 'the harmonic mean is the reciprocal of the arithmetic mean of the reciprocals' [Wikipedia].
Programming
Now let's write our harmonic mean function in JavaScript:var harmonic = function (numbers) {
var length = numbers.length, denominator = 0, i = 0;
for (; i < length; ++i) {
denominator += 1 / +numbers[i];
}
return length / denominator;
};
harmonic([5,2,4,10]); // 3.8095238095238093
Arithmetic mean
*Disclaimer*
The arithmetic mean is most commonly referred to as just the average, although it's just one of several ways of calculating an average...and it's probably the one you're most familiar with.
Let's say we have these five numbers 1, 4, 7, 5, 8 and we want to find their arithmetic mean:
Therefore if we use x for our arithmetic mean, we can represent that as:
Mathematics
Since now you're already familiar with the summation notation, I'm going to start this post with this:The arithmetic mean is most commonly referred to as just the average, although it's just one of several ways of calculating an average...and it's probably the one you're most familiar with.
Let's say we have these five numbers 1, 4, 7, 5, 8 and we want to find their arithmetic mean:
Therefore if we use x for our arithmetic mean, we can represent that as:
Programming
Writing a function for calculating the arithmetic mean in JavaScript shouldn't be too difficult:var average = function (numbers) {
var sum = 0, i = 0, j = numbers.length;
for (; i < j; ++i) {
sum += +numbers[i];
}
return sum / j;
};
average([1,4,7,5,8]); // 5
The Σ notation.
*Disclaimer*
In this one, I will talk a bit about the Capital Sigma notation:
You will probably see it being used as follows:
This is actually part of the ~third diagram you will see on its Wikipedia page.
What does it all mean? Here, n represents the upper bound of the summation, m is the lower bound of the summation and i is the index of the summation.
Let's now look at the complete Wikipedia diagram via some inline linking:
As you may have now guessed, the Σ is used to represent a summation (i.e. using addition) over a list of numbers (and other addable entities). The xi represents how the sequence should be formed, replacing the i with the current value of i in the present iteration.
Now it should be more clear as to what the upper/lower bounds mean. The upper bound n refers to when the sum should 'end' and m is used to represent where to 'start' the sum.
My terminology in the previous paragraph may be slightly incorrect, especially the part about start/end, so be weary.
If you've managed to get that, here's a more concrete example:
And another one:
You could have probably calculated the above in your head, but what if I gave you the following:
Can you find the sum of the numbers in the range 1 ≤ i ≤ 50 mentally? Fortunately, you don't have to because there is a formula you can use for that particular sequence of numbers:
So going back to the previous problem with the 50, we can now plug in the upper bound into the formula:
Therefore:
Let's get a bit more concrete. Say you have some coins running around and you form a triangle with them:
Without individually counting them, can you tell me the total number of coins that are currently forming the triangle? Or better yet, what if you added the fifth row...how many coins would there be then?
Simple, just use the formula. Let's find out how many coins would there be if we added the fifth row.
First we'll start by representing our problem in math notation which in this case is easy because the pattern is very trivial:
And now, the formula:
So if we add a fifth row, we would get a total of 15 coins:
How about this one?
Well thankfully, mathematicians also have a formula for that (and many others):
So, applying that to our latest problem, we get:
Therefore:
Now, some programming shall we? I will use JavaScript because I like it (talk about one hammer...well it's not the only one) although I have to admit that a solution written in a purely functional programming language like Haskell would have been much more elegant.
Now let's start applying this function to work out some summations, starting with the first one I talked about:
We can write something like this to workout the problems given with that pattern:
What about the next one?
Something like this could work:
But do we have to keep creating a new function for every pattern we need? Surely not!
We can write a function that does something like this:
If you're worried about the stack, you can use a for loop:
But you can also use recursion to create a more elegant solution:
As you can see, I kept it as concise as possible; I even didn't bother to add curly brackets for the if-construct. If you're hardcore on making slightly-less readable code, you can even remove that if-construct and check for the condition using the ternary operator.
I also added the possibility to start from a specified number given by the lower variable. The generic function comes with a price though, as everything does. The problem now is that we've transformed an algorithm of O(1) to one with O(n).
I will not go much into algorithm complexity in this post but basically with our previous 'simpler' functions, the execution time of the function depended mainly on how complex our formula was since all it's operation run in constant time, whereas with the new generic function, we will take a big performance hit because execution time depends mainly on the range of numbers we specify i.e. the bigger the range, the more time the function will take to return a result.
Another way to say this would be that the execution time scales proportionally to the number of elements in the specified range m...n.
Let us now apply the last function to create the previous two patterns:
Now we can also write something like this:
If we wanted to write it using the O(1) algorithm, we would have had to turn the formula into JavaScript instead of using the i5. But, we can even up the ante a bit and make all of this even cooler and that's where partial function application will come in to do the job. This is the partial function we will use:
I have already talked about partial function application for JavaScript in the other one so I won't go into any details here, but I will show you how we can use it to produce functions that have a smaller arity (number of arguments):
In our current case, we reduced the arity of sum to produce functions that only require the lower and upper bounds since the pattern function will already be stored in the closure produced by the partial function. Usage is then simple:
Mathematics
In this one, I will talk a bit about the Capital Sigma notation:
You will probably see it being used as follows:
This is actually part of the ~third diagram you will see on its Wikipedia page.
What does it all mean? Here, n represents the upper bound of the summation, m is the lower bound of the summation and i is the index of the summation.
Let's now look at the complete Wikipedia diagram via some inline linking:
As you may have now guessed, the Σ is used to represent a summation (i.e. using addition) over a list of numbers (and other addable entities). The xi represents how the sequence should be formed, replacing the i with the current value of i in the present iteration.
Now it should be more clear as to what the upper/lower bounds mean. The upper bound n refers to when the sum should 'end' and m is used to represent where to 'start' the sum.
My terminology in the previous paragraph may be slightly incorrect, especially the part about start/end, so be weary.
If you've managed to get that, here's a more concrete example:
And another one:
You could have probably calculated the above in your head, but what if I gave you the following:
Can you find the sum of the numbers in the range 1 ≤ i ≤ 50 mentally? Fortunately, you don't have to because there is a formula you can use for that particular sequence of numbers:
So going back to the previous problem with the 50, we can now plug in the upper bound into the formula:
Therefore:
Let's get a bit more concrete. Say you have some coins running around and you form a triangle with them:
Without individually counting them, can you tell me the total number of coins that are currently forming the triangle? Or better yet, what if you added the fifth row...how many coins would there be then?
Simple, just use the formula. Let's find out how many coins would there be if we added the fifth row.
First we'll start by representing our problem in math notation which in this case is easy because the pattern is very trivial:
And now, the formula:
So if we add a fifth row, we would get a total of 15 coins:
How about this one?
Well thankfully, mathematicians also have a formula for that (and many others):
So, applying that to our latest problem, we get:
Therefore:
Programming
Now, some programming shall we? I will use JavaScript because I like it (talk about one hammer...well it's not the only one) although I have to admit that a solution written in a purely functional programming language like Haskell would have been much more elegant.
Now let's start applying this function to work out some summations, starting with the first one I talked about:
We can write something like this to workout the problems given with that pattern:
var simpleSum = function(upper) {
return (upper * (upper + 1)) / 2;
};
What about the next one?
Something like this could work:
var squaredSum = function(upper) {
var numerator = upper * (upper + 1) * (2 * upper + 1),
denominator = 6;
return numerator / denominator;
};
But do we have to keep creating a new function for every pattern we need? Surely not!
We can write a function that does something like this:
If you're worried about the stack, you can use a for loop:
var sum = function (pattern, lower, upper) {
var s = 0;
for (; lower <= upper; ++lower) {
s += pattern(lower, upper);
}
return s;
};
But you can also use recursion to create a more elegant solution:
var sum = function(pattern, lower, upper) {
if (lower > upper)
return 0;
return pattern(lower, upper) + sum(lower + 1, upper, pattern);
};
As you can see, I kept it as concise as possible; I even didn't bother to add curly brackets for the if-construct. If you're hardcore on making slightly-less readable code, you can even remove that if-construct and check for the condition using the ternary operator.
I also added the possibility to start from a specified number given by the lower variable. The generic function comes with a price though, as everything does. The problem now is that we've transformed an algorithm of O(1) to one with O(n).
I will not go much into algorithm complexity in this post but basically with our previous 'simpler' functions, the execution time of the function depended mainly on how complex our formula was since all it's operation run in constant time, whereas with the new generic function, we will take a big performance hit because execution time depends mainly on the range of numbers we specify i.e. the bigger the range, the more time the function will take to return a result.
Another way to say this would be that the execution time scales proportionally to the number of elements in the specified range m...n.
Let us now apply the last function to create the previous two patterns:
var m = 1, n = 5;
sum(function (i) {
return i;
}, m, n);
sum(function (i) {
return i * i
}, m, n);
Now we can also write something like this:
sum(function(i) {
return Math.pow(i, 5);
}, m, n);
If we wanted to write it using the O(1) algorithm, we would have had to turn the formula into JavaScript instead of using the i5. But, we can even up the ante a bit and make all of this even cooler and that's where partial function application will come in to do the job. This is the partial function we will use:
var partial = function(func) {
var args = Array.prototype.slice.call(arguments).splice(1);
return function() {
var allArguments = args.concat(Array.prototype.slice.call(arguments));
return func.apply(this, allArguments);
};
};
I have already talked about partial function application for JavaScript in the other one so I won't go into any details here, but I will show you how we can use it to produce functions that have a smaller arity (number of arguments):
var simpleSum = partial(sum, function (i) { return i; }),
squaredSum = partial(sum, function (i) { return i*i;});
In our current case, we reduced the arity of sum to produce functions that only require the lower and upper bounds since the pattern function will already be stored in the closure produced by the partial function. Usage is then simple:
simpleSum(1,5); // 15 squaredSum(1,5); // 55
Wednesday, April 27, 2011
Do you panic when you see some math?
I do, or at least I used to; I still do, but I'm currently working on fixing that problem. My issue was mainly opening a Wikipedia page on some arbitrary algorithm, seeing some math and closing the page. That's failure for you. So now I'm trying to fix my issues with this.
If you're mathematically inclined, I suggest you avoid reading these posts because they will probably insult your intelligence.
I basically plan to write a little bit about some stuff which I'm currently learning about on my own. That's also a warning for you: I'm learning this stuff as I go (and by myself).
This means that there could be mistakes in what I write, and there probably will be...so tread lightly on it. And if you actually read this stuff, and find mistakes, I truly appreciate if you contact me via comments or whatever about them because I'm still learning about these concepts.
The main reason I will be writing these posts (and having this blog in the first place) is for my own amusement, so I can laugh back in the future. Seriously though, writing about what I'm learning helps me more in understanding because of the research and thinking I do while working on the actual writing. Sort of like my semi-personal notes.
So yea, I think my first post will be about the sigma notation.
Also, I tend to use both math and programming terms for most of the stuff, including (usually incorrectly) mixing both math and programming notations together; yea, that's one thing I'm working on learning more about because usually I know how to explain something using programming terminology, but not using math notation. So for the mathematically abled, I apologize; once again, I appreciate the corrections you can make.
Oh and another thing which I should have mentioned in an earlier post. To render the math in this blog, I'm using CodeCogs' online equation editor.
If you're mathematically inclined, I suggest you avoid reading these posts because they will probably insult your intelligence.
I basically plan to write a little bit about some stuff which I'm currently learning about on my own. That's also a warning for you: I'm learning this stuff as I go (and by myself).
This means that there could be mistakes in what I write, and there probably will be...so tread lightly on it. And if you actually read this stuff, and find mistakes, I truly appreciate if you contact me via comments or whatever about them because I'm still learning about these concepts.
The main reason I will be writing these posts (and having this blog in the first place) is for my own amusement, so I can laugh back in the future. Seriously though, writing about what I'm learning helps me more in understanding because of the research and thinking I do while working on the actual writing. Sort of like my semi-personal notes.
So yea, I think my first post will be about the sigma notation.
Also, I tend to use both math and programming terms for most of the stuff, including (usually incorrectly) mixing both math and programming notations together; yea, that's one thing I'm working on learning more about because usually I know how to explain something using programming terminology, but not using math notation. So for the mathematically abled, I apologize; once again, I appreciate the corrections you can make.
Oh and another thing which I should have mentioned in an earlier post. To render the math in this blog, I'm using CodeCogs' online equation editor.
Sunday, April 24, 2011
Trying to beat procrastination? Use rationale and simple math.
Trying to beat procrastination? Don't read this article then. Seriously, stop reading. If you're really hardcore on Not procrastinating, just stop here and close this page.
If you're just here to kill some minutes, keep on reading...
You know what helps me (attempt to) beat procrastination? Using simple mathematics to justify my (probably incorrect) conclusions and this will be a post about combining patterns to project something meaningful and hopefully, useful.
Here I will assume that you are procrastinating from a project, whatever that may be; but I will refer to the activity you're procrastinating from as the project.
So, since you're already procrastinating (by reading this), let's waste a couple of more minutes, shall we?
Say you have two patterns that you can apply on a sequence of numbers (on a number line) and the goal is to advance, i.e. increasing the value of x-axis (meaning you doing more stuff) to reach a (hopefully) predefined goal, x = 9. Notice how a project's completeness convergence representation is a variable, not a constant...because we all know that projects never have a fixed dead-line.
Here, let i be the current state (current number on the line) and the following two equations the patterns applied to the sequences for trying to advance to the goal (you finishing the project), by advancing the value of the x-axis (and the only axis there is since we're working in a single dimension). Also, our step will be a day; so it takes a day to reapply the pattern to move to the next number on the line.
Now say the patterns are these: i = i + 0 and i = i + 1. In these patterns, i + 0 represents you !working i.e. procrastinating. On the other hand, i + 1 represents you advancing (i.e. adding value) in your project.
Seq. k: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Seq. l: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Now let's apply both patterns to our sequences, starting with i = 0 (you haven't started on the project yet):
For the mathematically inclined, here's how I applied the patterns on the sequences:


Are you seeing the pattern and where I'm going with this?
Applying the summations, we get k = x and l = 0:
I did not choose the 1 constant by random. For this example, the 1 constant referred to the work-load you dedicate on a project at a point in time. Also, it's a constant not a variable so I'm assuming that if you do x amount of work today, you will do x amount of work tomorrow. Reason is because you need to get into the routine to get things moving.
Back to the pattern. Let's say that you complete the project when x reaches 9, so x = 9. If your point of convergence for the project is at infinity, you probably need to rewrite your specs so I'm assuming it's not.
As you have noticed, when you do nothing each day, your project will be ready after an infinite number of steps whereas if you add 1 to get the next number in the sequence, the range is much, much, much smaller than the infinity range.
So, if you add 1 every day, at the end of day 1, if x represents our goal and t the number of work activities remaining, t will be t = x - i, and you know that in this case, i is incrementing at each step meaning that t will decrease in each step until it converges with x, t = x and that's when you should open the champagne and celebrate because your project is 'complete'.
Keep in mind that if you choose the l sequence, there will never be any champagne for you. Infinity > x - i (to put it mildly).
My advice is to find an appropriate work-load constant for the task at hand so that you don't do too little (and not get in routine) or too much (get bored from the project again). I used 1 as the constant because I'm assuming you're lazy so you want to do the minimal number of work each day.
I hope this wasn't all meaningless dribble for you...and don't forget, I might be wrong.
Am I Captain Obvious? Sure, I didn't dispute that. Did you just waste 5 mins of your precious time? hopefully not =)
And now I end on an ironic note: I wrote this post because I'm procrastinating from other stuff.
Now, my math notation may not be perfect and it probably isn't even acceptable, but I hope you got the point. Now, close your browser and start working bitch.
Oh and yea, if you notice any mistakes in my logic and math, please inform me (learning is the key).
If you're just here to kill some minutes, keep on reading...
You know what helps me (attempt to) beat procrastination? Using simple mathematics to justify my (probably incorrect) conclusions and this will be a post about combining patterns to project something meaningful and hopefully, useful.
Here I will assume that you are procrastinating from a project, whatever that may be; but I will refer to the activity you're procrastinating from as the project.
So, since you're already procrastinating (by reading this), let's waste a couple of more minutes, shall we?
Say you have two patterns that you can apply on a sequence of numbers (on a number line) and the goal is to advance, i.e. increasing the value of x-axis (meaning you doing more stuff) to reach a (hopefully) predefined goal, x = 9. Notice how a project's completeness convergence representation is a variable, not a constant...because we all know that projects never have a fixed dead-line.
Here, let i be the current state (current number on the line) and the following two equations the patterns applied to the sequences for trying to advance to the goal (you finishing the project), by advancing the value of the x-axis (and the only axis there is since we're working in a single dimension). Also, our step will be a day; so it takes a day to reapply the pattern to move to the next number on the line.
Now say the patterns are these: i = i + 0 and i = i + 1. In these patterns, i + 0 represents you !working i.e. procrastinating. On the other hand, i + 1 represents you advancing (i.e. adding value) in your project.
Seq. k: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Seq. l: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Now let's apply both patterns to our sequences, starting with i = 0 (you haven't started on the project yet):
Step 1: l => i = i i = 0 k => i = i + 1 i = 1 So i of l is still 0 but i of k is now 1. (yay, progress) Step 2: l=> i = i i = 0 k=> i = i + 1 i = 2 Now i of k is 2, so there's even more progress. We're finally moving forward (...to the right, to be exact). Not surprisingly, i of l is still a whopping 0.etc... stopping when i = x.
For the mathematically inclined, here's how I applied the patterns on the sequences:
Are you seeing the pattern and where I'm going with this?
Applying the summations, we get k = x and l = 0:
k = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 k = 9 ∴ k = x. l = 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 l = 0.
I did not choose the 1 constant by random. For this example, the 1 constant referred to the work-load you dedicate on a project at a point in time. Also, it's a constant not a variable so I'm assuming that if you do x amount of work today, you will do x amount of work tomorrow. Reason is because you need to get into the routine to get things moving.
Back to the pattern. Let's say that you complete the project when x reaches 9, so x = 9. If your point of convergence for the project is at infinity, you probably need to rewrite your specs so I'm assuming it's not.
As you have noticed, when you do nothing each day, your project will be ready after an infinite number of steps whereas if you add 1 to get the next number in the sequence, the range is much, much, much smaller than the infinity range.
So, if you add 1 every day, at the end of day 1, if x represents our goal and t the number of work activities remaining, t will be t = x - i, and you know that in this case, i is incrementing at each step meaning that t will decrease in each step until it converges with x, t = x and that's when you should open the champagne and celebrate because your project is 'complete'.
Keep in mind that if you choose the l sequence, there will never be any champagne for you. Infinity > x - i (to put it mildly).
My advice is to find an appropriate work-load constant for the task at hand so that you don't do too little (and not get in routine) or too much (get bored from the project again). I used 1 as the constant because I'm assuming you're lazy so you want to do the minimal number of work each day.
I hope this wasn't all meaningless dribble for you...and don't forget, I might be wrong.
Am I Captain Obvious? Sure, I didn't dispute that. Did you just waste 5 mins of your precious time? hopefully not =)
And now I end on an ironic note: I wrote this post because I'm procrastinating from other stuff.
Now, my math notation may not be perfect and it probably isn't even acceptable, but I hope you got the point. Now, close your browser and start working bitch.
Oh and yea, if you notice any mistakes in my logic and math, please inform me (learning is the key).
Saturday, April 23, 2011
What doctor?
A little mathematics a day keeps my ignorance away.
I've suddenly had a revelation!
For the first time in my life, while solving exponential equations, I've realized a couple of things:
(1) I'm getting the correct answers
(2) I'm understanding what I'm doing and
(3) I'm having fun because I'm seeing these exercises as puzzles that need solving xD THAT, never happened...ever.
(1) I'm getting the correct answers
(2) I'm understanding what I'm doing and
(3) I'm having fun because I'm seeing these exercises as puzzles that need solving xD THAT, never happened...ever.
The patterns are starting to fascinate me!
I'm finally understanding why people say Mathematics is so beautiful.
for granted (or for someone else)
It's very interesting to see how much stuff we take for granted nowadays. Things such as the Cartesian coordinate system and negative numbers...
Mathematics, Music and Art form the one, true trinity.
-[Conversation Legend]-
=> But wouldn't Music be a subset of Art?
> Well, some argue that Math can also be a subset of Art...hence, the the trinity which are one (yea, ripped that from bible).
=> I'd say they're all possible encodings of the same object.
You could represent a computer program ("Math") as an artistic drawing (there's an esotheric programming language which does just that), and you can represent all forms of arts as a large number composed of 1s and 0s...
> Hence the trinity analogy, as the three in one.
=> But this raises the question "Why is this special?"
> Because not everyone can appreciate it...and I'm just starting to. It's all about the patterns I'm finding.
=> What I mean is - Accepting your axiom, what other conclusions, actions or whatever does this fact enable me to perform?
> To change your perception; 'improve' it maybe. To see things in a different form, and to try and see or find the patterns for yourself (if you're into this sort of thing i.e.).
For me, what's striking me as beautiful are the similar patterns that there are in music, art and math. (and of course much of the stuff that comes from math in CS...such as, recursion (which occurs in music and art as well)).
|> What about chess and poker? :)
=> Chess can be represented by a very large tree of all possible moves. Playing a game is simply a traversal of such a tree until it reaches an end state (the leaves).
Poker is pretty much an exercise in probability. All Maths 'ere.
[> We could go on like this forever, everything is Math. :)
]> au contraire, Math is a logically rigorous way of expressing reality
^> Hofstadter's "Goedel, Escher and Bach: An Eternal Golden Braid" should be required reading for everyone.
=> But wouldn't Music be a subset of Art?
> Well, some argue that Math can also be a subset of Art...hence, the the trinity which are one (yea, ripped that from bible).
=> I'd say they're all possible encodings of the same object.
You could represent a computer program ("Math") as an artistic drawing (there's an esotheric programming language which does just that), and you can represent all forms of arts as a large number composed of 1s and 0s...
> Hence the trinity analogy, as the three in one.
=> But this raises the question "Why is this special?"
> Because not everyone can appreciate it...and I'm just starting to. It's all about the patterns I'm finding.
=> What I mean is - Accepting your axiom, what other conclusions, actions or whatever does this fact enable me to perform?
> To change your perception; 'improve' it maybe. To see things in a different form, and to try and see or find the patterns for yourself (if you're into this sort of thing i.e.).
For me, what's striking me as beautiful are the similar patterns that there are in music, art and math. (and of course much of the stuff that comes from math in CS...such as, recursion (which occurs in music and art as well)).
|> What about chess and poker? :)
=> Chess can be represented by a very large tree of all possible moves. Playing a game is simply a traversal of such a tree until it reaches an end state (the leaves).
Poker is pretty much an exercise in probability. All Maths 'ere.
[> We could go on like this forever, everything is Math. :)
]> au contraire, Math is a logically rigorous way of expressing reality
^> Hofstadter's "Goedel, Escher and Bach: An Eternal Golden Braid" should be required reading for everyone.
9x = 10(x - 1) + (10 - x)
Isn't that simply beautiful?
Though probably an easier one for mental math would be a more simplified version of it: 9x = 10x - x
Though probably an easier one for mental math would be a more simplified version of it: 9x = 10x - x
Mental Math: Multiplying by numbers that end in 9
The following equation mathematically explains the title:
The last part is basically saying that we will use this for numbers that end in 9. Why 9?
Here's an example that should make it apparent why it works best with digits that end in 9:
19 ⋅ 5, so we're multiplying by 19...a number that ends in 9.
Applying the above formula, yx = x(y+1)-x, we substitute as follows:
Now here is why this works best with numbers that end in 9. 19 + 1 = 20, and multiplying by 20 in your head or any other multiple of 10 is much easier than multiplying by 19 in your head.
19⋅5 = 100 - 5
19⋅5 = 95
So after multiplying by y+1, you then need to subtract the extra element (the +1) you added in the previous calculation, which in the above example, is 5 (basically you need to add -x * 1 to the first product)
Here's another example:
yx = x(y+1) - x, where y (modulo 10) ≡ 9
The last part is basically saying that we will use this for numbers that end in 9. Why 9?
Here's an example that should make it apparent why it works best with digits that end in 9:
19 ⋅ 5, so we're multiplying by 19...a number that ends in 9.
Applying the above formula, yx = x(y+1)-x, we substitute as follows:
y = 19 (since 19 (modulo 10) ≡ 9 is true) x = 5 19⋅5 = 5(19+1) - 5 19⋅5 = 5(20) - 5
Now here is why this works best with numbers that end in 9. 19 + 1 = 20, and multiplying by 20 in your head or any other multiple of 10 is much easier than multiplying by 19 in your head.
19⋅5 = 100 - 5
19⋅5 = 95
So after multiplying by y+1, you then need to subtract the extra element (the +1) you added in the previous calculation, which in the above example, is 5 (basically you need to add -x * 1 to the first product)
Here's another example:
29⋅7 = 7(29+1) - 7 29⋅7 = 7(30) - 7 29⋅7 = 210 - 7 29⋅7 = 203
a strange (learning) loop.
Not exactly Escher...but this is how I'm learning to understand Mathematics in all its glory:
You think I've got this all backwards? Well hell, take a look at the title of this blog.
- Find a problem which needs solving.
- Solve the problem Mechanically.
- Jump out of the system and ask 'why?'.
- Light a cigarette && Understand ('Aha!') and re-solve the problem Intelligently.
- Visualize the pattern between this problem and others.
- Get more coffee && goto: 1.
You think I've got this all backwards? Well hell, take a look at the title of this blog.
Subscribe to:
Posts (Atom)


