Let $X$ be a set with $n$ elements and $0 \le k \le n$. Let $a_{n,k}$ be the maximum number of permutations of the set $X$ such that every two of them have at least $k$ common components (where a common component of $f$ and g is an $x \in X$ such that $f(x) = g(x)$). Let $b_{n,k}$ be the maximum number of permutations of the set $X$ such that every two of them have at most $k$ common components.
(a) Show that $a_{n,k} \cdot b_{n,k-1} \le n!$.
(b) Let $p$ be prime, and find the exact value of $a_{p,2}$.
### Part (a)
1. **Define the sets and their properties:**
   Let \( f_k(n) \) denote a set of permutations of \(\{1, 2, \cdots, n\}\) such that any two permutations share at least \( k \) elements. Let \( g_k(n) \) denote a set of permutations of \(\{1, 2, \cdots, n\}\) such that no two permutations share more than \( k-1 \) elements.

2. **Claim:**
   For any permutations \( p_1, p_2 \in f_k(n) \) and \( p_3, p_4 \in g_k(n) \), we have \( p_1 \circ p_3 \neq p_2 \circ p_4 \), where \( \sigma \circ \varphi \) denotes the composition of permutations \( \sigma \) and \( \varphi \).

3. **Proof of the claim:**
   - Since \( p_1 \) and \( p_2 \) have at least \( k \) common components, there exists an \( x \in X \) such that \( p_1(x) = p_2(x) \).
   - Since \( p_3 \) and \( p_4 \) have at most \( k-1 \) common components, there exists an \( x \in X \) such that \( p_3(x) \neq p_4(x) \).
   - Therefore, \( p_1 \circ p_3(x) \neq p_2 \circ p_4(x) \).

4. **Conclusion:**
   Since any two permutations from \( f_k(n) \) and \( g_k(n) \) correspond to a unique permutation of \(\{1, 2, \cdots, n\}\), it follows that \( |f_k(n) \times g_k(n)| = |f_k(n)| \cdot |g_k(n)| \) is at most the total number of permutations of \(\{1, 2, \cdots, n\}\), i.e., \( a_{n,k} \cdot b_{n,k-1} \leq n! \).

   \(\blacksquare\)

### Part (b)
1. **Claim:**
   \( b_{p,1} \geq p(p-1) \)

2. **Proof:**
   - For all \( 1 \leq a \leq p-1 \) and \( 1 \leq b \leq p \), let \( \sigma_{a,b} = \{ai + b \pmod{p}\}_{i=1}^{p} \).
   - We need to show that \( \sigma_{a,b} \) forms a permutation of \(\{1, 2, \cdots, p\}\) for all \( a \in [1, p-1] \) and \( b \in [1, p] \).
   - Suppose there exist \( i, j \) such that \( ai + b \equiv aj + b \pmod{p} \). This implies \( p \mid a(i-j) \). Since \( \gcd(a, p) = 1 \), \( p \mid (i-j) \). However, \( |i-j| \) is never more than \( p-1 \), so \( i = j \).

3. **Common components:**
   - For any \( a, b, c, d \) in the given range, unless \( a = c \) and \( b = d \), \( \sigma_{a,b} \) and \( \sigma_{c,d} \) have at most 1 common component.
   - If \( a = c \), then \( ax + b \equiv cx + d \pmod{p} \implies b \equiv d \pmod{p} \implies b = d \), which is impossible, so there are no common components.
   - If \( a \neq c \) and \( b \neq d \), then \( ax + b \equiv cx + d \pmod{p} \implies x \equiv (d-b)I \pmod{p} \), where \( I \) denotes the multiplicative inverse of \( c-a \pmod{p} \). Hence, \( x \) has only one possibility modulo \( p \), which uniquely determines \( x \).

4. **Conclusion:**
   - The set of permutations \( \{\sigma_{a,b}\}_{1 \leq a \leq p-1, 1 \leq b \leq p} \) has the property that any two elements in it share at most 1 common component. This set has \( p(p-1) \) elements.
   - From part (a), it follows that \( a_{p,2} \leq \frac{p!}{p(p-1)} = (p-2)! \).
   - Considering the set of permutations \( \varphi \) that satisfy \( \varphi(1) = 1 \) and \( \varphi(2) = 2 \), we see that equality must hold (once two elements are fixed, there are \( (p-2)! \) possibilities for \( \varphi \) and any two of them share the common components 1 and 2).

   \(\blacksquare\)

The final answer is \( \boxed{ (p-2)! } \)