From theory to hypothesis testing is that relating to the actual frequency is equal to the frequency expected from theory that can be applied to samples from 1 or more groups.
From theory to test the hypothesis that the actual frequency equal to the frequency expected from theory. Which can be used to sample from one or more groups.
From the theory, it is to test the hypothesis that the actual frequency equal to the frequency expected from theory. Which can be used to sample from the 1 group up.