[This post is targeted at a Level 1 student.]

In Lagrange Interpolation, we saw how we transformed a hard problem (question 1) into a simple case (question 2), and then used the simple case to build up our understanding of the hard problem. Some students asked if there are any other similar scenarios. Yes, there are several such instances, which we will cover over time. The intention of this (series of) post, is to illustrate how we can use simple cases to build up our understanding of math.

The following is a well-known example, which is extremely basic. As such, there are no Worked Examples to go through, and students are encouraged to do all the Test Yourself problems. To give everyone a chance to work on them, I will edit out any solutions that are posted in the comments.

Consider the question: How many integers are there between 1234 and 9876?

(Generalized) Question 1: If $A, B$ are integers such that $A \leq B$, how many integers $x$ are there that satisfy $A \leq x \leq B$?

This seems hard to approach, since we do not have any concrete values to work with. The possible integers are $A, A+1, A+2, \ldots, B$. But how many are there? Don’t we end up having to work out the answer to this question in order to proceed?

Question 2: If $C$ is an integer such that $1 \leq C$, how many integers $y$ are there that satisfy $1 \leq y \leq C$?

Well, this is easy. The integers are $1, 2, 3, \ldots C$, so there are $C$ of them. We’re done.

Now, how do we go from Question 1 to Question 2? We use a change of variables, by setting $x-A+1 = y$. Then, we have that $A-A+1 \leq x-A+1 \leq B-A+1$, or equivalently that $1 \leq y \leq B-A+1$. By question 2, we know that there are $B-A+1$ possible values to $y$, hence there must be $B-A+1$ possible values to $x= y+A-1$.

### Test Yourself

1. Back to the original question: How many integers are there between 1234 and 9876?

2. Does it matter in the proof if $A, B$ are negative numbers?

3. If $A, B$ are integers such that $A < B$, how many integers are there which satisfy $A < x < B$? What happens to the formula if $A=B$? Why?

4. Consider the Arithmetic Progression given by $2, 9, 16, 23, 30, \ldots 7779$, where each term is 7 more than the previous term. How many terms are there in this sequence?

From → General, Level 1

1. Can’t it be directly deduced using the idea of an Arithmetic Progression i.e.
any general term (nth term) of an A.P can be given as,
a(n) = a + (n-1) d
where a is the first term of the A.P. , n is the number of terms, and in case of consecutive integers, common difference d would be 1.
So in the above case, first term would be A , nth term is B, and common difference d is 1 .
Substituting the values in above, we will get,
B = A + (n-1)1
that is , n= B – A + 1
which is the result you derived.

[Solutions to Test Yourself questions edited out.]

Please comment if i’m mistaken in something…

• No, you’re not mistaken in anything. The intention is to demonstrate how simplifying a problem can actually help us solve it. As I said, this is a very simple example, (as compared to the Lagrange Interpolation formula), which is why there are no worked examples in this post. Over time, there will be similar posts with such a concept.

When learning about an Arithmetic Progression, you actually went through this process of counting the number of integers from A to B (like in Test Yourself 3). So, it’s not exactly a deduction from AP, as this is used to build up our theory of AP.

There are students of various ability levels on Brilliant, which is why these blog posts will vary in its target audience.

[Solution edited out]

[Solution edited out]

[Solution edited out]

[Solution edited out]

if both the numbers are included

Why did you set x – A + 1 = y? How do you know to set x – A + 1 = y?

• “Each problem that I solved became a rule, which served afterwards to solve other problems.” – Descartes

The idea behind this post, is that we want to reduce a problem to something already solved. This post highlights how a ‘hard’ problem (question 1) can be simplified to an easy one (question 2), which we then use to solve the hard problem.

So, how do we get $A \leq x \leq B$ to look like $1 \leq y \leq C$? Well, the $A$ must become a 1. Since these are linear inequalities involving integers, we want our corresponding solutions to remain as integer. Thus, we have to subtract $A$ and add 1 throughout the equation. This gives the change of variables: $A \rightarrow 1 = 1, x \rightarrow x - A + 1 = y, B \rightarrow B - A + 1 = C$.

please check if the answers are correct.if they are not ,tell me where i might have gone wrong or if there is any better way to work them

[Solutions edited out - Calvin]

One way that we can proceed, is to easily answer the question: If $B$ is a positive integers, how many integers x are there that satisfy $0 < x < B$.