TITLE: Combination of a 4-digit number
QUESTION [8 upvotes]: How many 4-digit numbers ($0000-9999$; including $0000$ and $9999$) can be formed in which the sum of first two digits  is equal to the sum of last two digits?
Assumption : every number is valid even if it starts with a zero.
For ex: $1230, 0211, 4233$ and so on...

REPLY [2 votes]: The map $(a,b,c,d)\longleftrightarrow (a,b,9-c,9-d)$ puts the desired 
4 digit numbers in a one-to-one correspondence with four digit numbers
whose digits add up to 18. This set can be counted with "stars and bars" plus
the inclusion-exclusion principle to give 
$${21\choose 3}-{4\choose 1}{11\choose 3}=670.$$