Counting can be done using number of methods like Permutation, combination, factorization etc.
Let us consider an example of round table, which is a very famous question of permutation in mathematics.

Q. In how many ways 6 girls and 6 boys sit around in a Circle such that no girl is adjacent to each other?
Solution: According to problem, repetition of girls and boys in the complete arrangement is not possible because one boy or one girl can acquire one seat at a time. Also there is one more restriction in the problem that no two girls can sit adjacent to each other. This makes it necessary for each girl to be between two boys or adjacent to only one boy. We have to make 6 boys and 6 girls sit in a circle. Number of ways for this arrangement can be calculated as follows:

 6 boys 6 girls 5 boys 5 girls 4 boys 4 girls 3 boys 3 girls 2 boys 2 girls 1 boys 1 girls

Arrangement being circular, we can start the sitting arranging from any Position such that we can make either a girl sit first or a boy sit first. Whosoever is made to sit at first, we would be getting the same arrangement as shown above. Here, the first position can be filled in 6 ways i.e. we have to make 1 boy sit out of available 6. Next position has to be filled by a girl according to the restriction that has been imposed on the problem. This place can also be filled in 6 possible ways. Next two places also have to be filled like previous two but by deduction of boy and one girl have to be made. This way we can arrange 6 boys an 6 girls in a circle, getting the total number of ways = 6!2.