Then as the socks are drawn one by one from the draw it is possible that socks 1 and 2 match, socks 2 and 3 match, and so on, up to socks 2n - 1 and 2n. In all there are 2n - 1 possible pairs of consecutive socks whose colour could match.
In each consecutive pair once the colour of the first sock is known there is then a 1/(2n - 1) probability that the next sock with be the same colour, or in other words the mean expectation of the colours matching is 1/(2n - 1).
But this applies to all 2n - 1 pairs and by the principle known as linearity of expectation we can find the overall expectation simply by adding the 2n - 1 individual expectations. But (2n - 1) x 1/(2n - 1) = 1 and so we conclude the expected number of matches is 1, whatever the number of pairs of socks in the draw!
I wrote a Python program and ran it, and sure enough as predicted the result is always close to 1.
n = 20trials = 10000
sox = list(range(n)) * 2
matches = 0
import random
for i in range(trials):
random.shuffle(sox)
for j in range(2*n - 1):
if sox[j] == sox[j + 1]: # do socks match?
matches = matches +
print('Mean =', matches/trials)