(a) Find the numbers $a_0,. . . , a_{100}$, such that $a_0 = 0, a_{100} = 1$ and for all $k = 1,. . . , 99$ :  
$$a_k = \frac12 a_{k- 1} + \frac12 a_{k+1 }$$
(b) Find the numbers $a_0,. . . , a_{100}$, such that  $a_0 = 0, a_{100} = 1$ and for all $k = 1,. . . , 99$ :  
$$a_k = 1+\frac12 a_{k- 1} + \frac12 a_{k+1 }$$.
### Part (a)

We are given the recurrence relation:
\[ a_k = \frac{1}{2} a_{k-1} + \frac{1}{2} a_{k+1} \]
with boundary conditions:
\[ a_0 = 0 \quad \text{and} \quad a_{100} = 1 \]

1. **Form the characteristic equation:**
   \[ 2a_k = a_{k-1} + a_{k+1} \]
   Assume a solution of the form \( a_k = t^k \). Substituting into the recurrence relation, we get:
   \[ 2t^k = t^{k-1} + t^{k+1} \]
   Dividing through by \( t^{k-1} \), we obtain:
   \[ 2t = 1 + t^2 \]
   Rearranging, we get the characteristic polynomial:
   \[ t^2 - 2t + 1 = 0 \]
   This factors as:
   \[ (t-1)^2 = 0 \]
   Thus, the only root is \( t = 1 \).

2. **General solution:**
   Since \( t = 1 \) is a repeated root, the general solution to the recurrence relation is:
   \[ a_k = A + Bk \]

3. **Apply boundary conditions:**
   - For \( k = 0 \):
     \[ a_0 = A + B \cdot 0 = A = 0 \]
   - For \( k = 100 \):
     \[ a_{100} = A + B \cdot 100 = 0 + 100B = 1 \]
     Solving for \( B \):
     \[ B = \frac{1}{100} \]

4. **Final solution:**
   \[ a_k = \frac{k}{100} \]

### Part (b)

We are given the recurrence relation:
\[ a_k = 1 + \frac{1}{2} a_{k-1} + \frac{1}{2} a_{k+1} \]
with boundary conditions:
\[ a_0 = 0 \quad \text{and} \quad a_{100} = 1 \]

1. **Rewrite the recurrence relation:**
   \[ 2a_k = 2 + a_{k-1} + a_{k+1} \]
   \[ 2a_{k+1} = 2 + a_k + a_{k+2} \]

2. **Subtract the two equations:**
   \[ 2a_{k+1} - 2a_k = a_k + a_{k+2} - a_{k-1} - a_{k+1} \]
   Simplifying, we get:
   \[ 3a_{k+1} - 3a_k = a_{k+2} - a_{k-1} \]

3. **Form the characteristic equation:**
   Assume a solution of the form \( a_k = t^k \). Substituting into the recurrence relation, we get:
   \[ 3t^{k+1} - 3t^k = t^{k+2} - t^{k-1} \]
   Dividing through by \( t^{k-1} \), we obtain:
   \[ 3t^2 - 3t = t^3 - 1 \]
   Rearranging, we get the characteristic polynomial:
   \[ t^3 - 3t^2 + 3t - 1 = 0 \]
   This factors as:
   \[ (t-1)^3 = 0 \]
   Thus, the only root is \( t = 1 \).

4. **General solution:**
   Since \( t = 1 \) is a triple root, the general solution to the recurrence relation is:
   \[ a_k = A + Bk + Ck^2 \]

5. **Apply boundary conditions:**
   - For \( k = 0 \):
     \[ a_0 = A + B \cdot 0 + C \cdot 0^2 = A = 0 \]
   - For \( k = 100 \):
     \[ a_{100} = A + B \cdot 100 + C \cdot 100^2 = 0 + 100B + 10000C = 1 \]

6. **Determine coefficients:**
   Substitute \( A = 0 \) into the recurrence relation:
   \[ 2a_{k+1} = 2 + a_k + a_{k+2} \]
   \[ 2(B(k+1) + C(k+1)^2) = 2 + (Bk + Ck^2) + (B(k+2) + C(k+2)^2) \]
   Simplifying, we get:
   \[ 2Bk + 2B + 2Ck^2 + 4Ck + 2C = 2 + Bk + Ck^2 + 2B + 4Ck + 4C \]
   \[ 2Ck^2 + 2Bk + 2B + 2C = Ck^2 + Bk + 2B + 4Ck + 4C + 2 \]
   Equating coefficients, we get:
   \[ 2C = C \quad \text{(true for any C)} \]
   \[ 2B = B + 4C \]
   \[ 2B = B + 4C \implies B = 4C \]
   \[ 2B + 2C = 2 + 4C \implies 2B = 2 \implies B = 1 \]
   \[ B = 4C \implies 1 = 4C \implies C = \frac{1}{4} \]

7. **Final solution:**
   \[ a_k = \frac{1}{4}k^2 + k \]

The final answer is \( \boxed{ a_k = \frac{k}{100} } \) for part (a) and \( a_k = \frac{1}{4}k^2 + k \) for part (b).