The number of values of a system that varies independently is called as degrees of freedom (DOF). A test used for comparison of two means is t-test in statistics. The formula to find the degrees of freedom varies dependent on the type of test. For a one sample T test, DOF is the number of values in sequence 1 minus one.
For a two tailed test, both the sequences (1 and 2) are considered. DOF is the sum of the number of values in both the sequences minus one.