Originally I was just going to ask the problem on my practice math contest, which is asking how many ways there are to write a nine-digit number containing each digit 1-9 so that the first digit is twice as big as the second and the last two digits are odd. (e.g. 846527913).
I understood that in this case, the number would be in the form of EE(EEEOO)OO or EO(EEOOO)OO where E is an even, O is an odd, the numbers in the parentheses can be ordered in any way, and the only four cases for the first two are 21, 42, 63, and 84. Calculating this gave me 240, which is definitely wrong (I made a program to check, and it says 7680).
So here are the questions:
1) How do I solve this particular problem correctly? Am I on the right track?
2) How are these solved in general? Given that it's a 9 digit number and each digit 1-9 is used once, how does one handle constraints such as these? This has always confused me (I'm not very strong in combinatorics)