First of all, there are two shirts, that is, there are two choices, and there are two shorts, so there are 2×2=4 schemes for matching shirts and shorts. Furthermore, there are two pairs of socks and two choices. Then there are 2×2×2=8 schemes for matching shirts, shorts and socks.
This kind of problem is a typical permutation and combination problem in mathematics field.
Extended data
Permutation and combination is the most basic concept of combinatorics. The central problem of permutation and combination is to study the total number of possible situations in a given permutation and combination. The so-called arrangement means that any M (m ≤ n, m and n are natural numbers, the same below) elements are arranged in a column according to a certain order, that is to say, a specified number of elements are taken out from a given number of elements for sorting. Combination refers to taking out only a specified number of elements from a given number of elements, regardless of sorting.
Baidu encyclopedia-permutation and combination