1A. The geometric series says f(x) = sum_n (x+x^2+x^3)^n. Each of those summands is a polynomial with positive coefficients, so when they're added together the result has positive coefficients.
The homework problem this is closest to is the stamp problem. In those terms, we're trying to get n cents postage, using a bunch of 1,2,3 cent stamps in any order (and order matters). Thought of that way, the ways to get such postage break three cases, based on the last stamp. That gives us the recurrence
(You can also get this from the equation f(x) = 1 + (x+x^2+x^3)f(x) and comparing coefficients.)
Can you find two functions f,g from Y -> X, not equal, such that f o Doub = g o Doub? (These are functions X->X.)
Can you find two functions f,g from Y -> X, not equal, such that Doub o f = Doub o g? (These are functions Y->Y.)
If you can, give an explicit example of an f and a g.
2A. Well, yes and no. That is to say, yes, and no. Here's a hint: f o Doub = g o Doub is really three equations, f(Doub(n)) = g(Doub(n)), n=1,2,3. That's not enough to determine a function from Y->X, which is six choices.
But we can (and must) be more specific. For the first one, let f:Y->X take everybody to 1, whereas g:Y->X takes even numbers (the image of Doub) to 1 -- this is what the equations tell us must be true -- and does something else with the odd numbers. For example, maybe g(1)=1, g(3)=3, g(5)=1.
(For the "no" part, if two numbers are equal after they're doubled, then they were already equal. So Doub(f(n)) = Doub(g(n)) implies f(n)=g(n).)
3A. Let's rewrite as "Is h(x)-1 = O(1)?" and so on.
Then h(x)-1 = f(1/x) - 1 = 1/(1 - 1/x - 1/x^2 - 1/x^3) - 1
= (1/x + 1/x^2 + 1/x^3) / (1 - 1/x - 1/x^2 - 1/x^3).
At this point you can take the biggest terms in the top (that's 1/x)
and in the bottom (that's 1) to say this is O(1/x), but not O(1/x^2).
If you don't like that, multiply top and bottom by x^3 and do it then.
4a. How many functions, indeed. n^m.
4b. These fs are determined by their images, which are m-element
subsets of Y. So (n choose m).
4c. These fs are determined by their images-plus-multiplicities, i.e.
for each element of Y we keep track not only of whether it's
hit but how many times. The total number of hits is m,
so it's a stars-and-bars question, with m stars and n-1 bars.
Therefore we get (m + n-1 choose m).
4d. All the strongly order-preservings are 1:1. So this is
just (n choose m) again.
4e. This is the number of 1:1s, which we counted to be (n choose m)m!
early in the class, minus the number of 1:1 and strongly order-preservings,
so it's (n choose m)(m! - 1).
4f. Zero.
4g. This is (4c) - (4b), since weakly order-preserving and 1:1 is
exactly strongly order-preserving.
If you're only told h, how many possibilities are there for f? How many for g? How many for the pair (f,g)?
5A.
6A. Let's warm up by thinking about the easier cases, n & n, or n & n-1.
If |Q|=n, then we're just thinking about permutations -- n!.
If |Q|=n-1, then somebody in Q is being hit twice. There's (n-1) possibilities for who it might be. Once we know that, let's ask which two elements in P are hitting that guy. That's (n choose 2) possibilities. With them out of the way we're back to corresponding the remaining n-2 elements of each set. So in all it's (n-1) (n choose 2) (n-2)!.
Now for |Q|=n-2. These maps fail to be 1:1 in two different ways, from the extra two elements: we could get two elements of Q with two preimages each, or one guy with a full three preimages.
Let's do the three preimages case first. Following the previous analysis, it's (n-2) (n choose 3) (n-3)!.
For the two guys with two preimages each, we first pick the two guys: that's (n-2 choose 2). Then we pick the preimages of one: that's (n choose 2). Then of the other: that's (n-2 choose 2), since they can't overlap. Then we correspond the remaining n-4. So it's (n-2 choose 2) (n choose 2) (n-2 choose 2) (n-4)!.
For all the ontos, we add these two numbers.
7A. 2 = 35 + (-33).
8A. If p and q are odd, then p+q is even. So it's not prime (since it's
not 2). So for the first part, we find out that p is 2.
For the second, look at q-2, q, q+2 mod 3. One of them is congruent to 0
mod 3. For it to be prime, it's gotta be 3. That leaves the possibilities
of -1,1,3 or 1,3,5 or 3,5,7, and only the third one works.
For example, 3^2 = 2^3 + 1 since 9 = 8+1.
9A. Again, if p and q are both odd, then so are their powers, and this can't happen. So one of them must be even, hence 2. This is all I was expecting for this one.
Hard theorem: in this case the exponent on the other number is 1.
Not so hard: if we're looking at p = 2^n + 1, then n itself has to be a power of 2. (Not every power works: actually, it's conjectured that only n=0,1,2,3,4 work.) These are "Fermat primes."
Also not so bad: if we're looking at q = 2^n - 1, then n itself has to be prime. These are "Mersenne primes" (lots more about them if you follow the link).