How to understand this sentence? "If the sequence of letters lexicographically precedes the first word on the page, we know to go backwards."

If the sequence of letters lexicographically precedes the first word on the page, we know to go backwards.

Why is it go backwards? I think it should be go forward. How to understand this sentence?

I got this sentence from a python textbook (Introduction to Computation and Programming Using Python). The whole paragraph is as follows:

Fortunately, the folks who publish hard-copy dictionaries go to the trouble of putting the words in lexicographical order. This allows us to open the book to a page where we think the word might lie (e.g., near the middle for words starting with the letter m). If the sequence of letters lexicographically precedes the first word on the page, we know to go backwards. If the sequence of letters follows the last word on the page, we know to go forwards. Otherwise, we check whether the sequence of letters matches a word on the page.

• Please include the source where you found the sentence and some context. It looks like you found this at venali.medium.com/… ? Commented Jan 10, 2023 at 17:41

The sentence looks correct as it is. The author is talking about looking up a sequence of letters in a dictionary.

We can break it down like this:

If the sequence of letters (that we are looking for)
lexicographically (in dictionary order)
precedes (comes before)
the first word on the page, (of the dictionary that we are looking at)
we know to go backwards. (in the dictionary)

So for example, if our sequence of letters is DESTITUTE, but the first word on the dictionary page that we are looking at is DIBBLE, we would go backwards in the dictionary (to an earlier page) because DESTITUTE comes before DIBBLE in dictionary order.

• One wonders why they don't just say alphabetically.... Commented Jan 10, 2023 at 18:02
• @Lambie - that's Pythonistas for you. One reason I prefer Ruby as a language. Commented Jan 10, 2023 at 18:34