About the second, see you have four digits.
no repititions allowed..but there's no bar on number of digits..
So you can have numbers of one digit..which are 4P1..
Similarly for two,you have 4P2..
and so on,
so finally,you sum these four..you'll get 54 (as correctly shown by Decoder)