Let $S$ be a $k$-element set.

[i](a)[/i] Find the number of mappings $f : S \to S$ such that
\[\text{(i)  } f(x) \neq x \text{ for } x \in S, \quad  \text{(ii)  } f(f(x)) = x \text{ for }x \in S.\]

[i](b)[/i] The same with the condition $\text{(i)}$ left out.
### Part (a)
We need to find the number of mappings \( f : S \to S \) such that:
1. \( f(x) \neq x \) for \( x \in S \)
2. \( f(f(x)) = x \) for \( x \in S \)

1. **Condition Analysis**:
   - The condition \( f(f(x)) = x \) implies that \( f \) is an involution. This means that \( f \) is its own inverse.
   - The condition \( f(x) \neq x \) implies that no element is mapped to itself.

2. **Pairing Elements**:
   - Since \( f \) is an involution and \( f(x) \neq x \), each element \( x \) must be paired with a distinct element \( y \) such that \( f(x) = y \) and \( f(y) = x \).
   - This means we need to partition the set \( S \) into pairs \(\{a, b\}\) where \( f(a) = b \) and \( f(b) = a \).

3. **Counting the Pairs**:
   - If \( S \) has \( k \) elements, and each element must be paired, \( k \) must be even. Let \( k = 2t \).
   - The number of ways to partition \( 2t \) elements into \( t \) pairs is given by:
     \[
     \frac{(2t)!}{t! \times 2^t}
     \]
   - Here, \((2t)!\) is the total number of permutations of \( 2t \) elements, \( t! \) accounts for the order of the pairs, and \( 2^t \) accounts for the order within each pair.

Conclusion for part (a):
\[
\boxed{\frac{(2t)!}{t! \times 2^t}}
\]

### Part (b)
We need to find the number of mappings \( f : S \to S \) such that:
1. \( f(f(x)) = x \) for \( x \in S \)

1. **Condition Analysis**:
   - The condition \( f(f(x)) = x \) still implies that \( f \) is an involution.
   - However, the condition \( f(x) \neq x \) is now removed, so elements can be fixed points (i.e., \( f(x) = x \)).

2. **Pairing and Fixed Points**:
   - We can have \( 0 \leq i \leq \left\lfloor \frac{k}{2} \right\rfloor \) pairs of elements where \( f(a) = b \) and \( f(b) = a \).
   - The remaining \( k - 2i \) elements can be fixed points where \( f(x) = x \).

3. **Counting the Configurations**:
   - The number of ways to choose \( 2i \) elements out of \( k \) to form \( i \) pairs is given by \( \binom{k}{2i} \).
   - The number of ways to partition these \( 2i \) elements into \( i \) pairs is given by \( \frac{(2i)!}{i! \times 2^i} \).
   - The remaining \( k - 2i \) elements are fixed points.

4. **Summing Over All Possible \( i \)**:
   - We sum over all possible values of \( i \) from \( 0 \) to \( \left\lfloor \frac{k}{2} \right\rfloor \):
     \[
     \sum_{i=0}^{\left\lfloor \frac{k}{2} \right\rfloor} \binom{k}{2i} \times \frac{(2i)!}{i! \times 2^i}
     \]

Conclusion for part (b):
\[
\boxed{\sum_{i=0}^{\left\lfloor \frac{k}{2} \right\rfloor} \binom{k}{2i} \times \frac{(2i)!}{i! \times 2^i}}
\]