This plot, popularized by Dai Vernon, dates back at least to the unpublished Sloane 424, c. 1600s, p. 155 of the Pieper translation. This manuscript was published in Gibecière, Vol. 5 No. 2, Summer 2010, p. 141-172. In this simplified version, all of the possible thought-of cards were at the bottom of the deck.
The idea of arranging a couple of target cards at the top and bottom appeared in Gilles-Edme Guyot's Nouvelles Récréations, Physiques et Mathématiques, 1769, p. 9 of the unpublished Hugard translation. There, someone was asked to think of any one of four random cards. The performer then secretly arranged two of these cards at the top of the deck and two near the bottom (fifth and sixth up from the face). The spectator was shown a group of cards from the bottom and asked if he saw his among them. His answer narrowed the possibilities for the performer from four to two. One of the two possible cards was next shown. If that card was the selection, the trick was successfully concluded. If it was not, the card was switched, through the Glide, for the selection, and the card was shown to have changed.