Values between two numbers separated by steps?

GammaLogic

New member
Joined
Dec 3, 2020
Messages
1
Hello folks.

Trying to google for this isn't working, as I don't know the proper terminology. The only hits I found were related to computer programming solutions for other, more complex problems.

I have two values. Let's say they are 25, and 100. I need to get to 100 from 25 in a certain number of steps. Let's say 8 steps in total (I'm sure there's a better word for step but I don't know what it is.)

So if I visualize that:
1. 25
2.
3.
4.
5.
6.
7.
8. 100

How would I find the values between them, so that the distance between each step is more or less the same? I believe this to be a basic math problem, but if it's something else I apologize.
 
First, what do you mean by "a step". Do you mean an arithmatic operation like "add 4" or "multiply by 3"?

Second, what do you mean by "distance between each step"?

100- 25= 75 and 75/8= 9.375. Adding 10 7 times would give 25+ 70= 95 so adding so adding 5 the eighth time gives 100. Will that do?
 
Hello folks.

Trying to google for this isn't working, as I don't know the proper terminology. The only hits I found were related to computer programming solutions for other, more complex problems.

I have two values. Let's say they are 25, and 100. I need to get to 100 from 25 in a certain number of steps. Let's say 8 steps in total (I'm sure there's a better word for step but I don't know what it is.)

So if I visualize that:
1. 25
2.
3.
4.
5.
6.
7.
8. 100

How would I find the values between them, so that the distance between each step is more or less the same? I believe this to be a basic math problem, but if it's something else I apologize.
suppose you needed 3 equidistant steps between 2 & 6 - those would be 3 & 4 & 5

Step height is [(6-2)/(3+1) =] 1

Now think about original problem and tell us what you found!
 
You would be clearer if you said EQUAL steps. As you have phrased it there are an infinite number of answers; for example, 26, 27, 28, 29, 30, 30.5, 30.75, 100.

Now if you said equal integer steps, there may not be any answer. We can tell you how to get an answer for equal steps, but it won’t necessarily be integers. We can tell you how to get steps that are integers and as close to equal as possible, but there will not be a unique answer.

So what is your question?
 
This is called linear interpolation.

The idea is that you have a starting value, an ending value, and you want to know what the value is at a certain proportion of the distance along the way. If you add 0% of the distance to travel to the starting value, you remain at the starting value. If you add 100% of the distance to travel to the starting value, you wind up at the ending value. In any situation, you perform [MATH]start + distance * proportion[/MATH] to find the corresponding interpolated value.

In the given example, the starting value is [MATH]25[/MATH], the ending value is [MATH]100[/MATH] and the proportion is each of the increments of [MATH]\frac{1}{7}[/MATH]. The distance to travel is the difference between the starting and ending values: [MATH]100 - 25 = 75[/MATH]. To find the interpolated value at the [MATH]n^{th}[/MATH] step, the formula is simple:

[MATH]start + (end - start) * \frac{n}{7}[/MATH]​

This produces the following sequence:
  1. [MATH]25 + (100 - 25) * 0/7 = 25[/MATH]
  2. [MATH]25 + (100 - 25) * 1/7 \approx 35.7[/MATH]
  3. [MATH]25 + (100 - 25) * 2/7 \approx 46.2[/MATH]
  4. [MATH]25 + (100 - 25) * 3/7 \approx 57.1[/MATH]
  5. [MATH]25 + (100 - 25) * 4/7 \approx 67.9[/MATH]
  6. [MATH]25 + (100 - 25) * 5/7 \approx 78.6[/MATH]
  7. [MATH]25 + (100 - 25) * 6/7 \approx 89.3[/MATH]
  8. [MATH]25 + (100 - 25) * 7/7 = 100[/MATH]
 
Top