I checked out some of these smaller cases, and the formula ever works in the event of ALLL, where there are no cases excluded. Here we have 4!/3! = 4, and actually 3!-2! = 4, the correct answer. I rewrite the problem as AuL, where u=LL, and further rewrite it as As, where s=LLL.
In AALLL, there are 5!/(2!3!) = 10 and the only excluded case is LALAL, so there are 9 cases involved. Using the formula: 4!/(2!)-3!/(2!) = 9, the correct answer. Now if we change that to ABLLL, lacking a double term in A, we have now 20 cases with 2 excluded, so correct anwer is 18. Changing this to ABuL, and ABs, and using formula, we get correct answer: 4!-3! = 24-6 = 18.
Take the case of BAALLL, equal 60 cases. Here we can put the two A's in the middle and have BLALAL, and move the B into anyone of the five other places giving 6 excluded cases. But in the form ALBLAL, we get only three new cases, ALBLAL, LBLAAL, LBLALA and similarly if we exchange the B for the other internal A, ALALBL, LAALBL, LALBLA. So 48 is the right answer. 5!/2-4!/2 = (120-24)/2 = 48.