consider the number of permutations of the letter in the word appil.

1. in how many ways can you arrange all of the letters?
2. in how many ways can you arrange three of the letters?

5 letters, 2 p's, so

#1. 5!/2!
#2. There are 5C3 ways to pick the letters
3 of those have 2 p's.
So, 3*3!/2! + (5C3-4)*3!