• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Math help

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.
 
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?
 
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.
 
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."
 
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?
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
I should probably add that other models, besides a quadratic model would work. 3 points isn't enough to determine very much.
 
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🙁
 
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.
 
Back
Top