Math help

Accipiter22

Banned
Feb 11, 2005
7,942
2
0
I had asked a question previously, but f'd it up.....I wanted to ask it again.....I have 2 VARIABLES A and B. B is a reward depending on much A is. A can be anywhere from 0.0 - 7.0. I have been given a few samples:

if A=2.5 then b=0
if A=4 then B=1
if A=5 then B=2

I need a formula here. I'll be given a value for A, so I need to solve for B....someone in my previous thread mentioned regression, but I have NO idea how to do any of that garbage. This isn't homework, so don't yell at me for asking for the formula I need here.
 

giantpinkbunnyhead

Diamond Member
Dec 7, 2005
3,251
1
0
Are those the only 3 data points you have? If A is less than 2.5, is B zero or can it go negative?

edit: can B only be whole numbers? Can A be anything, such as 2.349? How accurate are we talking?
 

Accipiter22

Banned
Feb 11, 2005
7,942
2
0
Originally posted by: giantpinkbunnyhead
Are those the only 3 data points you have? If A is less than 2.5, is B zero or can it go negative?

edit: can B only be whole numbers? Can A be anything, such as 2.349? How accurate are we talking?

Those are the only 3 points I have, A can be anything between those 2 points I gave. so it could be 2.23895729385792375 or 5.29835792735 or whatever.

Thanks for the help; I'd use one of my other threads but I messed up my explanation in both of those massively, so no one new what i was talking about.
 

homercles337

Diamond Member
Dec 29, 2004
6,340
3
71
y = mx + b

Here is your m and b: 0.789473684210527 and -2.026315789473686 via least squares.

m is your slope and b is the y-intercept. I treated your "a" as "x" and your "b" as "y."
 

dullard

Elite Member
May 21, 2001
25,888
4,470
126
We really need more information. There are an infinite number of formulas that will work. Thus, how are we supposed to give you just one and know it is the correct one that you are looking for?

Instead of us confusing you with many questions, can you draw us a graph?
 

apac

Diamond Member
Apr 12, 2003
6,212
0
71
Originally posted by: homercles337
y = mx + b

Here is your m and b: 0.789473684210527 and -2.026315789473686 via least squares.

m is your slope and b is the y-intercept. I treated your "a" as "x" and your "b" as "y."

This looks more like logarithmic regression than linear, but it's hard to tell from only 3 data points.
 

nycxandy

Diamond Member
Apr 11, 2001
3,731
0
76
Originally posted by: homercles337
y = mx + b

Here is your m and b: 0.789473684210527 and -2.026315789473686 via least squares.

m is your slope and b is the y-intercept. I treated your "a" as "x" and your "b" as "y."

Nope.
 

DrPizza

Administrator Elite Member Goat Whisperer
Mar 5, 2001
49,601
167
111
www.slatebrookfarm.com
Hopefully, someone reads this post before they simply post the answer for you, like they did last time.

I clearly stated how to solve the problem in both of your other threads. You asked for "help", not "someone do my homework for me and I'll copy down the answer."

Write down ax^2 + bx + c = y three times.
in each equation, replace x and y with one of your data points.

i.e. a*5^2 + b*5 + c = 2
(for the point (5,2) )
This becomes 25a +5b + c = 2

You'll end up with three equations and 3 unknowns. Solve for a, b, and c, and you'll have a quadratic equation that passes exactly through each of those points.
 

nycxandy

Diamond Member
Apr 11, 2001
3,731
0
76
Originally posted by: DrPizza
Hopefully, someone reads this post before they simply post the answer for you, like they did last time.

I clearly stated how to solve the problem in both of your other threads. You asked for "help", not "someone do my homework for me and I'll copy down the answer."

Write down ax^2 + bx + c = y three times.
in each equation, replace x and y with one of your data points.

i.e. a*5^2 + b*5 + c = 2
(for the point (5,2) )
This becomes 25a +5b + c = 2

You'll end up with three equations and 3 unknowns. Solve for a, b, and c, and you'll have a quadratic equation that passes exactly through each of those points.

Yeah, this is the perfect way to do it with algebra. Simple and easy.
 

dullard

Elite Member
May 21, 2001
25,888
4,470
126
Originally posted by: DrPizza
Write down ax^2 + bx + c = y.
You are still assuming he needs it to be a continuous function. What if B is only whole numbers? Then the easiest function is probably something like this.

For example, typically when a teacher rewards a student with stickers, the teacher gives the student 0, 1, or 2 stickers. Teachers don't give 1.47685742189 stickers on a worksheet.
 

homercles337

Diamond Member
Dec 29, 2004
6,340
3
71
Originally posted by: apac
Originally posted by: homercles337
y = mx + b

Here is your m and b: 0.789473684210527 and -2.026315789473686 via least squares.

m is your slope and b is the y-intercept. I treated your "a" as "x" and your "b" as "y."

This looks more like logarithmic regression than linear, but it's hard to tell from only 3 data points.

Given that the OP has NO idea how to do any of that garbage do you really think that linear isnt the best assumption? Especially with only 3 data points? Try it, use whatever x's you want with those coeffs.
 

nycxandy

Diamond Member
Apr 11, 2001
3,731
0
76
Originally posted by: dullard
Originally posted by: DrPizza
Write down ax^2 + bx + c = y.
You are still assuming he needs it to be a continuous function. What if B is only whole numbers? Then the easiest function is probably something like this.

He's looking for a formula.
 

nycxandy

Diamond Member
Apr 11, 2001
3,731
0
76
Originally posted by: dullard
Originally posted by: nycxandy
He's looking for a formula.
That IS a perfectly correct and valid formula.

In his previous threads, he was satisfied with the quadratic equation provided. However, he accidentally switched A and B and thus now needs a new equation.
 

darthsidious

Senior member
Jul 13, 2005
481
0
71
One approach if you need B to be a whole number is to use a quantization algorithm, like the Lloyd-Max algorithm(without iteration). It's fairly intuitive. Draw a line from 0 to 7, and mark the points for which you know B (A = 2.5, 4 and 5), then bisect the region between two points. Then for the A in each region, the corresponding B is the one in the region. For example, the middle of 2.5 and 4 is 3.25, so you can say for any A between 0 and 3.25, B =0; for A between 3.25 and 4.5, B =0, and so on.

Google if you want more information on the Lloyd-Max algorithm.
 

Goosemaster

Lifer
Apr 10, 2001
48,775
3
81
Originally posted by: DrPizza
I should probably add that other models, besides a quadratic model would work. 3 points isn't enough to determine very much.

3 points on your license is enough to get reamed with insurance rates here in VA though

They don't need much more than that to really schtick it to you
 

Accipiter22

Banned
Feb 11, 2005
7,942
2
0
Originally posted by: DrPizza
Hopefully, someone reads this post before they simply post the answer for you, like they did last time.

I clearly stated how to solve the problem in both of your other threads. You asked for "help", not "someone do my homework for me and I'll copy down the answer."

Write down ax^2 + bx + c = y three times.
in each equation, replace x and y with one of your data points.

i.e. a*5^2 + b*5 + c = 2
(for the point (5,2) )
This becomes 25a +5b + c = 2

You'll end up with three equations and 3 unknowns. Solve for a, b, and c, and you'll have a quadratic equation that passes exactly through each of those points.



that may be easy for someone who holds a doctorate in Pizza....but I have NO idea how to solve for that stuff that you gave me......and again, you're reversing the equation...I'm NOT going to have the (0,1,2)...I'll be given a number between 0.0 and 7.0. so having an equation that =2 doesn't do me any good. I can't solve that equation you gave me since there's an x^2 and a regular X in it and I don't know how to do that.


To answer the other questions, the reward can be anywhere between 0 and upward, and with as many decimals as the formula gives.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |