Ok, you can solve all this stuff even you don't know any formulae.
First case : [1 , 1 , 3 ]
1 : balls and boxes are different
let B1 , B2 , B3 be boxes , and b1,b2,b3,b4,b5 be balls
Now you put three balls either in B1 or in B2 or in B3
In B1 then, left two balls be x and y ,then you may put x into B2 and y into B3 or x into B3 and y into B2
In B2 then, left two balls be x and y ,then you may put x into B1 and y into B3 or x into B3 and y into B1
In B3 then, left two balls be x and y ,then you may put x into B1 and y into B2 or x into B2 and y into B1
6 cases , Now you can select three balls out of 5 in , C( 5 , 3 ) : 10 ways.
Total ways : 6 * 10 : 60
2 : Boxes are same , balls are different
Now you have no choice for boxes , because they are same, only you can focus on balls , either you put three balls in first box
or second or third , and left two balls in left two boxes , all may be same , (because boxes are same )
Hence you have to consider only one case : Put three balls in one and left two balls in left two boxes.
Now you can select three balls out of 5 in , C( 5 , 3 ) : 10 ways
Number of ways to distribute [1 ,1 , 3 ] in same boxes : 10.
This same technique can be used for second example also , You can try out yourself.