PSYC 315 Lecture Notes - Lecture 8: Entire Function

18 views4 pages

Document Summary

Computes expected value of a decision by summing the products of outcome probabilities and values. (do ((p ps (cdr p)) (v vs (cdr v)) (sum 0 (+ sum (* (car p) (car v))))) ((null p) sum)) In the debugger ---------- : click on cancel, correct function (defun expected-value (ps vs) Computes expected value of a decision by summing the products of outcome probabilities and values. (do ((p ps (cdr p)) (v vs (cdr v)) (sum 0 (* (car p) (car v)))) ((null p) sum))) Psyc 315: computational psychology (expected-value-buggy (. 7 . 5 . 2) (. 6 . 3 . 7)) -> 0. 14. 2: buggy print sum (defun expected-value-buggy-print (ps vs) 0. 14: buggy2 (defun expected-value-buggy2 (ps vs) Computes expected value of a decision by summing the products of outcome probabilities and values. (do ((p ps (cdr p)) (v vs (cdr p)) (sum 0 (* (car p) (car v))))

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents