Hi all,

I have a couple of questions regarding counting, so it will be fantastic if you can help me out. Thanks in advance!

Qns 1:

Consider strings of length n over the set {a,b,c,d}. How many such strings contain at least one pair of adjacent characters that are the same?

My comments:

By adjacent do they mean (a,b) in length n, etc? Is the combination (b,a) allowed or equivalent to (a,b)?

Qns 2:

How many integers from 1 through 999999 contain each of the digits 1,2 and 3 at least once? (Hint: For each i let be the set of integers from 1 through 999999 that do not contain the digit i)

My comments:

The solution asked me to use the inclusion and exclusion method, so how do i know when to use this?

Qns 3:

If where are distinct primes, in how many ways can n be expressed as a product of 2 positive integers? (n=ab and n=ba are considered the same)

What is the answer if ?

My comments:

From the solution, they mentioned the number of ways to choose a is which i understand. It is stated that "it is a duplication by a factor of 2 since and both appear as subsets but they give the same factorisation". I do not understand where the duplication is, can somehow show me an example?