Answer:
F# Code:
let rec prefix n list =
//Extracting head and tail elements
let valHead = (Listhead list)
let valTail = (Listtail list)
// Checking n value
match n with
| 0 -> []
| _ -> [valHead] at (prefix (n-1) valTail) // Creating list recursively
//Testing function
let lstT = [1; 2; 3; 4; 5]
printfn "%A" (prefix 3 lstT)
printfn "%A" (prefix 2 lstT)
printfn "%A" (prefix 4 lstT)
Step-by-step explanation: see attachment below for sample run
Answer:
12 years
Step-by-step explanation:
Given that Mr. Hon purchases a new car every 4 years. Ms. Jasper purchases a new car every 6 years.
Assuming that they purchase new cars together after n years.
So, n must a multiple of 4 as well as multiple 6, i.e the number n is the lowest multiple (LCM) of 4 and 6.
As LCM od 4 and 6 is 12, so n=12.
Hence, after 12 years they will purchase news cars together.
Answer:
Step-by-step explanation:
A solution is any value of a variable that makes the specified equation true. A solution set is the set of all variables that makes the equation true. The solution set of 2y + 6 = 14 is {4}, because 2(4) + 6 = 14.
Answer:
f(n)=4n-1
Step-by-step explanation:
have a great day
4x - y = 61
2y = x
substitute x = 2y in first equaation:-
4(2y) - y = 61
7y = 61
y = 61/7
so x = 2 * 61/7 = 122/7
y = 8 5/7 and x = 17 3/7