What are SN1ʹ and SN2ʹ reactions?

I went through the problems 119 and 120 from chapter 4 Reaction mechanism of Singh's Conceptual problems in organic chemistry [1, p. 190] targeting nucleophilic substitution reactions for 3-bromo-3-methylcyclohex-1-ene:

The answer of the problem 119 is $$\mathrm{S_N1'}$$, and that of 120 is $$\mathrm{S_N2'}$$. I actually can't figure out what $$\mathrm{S_N1'}$$ ($$\mathrm{S_N1}$$ prime) and $$\mathrm{S_N2'}$$ ($$\mathrm{S_N2}$$ prime) are.

Also, how does the answer change by changing the nucleophile?

Reference

1. Singh, D. K. Conceptual Problems in Organic Chemistry: For Engineering and Medical Entrance Examinations, 3rd ed.; Pearson India, 2013. ISBN 978-93-325-8207-1.
• The ' indicates that the actual substitution site is not where the leaving group is attached. In the cases presented, the nucleophile would add at the upper end of the double bond.
– Zhe
Commented Sep 19, 2017 at 17:23

The primed version of $\mathrm{S_N1}$ and $\mathrm{S_N2}$ can only occur if there is a double bond in the vicinity of the leaving group as in your example. I have drawn both possibilities for the $\mathrm{S_N2}$ case in the scheme below.
Scheme 1: Comparison of the reaction products in an $\mathrm{S_N2}$ (top) and $\mathrm{S_N2'}$ (bottom) pathway.
The $\mathrm{S_N2}$ reaction is as you expect it to be. The $\mathrm{S_N2'}$ reaction uses the double bond as an electron relay system. Instead of the nucleophile (here: $\ce{OMe-}$) directly interacting with the $\unicode{x3c3}^*(\ce{C-Br})$ orbital, the π system interacts with the σ* orbital. The nucleophile then interacts with the π system’s LUMO (corresponding to the middle orbital of the allyl π system) to perform the attack. Since the nucleophilic attack and the leaving group are on different carbon atoms, relayed by the π system, this is not a direct $\mathrm{S_N2}$ but a derivative of it ($\mathrm{S_N2'}$).
The same logic can be applied to $\mathrm{S_N1'}$: here, the intermediate carbocation is not a localised one but an allyl cation.
The primed versions here are observed because not only the bimolecular attack on the highly substituted tertiary carbon ($\mathrm{S_N2}$) is unlikely — this carbon is tertiary which usually already implies no $\mathrm{S_N2}$ — but also the capturing of the carbocation under $\mathrm{S_N1}$ conditions is more likely to happen at the sterically much less hindered carbon atom.
As to why methanol predominantly attacks according to an $\mathrm{S_N1}$-type mechanism while methanolate predominantly follows an $\mathrm{S_N2}$-type mechanism I will refer you back to your textbook; the reasons are stated pretty often.