the security gate at a storage facility requires a 4 - digit lock code . if the lock code must consist only of digits from 1 through 7 , inclusive , with no repeated digits , and the first and last digits of the code must be odd , how many lock codes are possible ?
x - x - x - x - x - - > there are 4 odd digits from 1 to 7 , inclusive thus options for the first and the last x ' s are : 4 - x - x - 3 . other x ' s can take following values : 4 - 5 - 4 - 3 - - > 4 * 5 * 4 * 3 = 240 . answer : b .
multiply(multiply(4, const_3), divide(factorial(add(4, const_1)), factorial(const_3)))