The number of surjective functions from {2,4,6,8,.....2n} to {1,2} is
n
2n
22n−1
22n−2
Number of onto functions from A to B
=2C022n−2C1(2−1)2n+2C2(2−2)2n=22n−2