Computer Science Canada Another simple quadratic question!!! |
Author: | Nathan4102 [ Sun May 12, 2013 5:26 pm ] | ||
Post subject: | Another simple quadratic question!!! | ||
Alright, so I'm working on more of this quadratics work, and I've come across another problem. Its not that I can't solve this one, its that I think I'm doing it the wrong way. It took me about 3 minutes to find the equations for the let statements, and a decent amount of time to solve the equation because of all the fractions. Obviously, I need all the time I can get on tests and exams, so is there a cleaner, better, and faster method to solve this? Q: A bus company carries about 20 000 riders per day for a fare of $0.90. A survey indicates that if the fare is decreased, the number of riders will increase by 2000 for every decrease of $0.05. Find the ticket price that will result in the greatest revenue. A:
|
Author: | whoareyou [ Sun May 12, 2013 6:06 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
When you're doing quadratic optimization, most of the time you'll need to find the vertex of the function. The x-value of the function is -b/2a when the equation is in the form ax^2 + bx + c. So at the second line after your let statements, -56000/-80000 = 0.7. |
Author: | TZak [ Sun May 12, 2013 6:06 pm ] |
Post subject: | Re: Another simple quadratic question!!! |
Find the derivative. |
Author: | whoareyou [ Sun May 12, 2013 6:08 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Sorry, "The x-value of the function is" should read "The x-value of the vertex is." |
Author: | Nathan4102 [ Sun May 12, 2013 6:11 pm ] |
Post subject: | Re: RE:Another simple quadratic question!!! |
whoareyou @ Sun May 12, 2013 7:06 pm wrote: When you're doing quadratic optimization, most of the time you'll need to find the vertex of the function. The x-value of the function is -b/2a when the equation is in the form ax^2 + bx + c. So at the second line after your let statements, -56000/-80000 = 0.7.
"-b/2a"? Not too sure what you mean by this. This is only grade 10, btw, in case thats 11+. TZak wrote: Find the derivative. We haven't been taught derivatives yet. I could learn them on my own, but my teacher wouldn't mark it. |
Author: | Nathan4102 [ Sun May 12, 2013 6:12 pm ] |
Post subject: | Re: RE:Another simple quadratic question!!! |
whoareyou @ Sun May 12, 2013 7:08 pm wrote: Sorry, "The x-value of the function is" should read "The x-value of the vertex is."
Ok, now the -b/2a makes a bit more sense, but could you explain how you got it? |
Author: | Zren [ Sun May 12, 2013 6:14 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Where did 56 000 come from? I interpreted it as: Revenue = Riders * Cost Revenue = 20000 * $0.90 let y represent revenue let x represent ______ <= Not quite sure what to call it really. y = (20000 + 2000x)($0.90 - $0.05x) It's in factored form. So you just have to convert it to vertex form to get x at the maximum/vertex of the parabola. I don't quite remember how to write vertex form so... http://www.wolframalpha.com/input/?i=%2820000+%2B+2000x%29%280.90-0.05x%29 Which tells me the maximum is at x=4. Which means Cost=$0.90*$0.05(4) = $0.70. So your answer is correct... somehow. |
Author: | whoareyou [ Sun May 12, 2013 6:20 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
A quadratic equation in standard form has the general formula Ax^2 + Bx + C. I'm stating that the x-value of vertex of the quadratic function in standard form is given by -B/2A (ie. the coefficients in the general form). For example, y = 56 000x - 40 000x^2 is in standard form. So to get the vertex, you identify B = 56000 and A = -40000, so -B/2A = -56000/2(-40000) = 0.7. This is actually part of the quadratic formula, so you should have learned it. However there is a simple way to derive that formula for the vertex. If you have the quadratic in standard form, you take the derivative and set it equal to zero (ie. the rate of change at the vertex is zero). So d/dx (Ax^2 + Bx + C) = 2AX + B. 0 = 2Ax + B -B = 2Ax x = -B / 2A |
Author: | Nathan4102 [ Sun May 12, 2013 6:23 pm ] |
Post subject: | Re: RE:Another simple quadratic question!!! |
Zren @ Sun May 12, 2013 7:14 pm wrote: Where did 56 000 come from?
I interpreted it as: Revenue = Riders * Cost Revenue = 20000 * $0.90 let y represent revenue let x represent ______ <= Not quite sure what to call it really. y = (20000 + 2000x)($0.90 - $0.05x) It's in factored form. So you just have to convert it to vertex form to get x at the maximum/vertex of the parabola. I don't quite remember how to write vertex form so... http://www.wolframalpha.com/input/?i=%2820000+%2B+2000x%29%280.90-0.05x%29 Which tells me the maximum is at x=4. Which means Cost=$0.90*$0.05(4) = $0.70. So your answer is correct... somehow. In our class, x almost always represents whats being looked for, in this case, the price. and since y is the multiplication of x and the other variable, the other variable has to be number of people. That 56000 thing was just (20 000 + 40 000(.9 - x)) simplified, which is my equation for number of people riding the bus. I'll have to check with my teacher weather or not I'm allowed to use your method. He's usually pretty set on us using the methods taught though. Thanks for the explanation |
Author: | Nathan4102 [ Sun May 12, 2013 6:27 pm ] |
Post subject: | Re: RE:Another simple quadratic question!!! |
whoareyou @ Sun May 12, 2013 7:20 pm wrote: A quadratic equation in standard form has the general formula Ax^2 + Bx + C.
I'm stating that the x-value of vertex of the quadratic function in standard form is given by -B/2A (ie. the coefficients in the general form). For example, y = 56 000x - 40 000x^2 is in standard form. So to get the vertex, you identify B = 56000 and A = -40000, so -B/2A = -56000/2(-40000) = 0.7. This is actually part of the quadratic formula, so you should have learned it. However there is a simple way to derive that formula for the vertex. If you have the quadratic in standard form, you take the derivative and set it equal to zero (ie. the rate of change at the vertex is zero). So d/dx (Ax^2 + Bx + C) = 2AX + B. 0 = 2Ax + B -B = 2Ax x = -B / 2A My god... That would make everything so much simpler! I'm not sure why we haven't been taught this... I'm going to ask my teacher if I can use this method. Thanks for this method, if I'm allowed to use this, its going to save me sooo much time! The method we use now takes forever! |
Author: | Dreadnought [ Sun May 12, 2013 8:03 pm ] |
Post subject: | Re: Another simple quadratic question!!! |
I can't see why your teacher would be against this, there is no math needed that is is beyond the scope of grade 10. When you're trying to minimize a parabola opening upwards, or maximize one opening downwards, the optimal point is clearly the trough or the peak respectively. Since parabolas are symmetric, the peak or trough is halfway between the two x-intercepts. From the quadratic formula it should be obvious that this midpoint is -b/2a (like whoareyou said). Symmetry is very nice and can often save you a little time. Note: Don't worry about cases where the function doesn't cross the x-axis since the complex roots (have you learned imaginary numbers yet?) will also cancel each other. |
Author: | Panphobia [ Sun May 12, 2013 8:12 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Everything I think from grade 7 or 8 has been preparing you for calculus and all of its elegance. So right now I am guessing you are in grade 10, you are doing quadratic optimization the ugly and barbaric way. Just wait until grade 12 calculus, everything will be so simple and fun. I am afraid you are going to be stuck with this ugly way up until calculus. |
Author: | Nathan4102 [ Sun May 12, 2013 9:55 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Imaginary numbers are next year dread, I guess ill just have to do it this way for now. Thanks pan, I think youre the first person ive seen say something positive about 12 calculus! All ive heard is "its hell!" "Dont take it" "Calc made me hate math" blah blah blah :p |
Author: | Dreadnought [ Sun May 12, 2013 10:36 pm ] |
Post subject: | Re: Another simple quadratic question!!! |
Sorry, that question was just out of curiosity, it doesn't really help with this problem. Don't worry about imaginary numbers. The important thing is that a parabola is symmetric about a vertical line through its vertex (peak/trough) and that from this we can see that the midpoint of the x-intercepts of the parabola is the x-coordinate of the vertex. Then we can use the x-intercepts given by the quadratic formula to show the midpoint is at x = -b/2a, regardless of whether the function has real x-intercepts or not. (So even though you no longer have x-intercepts on a graph of your function, the math will still work out) Also, calculus is very nice. If you have any interest in science or math you really should take it, and if you have any interest in math you'll probably enjoy it too! |
Author: | Nathan4102 [ Mon May 13, 2013 9:02 am ] |
Post subject: | RE:Another simple quadratic question!!! |
Yeah, x = -b/2a makes sense to me. Hopefully we get to use it soon. I hate this long process just to find something visible in the second line. I have to take calculus for University compsci, so hopefully it will be good! |
Author: | Panphobia [ Mon May 13, 2013 3:06 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Are you in grade 10? If so you won't be using it soon. Also if you haven't been taught calculus or haven't taken physics at least I do not know how it makes sense to you really, do you know what taking a derivative is? |
Author: | Nathan4102 [ Mon May 13, 2013 3:15 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Yeah, greade 10, and crap. I dont know what a derivative means, and what shouldnt make sense to me? |
Author: | Panphobia [ Mon May 13, 2013 3:39 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
I don't know how -b/2a makes sense to you if you don't know what a derivative is |
Author: | Nathan4102 [ Mon May 13, 2013 3:48 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
I suppose "underatand" was the wrong word to use. I see the math behind it, but I dont actually understand why or how this works. |
Author: | Panphobia [ Mon May 13, 2013 4:05 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Basically a derivative is the Rate of change at any point in a graph, so rate of change is the same thing as slope on a line. Since we know at a maximum or a minimum the slope of that point is 0 you set the derivative to 0 and solve for x |
Author: | Nathan4102 [ Mon May 13, 2013 4:27 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
So like a tangent line drawn on a point of a parabola? I think I understand the concept, one thing though. Where does 2AX + B come from in "d/dx (Ax^2 + Bx + C) = 2AX + B"? |
Author: | Panphobia [ Mon May 13, 2013 4:42 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
You haven't learned functions yet but basically if y = ax^2+bx+c. And f(x) =y then to get the derivative using first principles which will work always is f'(x) = lim h->0 (f(x+h)-f(x))/h that is basically function composition and you have to arrange such that it won't be divided by h because h is approaching 0. So the rule with polynomials is called the power rule and this is it if you have a function x^n the derivative function is nx^(n-1) so Ax^2 + Bx^1 + Cx^0 would be 2Ax + (1)Bx + (0)Cx^-1 and anything multiplied by 0 is 0 so you leave it out...and there you go |
Author: | Nathan4102 [ Mon May 13, 2013 4:48 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
I got some of that, didn't get some of that... Neat stuff though, grade 12 calculus sounds pretty interesting. Thanks for the explanations, I think I should stick to perfecting grade 10 quadratics before taking on calculus ![]() |
Author: | Raknarg [ Mon May 13, 2013 7:23 pm ] |
Post subject: | Re: Another simple quadratic question!!! |
You'll actually kindof touch on it in Grade 11. Lets say you wanted to find out what the slope was around the point. The simplest way is to take two points around the point you're looking at, and find the slope between them. Ex. y = x^2, and you wanted to know the slope at 2. Therefore: m (or slope) = (y2 - y1) / (x2 - x1) We can replace these values: m = (f (x + 1) - f (x)) / (x2 - x1) Where f (x) is the formula for the graph (same thing as saying y). Now lets replace those f's: m = ((2 + 1)^2 - (2)^2) / ((2 + 1) - 2) m = ((3)^2 - (2)^2) / (3 - 2) m = (9 - 4) / 1 m = 5 This is inaccurate though. This isnt the slope of the point, this is the slope of the point x and one above. Lets get lower. m = ((2 + 0.1)^2 - (2)^2) / ((2 + 0.1) - 2) m = ((2.1)^2 - (2)^2) / (2.1 - 2) m = (4.41 - 4) / 0.1 m = 0.41 / 0.1 m = 4.1 This is better, but not good enough. What we're heading for is the same point though, so whjy don't we try that? m = ((2)^2 - (2)^2) / ((2) - 2) You can see right now that we're going to get an error. The slope is obviously not 0 / 0. The trick around that is to do this: m = [f (x + h) - f (x)] / (x + h - x) h is the number we want to add to x. Our goal is zero, but if we put in zero we'll run into a problem. Instead, lets try to get rid of h and see what happens: m = [(2 + h)^2 - (2)^2] / (2 + h - 2) m = [(2 + h)^2 - 4] / h m = [(4 + 4h + h^2 - 4] / h m = [4h + h^2] / h Now lets remove an h from each polynomial: m = [4 + h] / 1 But wait... h is zero! That leaves us with: m = 4 This is what we're looking for. The slope is 4. Now lets extrapolate this to the entire funtion of x^2: m = [(x + h)^2 - x^2] / (x + h - x) m = [x^2 + 2xh + h^2 - x^2] / h m = [2xh + h^2] / h m = [2x + h] / 1 Now we alway set h to 0, so it leaves us with this: m = 2x The slope is 2x at any point. Lets try this with 2x^3 + 3x^2 + x + 5 m = [2(x + h)^3 + 3(x + h)^2 + (x + h) + 5 - (2x^3 + 3x^2 + x + 5)] / (x + h - x) now it looks ugly but bear with me... m = [2(x^3 + 3hx^2 + 3xh^2 + h^3) + 3(x^2 + 2xh + h^2) + (x + h) + 5 - (2x^3 + 3x^2 + x + 5)] / (x + h - x) m = [2x^3 + 6hx^2 + 6xh^2 +2h^3 + 3x^2 + 6xh + 3h^2 + x + h + 5 - 2x^3 - 3x^2 - x - 5] / h Now we remove anything we can right now m = [6hx^2 + 6xh^2 +2h^3 + 6xh + 3h^2 + h] / h new remove an h m = [6x^2 + 6xh +2h^2 + 6x + 3h + 1] Set all h's to 0 m = 6x^2 + 6x(0) +2(0)^2 + 6x + 3(0) + 1 m = 6x^2 + 6x + 1 Look how nicely that cleaned up! But this is gross, and we want a simpler way right? Lets look at the two formulas: y = 2x^3 + 3x^2 + x + 5 m = 6x^2 + 6x + 1 There is a pattern here: In each case, we put the exponent down by one, and multiplied the coefficient by the previous exponent. Notice how the 5 is now gone? We can rewrite that as 5x^0. 5 * 0 is 0, so we chuck it out. The x turned into 1 because 1 * 1 = 1. Now we can do cool stuff with this. Lets take a random equation like y = 4x^4 - x^3 + 7x y = 4x^4 - x^3 + 7x m = 16x^3 - 3x^2 + 7 But anyways, this is basically caluclus. There's rules and stuff for different situations, but this is basicallt the most important one. In fact all the rules you need to know can be proved logically by this basic formula. |
Author: | Nathan4102 [ Mon May 13, 2013 7:38 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Calculus doesn't look that bad... More algebra, new equations, more variables... Obviously, I assume it gets a fair bit harder, but this is a neat intro. Ill take time later to try to understand all this, thanks! |
Author: | Raknarg [ Mon May 13, 2013 7:48 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Its actually basically stuff you know writ in a different way ![]() |
Author: | Panphobia [ Mon May 13, 2013 9:04 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Yea and you will not have to use the (f(x+h)-f(x))/h for all of grade 12 calculus, for most of it you will get to use rules such as the power rule which I touched on, the chain rule, the quotient rule, and the product rule. This will make getting derivatives so easy it will take literally seconds. |
Author: | Raknarg [ Mon May 13, 2013 9:16 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
I remember I got so annoyed with trying to remember the procedure for finding the vertex form equation of a parabola that i just memorized the formula |
Author: | Nathan4102 [ Mon May 13, 2013 9:16 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Sweet! I dont understand why they teach us all this stuff then, like if theres a faster, more efficient way, and ill never use this after I learn the better way, why teach me it??? |
Author: | Panphobia [ Mon May 13, 2013 9:21 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
This is because you always have to learn and understand the long and tedious way to do things before you can go on to the quick and elegant way. This is how it is these days, but like I said all your math classes, except for data management have been setting you up for calculus. In my opinion calculus is too easy in grade 12, they took out too much of actual calculus, like what you learn in grade 12 is around 30-40% of what calculus is. You are not supposed to learn integration, you are not supposed to learn any limit rules, oh yea and with limits you basically do 3-4 days and you get a test on them and you're done. It really amazes me how crappy it is. If you have a love for math I suggest doing the Calculus AP exam. |
Author: | Nathan4102 [ Mon May 13, 2013 9:40 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Weve done no data management, maybe thats coming. I certainly hope calculus is as easy as you say it is, I have a feeling grade 12 is gonna be a tough year as it is. Math and Compsci are my two fave courses, so Id do an AP exam if I could, I dont think we have them here though. At my school, its Essential, Open, College/Applied, University/Academic. Nothing above that, which sucks, because I find my math fairly boring. That, plus an open level computer science course makes for a super boring semester. |
Author: | Panphobia [ Mon May 13, 2013 9:49 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
Data management is a grade 12 math course. Also you have to study on your own for the AP exams, and also how is Math one of your favourite courses if you find math fairly boring? |
Author: | Nathan4102 [ Mon May 13, 2013 10:21 pm ] |
Post subject: | RE:Another simple quadratic question!!! |
The class is boring, I think this is the first unit where Ive actually had to put in a decent amount of effort to get90+. |