# By Philip J. McDonnell
# Problem 1
# Kahnemann Tversky Problem A
xa<-c(2500,2400,0)
pa<-c(.33,.66,.01)
w<-100
u<-log((xa+w)/w)
sum(pa*u)
[1] 3.19963
>
# Kahnemann Tversky Problem B
xa<-c(2400)
pa<-c(1)
w<-100
u<-log((xa+w)/w)
sum(pa*u)
[1] 3.218876
>
# Problem 3 Original
# Kahnemann Tversky Problem A
xa<-c(4000,0)
pa<-c(.80,.20)
w<-100
u<-log((xa+w)/w)
sum(pa*u)
[1] 2.970858
>
# Kahnemann Tversky Problem B
xa<-c(3000)
pa<-c(1)
w<-100
u<-log((xa+w)/w)
sum(pa*u)
[1] 3.433987
>
# Problem 3 with set point at 3100
# Kahnemann Tversky Problem A
xa<-c(900,-3000)
pa<-c(.80,.20)
w<-3100
u<-log((xa+w)/w)
sum(pa*u)
[1] -0.4828836
>
# Kahnemann Tversky Problem B
xa<-c(0)
pa<-c(1)
w<-100
u<-log((xa+w)/w)
sum(pa*u)
[1] 0
>
# Problem 4
# Kahnemann Tversky Problem C
xa<-c(4000,0)
pa<-c(.80,.20)
w<-100
u<-log((xa+w)/w)
sum(pa*u)
[1] 2.970858
>
# Kahnemann Tversky Problem D
xa<-c(3000,0)
pa<-c(.25,.75,)
w<-100
u<-log((xa+w)/w)
sum(pa*u)
[1] 0.8584968