A, We used a between-subjects design such that one group of subjects (n = 14) received TMS over the primary motor cortex, and one group of subjects (n = 14) received TMS over the medial parietal cortex. Subjects were scanned before and after TMS. Importantly, the order of the pre- and post-TMS scans was counterbalanced within groups. B, On each trial the same two abstract patterns were presented within a pair of colored stimulus cue windows. The yellow (solid) stimulus windows cued participants to choose the same pattern as on the previous trial (match rule), while the blue (dotted) stimulus windows cued participants to respond to the other pattern (non-match rule). This design allowed us to separate four trial types: (1) trials on which both the task rule and the target stimulus were the same as on the previous trial (non-switch trials), (2) trials on which the task rule remained the same but the target stimulus switched (stimulus-switch trials), (3) trials on which the target stimulus remained the same but the task rule was different from the previous trial (rule-switch trials), and (4) trials on which both the task rule and the target stimulus were different from the previous trial (stimulus/rule-switch trials). The white arrows indicate the correct response (not shown to subjects).