(i) On prolonged heating with HI, glucose gives n-hexane. HI removes every oxygen and leaves the carbon skeleton unchanged, so the six carbon atoms of glucose must be in a straight chain.
In S1, the –CH2OH group hangs off C2 as a branch. Its longest chain has only five carbons, so reduction with HI would give 2-methylpentane, a branched alkane, not n-hexane. S1 is ruled out.
(ii) Glucose forms a stable pentaacetate. NCERT concludes from this that the five –OH groups are attached to five different carbon atoms.
S2 has two –OH groups on the same carbon (C6). Such a group, –CH(OH)2, is unstable: it loses a molecule of water to form a second –CHO group. S2 could not exist as a stable compound with five free –OH groups, so it could not give a stable pentaacetate. S2 is ruled out.

The accepted structure, OHC–(CHOH)4–CH2OH, passes both tests: its chain is straight, and each –OH is on a different carbon.