(A) Example of a trial, consisting of a sequence of seven pure tones of a standard frequency (blue waveform) and one pure tone of a deviant frequency (fourth tone in the example; red waveform), that could be located in positions 4, 5, or 6. Subjects had to report, in each trial, the position of the deviant. Each subject completed 240 trials in total, 80 per deviant position. All tones had a duration of 50 ms and were separated by 700 ms inter-stimulus-intervals (ISIs). (B) Schematic view of the expected underlying responses in the auditory pathway for the sequence shown in A, together with the definition of the experimental variables (: first standard; : repeated standards preceding the deviant; : standards following the deviant; : deviant in position x). (C) Expected responses in the auditory pathway nuclei corresponding to the habituation (h1) and predictive coding (h2) hypotheses. Since the posterior probability of finding a deviant at locations 4, 5, or 6 after hearing 3, 4 or 5 standards is 1/3, 1/2, and 1, respectively, predictive coding predicts different BOLD responses to different deviant locations.