Let $S = \{1, 2, \ldots, 2016\}$, and let $f$ be a randomly chosen bijection from $S$ to itself. Let $n$ be the smallest
positive integer such that $f^{(n)}(1) = 1$, where $f^{(i)}(x) = f(f^{(i-1)}(x))$. What is the expected value of $n$?

1. **Understanding the Problem:**
   We need to find the expected value of the smallest positive integer \( n \) such that \( f^{(n)}(1) = 1 \), where \( f \) is a randomly chosen bijection from the set \( S = \{1, 2, \ldots, 2016\} \) to itself. This \( n \) is the length of the cycle containing the element 1 in the permutation \( f \).

2. **Cycle Decomposition:**
   Any permutation of a finite set can be decomposed into disjoint cycles. The length of the cycle containing 1 is the smallest \( n \) such that \( f^{(n)}(1) = 1 \).

3. **Counting Bijections with a Given Cycle Length:**
   We need to count the number of permutations where the cycle containing 1 has length \( k \). For a cycle of length \( k \) containing 1, we can choose the remaining \( k-1 \) elements from the set \( \{2, 3, \ldots, 2016\} \) in \( \binom{2015}{k-1} \) ways. These \( k \) elements can be arranged in a cycle in \( (k-1)! \) ways (since there are \( k \) elements in the cycle, but we fix 1 in the first position to avoid overcounting cyclic permutations).

4. **Counting Remaining Elements:**
   The remaining \( 2016 - k \) elements can be permuted in any way, which gives us \( (2016 - k)! \) ways.

5. **Total Number of Bijections:**
   Therefore, the total number of permutations where the cycle containing 1 has length \( k \) is:
   \[
   \binom{2015}{k-1} (k-1)! (2016 - k)! = \frac{2015!}{(k-1)! (2016 - k)!} (k-1)! (2016 - k)! = 2015!
   \]
   This shows that the number of such permutations is independent of \( k \).

6. **Expected Value Calculation:**
   Since the number of permutations is the same for each \( k \), the length of the cycle containing 1 is uniformly distributed over the integers from 1 to 2016. The expected value of a uniformly distributed random variable over \( \{1, 2, \ldots, 2016\} \) is given by:
   \[
   \mathbb{E}(n) = \frac{1 + 2016}{2} = \frac{2017}{2}
   \]

The final answer is \(\boxed{\frac{2017}{2}}\).