substitutionModel

# substitutionModel - Part 1 Solution let initial x = 0 in...

This preview shows pages 1–4. Sign up to view the full content.

Sheet1 Page 1 Part 1 Solution ------------------------------------------------- let initial x = 0 in let rec zardoz (f1, lst) = match lst with [] -> 3110 | h :: t -> let f x = h * List.length lst in if List.length t = 0 then f1 0 else zardoz (f, t) + f 0 in zardoz (initial, [14 ------------------------------------------------- let rec zardoz (f1, lst) = match lst with [] -> 3110 | h :: t -> let f x = h * List.length lst in if List.length t = 0 then f1 0 else zardoz (f, t) + f 0 in zardoz (fun x -> 0, [14 ------------------------------------------------- match [14 [] -> 3110 | h :: t -> let f x = h * List.length [14 if List.length t = 0 then (fun x -> 0) 0 else zardoz (f, t) + f 0 ------------------------------------------------- let f x = 14 * List.length [14 if List.length [0 else zardoz (f, [0 ------------------------------------------------- if List.length [0 else zardoz (fun x -> 14 * List.length [14 + (fun x -> 14 * List.length [14 ------------------------------------------------- zardoz (fun x -> 14 * List.length [14 + (fun x -> 14 * List.length [14 ------------------------------------------------- match [0 [] -> 3110 | h :: t -> let f x = h * List.length [0 if List.length t = 0 then (fun x -> 14 * List.length [14 else zardoz (f, t) + f 0 + (fun x -> 14 * List.length [14 ------------------------------------------------- let f x = 0 * List.length [0 if List.length [0] = 0 then (fun x -> 14 * List.length [14

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Sheet1 Page 2 else zardoz (f, [0]) + f 0 + (fun x -> 14 * List.length [14 ------------------------------------------------- if List.length [0] = 0 then (fun x -> 14 * List.length [14 else zardoz (fun x -> 0 * List.length [0 + (fun x -> 14 * List.length [14 ------------------------------------------------- zardoz (fun x -> 0 * List.length [0

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern