Finally, after waiting for a good question, it finally came: an optimization question. This one is from Yahoo Answers, and believe me, it's very good.
A 6 meter long wire is cut into 12 pieces. From these pieces, eight have the same length and the other four also have an equal length. These pieces form a frame of the box. How long should each piece for the box to have a maximum volume?
First, we should define ourselves some variables, otherwise we'd be lost.
Let x be the length of one of the 8 pieces. That means the total length of the 8 equal pieces is 8x. That means the other four pieces have a total length of 6 - 8x, and 3/2 - 2x meters each.
Since these wires form a box, the sides of the box have lengths of x, x, and 3/2 - 2x. That makes the volume of the box x * x * (3/2 - 2x), or 3x2/2 - 2x3.
To find the maximum value, we need to differentiate the volume function and set it to zero. Then we need to find the values that we get from solving the equation, plug them in the second derivative, see which one is a maximum and say "Problem Solved".
So:
V = 3x2/2 - 2x3
V' = 3x - 6x2
0 = 3x - 6x2
3x(1 - 2x) = 0
x = 0, 1/2
Now, let's find the second derivative and see when it's negative, so we get a maximum:
V'' = 3 - 12x
V''(0) = 3 - 0 = 3 > 0 - minimum
V''(1/2) = 3 - 12 * 1/2 = 3 - 6 = -3 < x =" 1/2" 1 =" 1/2">3 = 1/8 m3
Problem solved.
Nadav
nadavs
Thursday, June 5, 2008
Wire Optimization
Thursday, May 29, 2008
Cubic Sequences
Today I have something similar to the cubic function discovery I did exactly two weeks ago. It's somewhat more complex, and therefore more fun. Long? Yes. Fun? Oh, yeah!
Find the nth term: 2, 8, 20, 40, 70, 112, 168, ...
Once again, the genre of "short question, super long answer". Those are the most fun, so let the fun begin.
When you get a sequence and you need to find the nth term, go for differences between numbers. Those differences hide a big secret within them. If the differences are the same, it's a simple arithmetic series. If the differences are not the same, do the differences of the differences. If now they're equal, the relation between the numbers goes through a quadratic expression. If the differences are still not the same, take the differences again and again until they are equal. The number of times you take the differences is the degree of the expression that connects the numbers.
If you see that the differences have a certain ratio to them (for example, try to find the differences for 4, 10, 28, 82, 244, 730), don't bother going more than once or twice. You are dealing with an exponential relation here.
So, let's find the differences of the sequence we're given:
2, 8, 20, 40, 70, 112, 168
6 12 20 30 42 56
6 8 10 12 14
2 2 2 2
Jackpot. We reached equal differences after three times, so the numbers are connected via a cubic expression. To find that expression, we need to set up a system of 4 equations with 4 variables (if you don't know or don't remember, open the link at the top of the post).
Let's call the points that this "function" goes through (1, 2) (2, 8) (3, 20) (4, 40). Now let's set up the system:
a + b + c + d = 2
8a + 4b + 2c + d = 8
27a + 9b + 3c + d = 20
64a + 16b + 4c + d = 40
Subtract the equations from each other to eliminate d:
7a + 3b + c = 6
19a + 5b + c = 12
37a + 7b + c = 20
Subtract them again to eliminate c:
12a + 2b = 6
18a + 2b = 8
And once again:
6a = 2
a = 1/3
Let's start plugging:
12/3 + 2b = 6
4 + 2b = 6
2b = 2
b = 1
Again:
7/3 + 3 + c = 6
c = 2/3
Finally:
1/3 + 1 + 2/3 + d = 2
d = 0
Well, that makes it easier. The nth term is given by:
n3/3 + n2 + 2n/3
Go ahead, plug your number for n and see that it works. For all terms, even the ones which were not included in the calculation.
Enjoy your new knowledge,
Nadav
nadavs
Thursday, May 15, 2008
Cubic Funcion Discovery
Today I have another question from Yahoo Answers (super math tips people, send some questions too!). The question is simple, but its answer is very, very long.
There is a cubic function that passes through the following points: (-2, -24) (3, -4) (5, 18) (6, 56). Find out what the function is.
(The original question had a point different than (6,56), but it makes it shorter, so the fun is gone).
At first, it seems impossible. But then, you remember that a cubic function has the following form:
y = ax3 + bx2 + cx + d
We have x and y, so we can plug them in to find a, b, c, and d! All we have to do now is set up a system of four equations and solve them. All of them (here comes the long part):
I -8a + 4b - 2c + d = -24
II 27a + 9b + 3c + d = -4
III 125a + 25b + 5c + d = 18
IV 216a + 36b + 6c + d = 56
Now we need to get three equations out of those four. We do that be subtracting the equations from each other and getting rid of d. If done smart, it can even simplify the process in the future (if we can get small enough coefficient). There are six possible outcomes, and the smartest thing to do is to choose the best ones:
A. 91a + 11b + c = 38 (IV - III)
B. 98a + 16b + 2c = 22 (III - II)
C. 35a + 5b + 5c = 20 (II - I)
Now we need to eliminate another variable and create two equations. The chosen one is c. First, we multiply equation A by 2:
A2: 182a + 22b + 2c = 76
B2: 98a + 16b + 2c = 22
After we subtract the two equations we get:
84a + 6b = 54
Divide by 6 to simplify:
14a + b = 9
Now multiply equation A by 5:
A5: 455a + 55b + 5c = 190
C5: 35a + 5b + 5c = 20
Subtract them to get:
420a + 50b = 170
Divide by 10:
42a + 5b = 17
Now we have two more equations:
i. 42a + 5b = 17
ii. 14a + b = 9
Multiply equation ii by 5:
70a + 5b = 45
So now we have:
i21: 42a + 5b = 17
ii21: 70a + 5b = 45
Subtract the two equations:
28a = 28
a = 1
Now everything is going to be super fast. We just need to plug in the numbers we get, this time in equation ii (14a + b = 9):
14 * 1 + b = 9
14 + b = 9
b = -5
Another coefficient! They go down like flies! Now let's use equation A, since it has c with a coefficient of 1:
91a + 11b + c = 38
91 - 55 + c = 38
c = 2
So tiny, with so many problems. One coefficient to go, d, the y-intercept. Let's plug it in equation II, where all coefficients are positive but small:
27a + 9b + 3c + d = -4
27 - 45 + 6 + d = -4
d - 12 = -4
d = 8
THE END!
We now have all coefficients for this cubic function, and we can proudly say that it is:
y = x3 - 5x2 + 2x + 8
Who said cubics are hard?
Nadav
nadavs