If five squares of a $3 \times 3$ board initially colored white are chosen at random and blackened, what is the expected number of edges between two squares of the same color?

1. **Identify the total number of pairs of adjacent squares:**
   - A $3 \times 3$ board has 9 squares.
   - Each square has up to 4 neighbors, but we must avoid double-counting.
   - There are 6 horizontal pairs and 6 vertical pairs, making a total of 12 pairs of adjacent squares.

2. **Calculate the probability that two adjacent squares are the same color:**
   - There are $\binom{9}{5}$ ways to choose 5 squares out of 9 to blacken.
   - For any two adjacent squares to both remain white, we need to choose 5 squares from the remaining 7 squares:
     \[
     P(\text{both white}) = \frac{\binom{7}{5}}{\binom{9}{5}} = \frac{21}{126} = \frac{1}{6}
     \]
   - For any two adjacent squares to both be black, we need to choose 3 squares from the remaining 7 squares:
     \[
     P(\text{both black}) = \frac{\binom{7}{3}}{\binom{9}{5}} = \frac{35}{126} = \frac{5}{18}
     \]
   - The total probability that two adjacent squares are the same color is the sum of these probabilities:
     \[
     P(\text{same color}) = \frac{1}{6} + \frac{5}{18} = \frac{3}{18} + \frac{5}{18} = \frac{8}{18} = \frac{4}{9}
     \]

3. **Apply the Linearity of Expectation:**
   - The expected number of edges between two squares of the same color is the total number of pairs of adjacent squares multiplied by the probability that a pair is the same color:
     \[
     E(\text{same color edges}) = 12 \cdot \frac{4}{9} = \frac{48}{9} = \frac{16}{3}
     \]

The final answer is $\boxed{\frac{16}{3}}$