s3a said:
Thanks, D H.
Please confirm that the following update is correct (where the updated stuff are bolded).:
For P = 0:
The set of polynomials for which P = 0 is undefined. (Am I using correct terminology here?)
That's what I used. If you allow leading zeros and count this as part of the polynomial, you'll run into a big problem with P=0. There's one such polynomial, 0. Here's the problem: 0=0 is a tautology. Pi and e are solutions to 0=0. All numbers, algebraic and non-algebraic, are solutions to 0=0.
The easy way around this problem is to say the leading coefficient must be non-zero. Whether you want to say {p|P(p)=0} is empty or undefined depends on how you look at things.
For P = 1:
The set of polynomials for which P = 1 is defined but empty. (Am I using correct terminology here?)
There's an issue here. The polynomials p(x)=1 and p(x)=-1 satisfy the condition P(p)=1. However, 1=0 and -1=0 are contradictions. If you're looking at things from the perspective of {p|P(p)=1}, the cardinality of that set is 2. If you're looking at things from the perspective of polynomials p(x) that do have solution to p(x)=1, the cardinality becomes zero.
Looks good.
For P = 4:
x + 2 = 0
–x + 2 = 0
x – 2 = 0
–x – 2 = 0
2x + 1 = 0
–2x + 1 = 0
2x – 1 = 0
–2x – 1 = 0
x^2 + 1 = 0
–x^2 + 1 = 0
x^2 – 1 = 0
–x^2 – 1 = 0
x^3 = 0
–x^3 = 0
2x^2 = 0
–2x^2 = 0
3x = 0
–3x = 0
There are only 18 polynomials there. You should have 22. You missed the four polynomials along the lines of x^2+x.
Note: My count of 22 excludes the polynomials p(x)=4 and p(x)=-4. Both of these do have a characteristic P=4, but setting p(x)=0 results in a contradiction. I didn't count those contradictions. There's no problem with counting them. You'll just get a different result. The end result will still be the same: You can map a polynomial to a unique integer. The set of polynomials is countable, and (with a bit more work), the set of algebraic numbers is countable.
It helps, a lot, to develop an algorithm to generate those polynomials. In fact, you don't have to generate all of them to count them. There are two polynomials of the form x^2: x^2 and -x^2. There are four of the form x^2+x: x^2+x, x^2-x, -x^2+x, and -x^2-x. Once you get to P=5, you'll start running into polynomials such as x^2+x+1. There are eight polynomials of this form. With P=7, you'll run into polynomials of the form x^3+x^2+x+1. There are 16 of these critters.
Rhetorical question: Do you need to generate all of them? The answer is no. You just need to know that x^2+x+1 represents eight polynomials. You don't even need to explicitly generate the polynomial x^2+x+1. All that's needed is the coefficient list, (1,1,1). It's much easier to come up with an algorithm when you cast away the x, x^2, x^3, etc and just work with the coefficient list.