# Programming answers to 1.1

```
gdp1<- 50*4+100*3
# the same as above: 50*4+100*3 -> gdp1
gdp2<- 100*6+60*6
```

The nominal gdp in year 1 is 500, and the nominal gdp in year 2 is 960.

```
# base year is 1
# we have to fix prices in year 1
px<-4
py<-3
real_gdp1.1<- 50*px+100*py
real_gdp2.1<- 100*px+60*py
```

Under year 1 base, the real gdp in year 1 is 500, and in year 2 is 580.

```
# base year is 2
# we have to fix prices in year 2
px<-6
py<-6
real_gdp1.2<- 50*px+100*py
real_gdp2.2<- 100*px+60*py
```

Under year 2 base, the real gdp in year 1 is 900, and in year 2 is 960.

- The chained-dollar real gdp reflects the idea that the “authentic” growth should lie somewhere between the two grow rates based on two consecutive base years.

```
real_growth_base1<-real_gdp2.1/real_gdp1.1
real_growth_base2<-real_gdp2.2/real_gdp1.2
real_chained_growth<- sqrt(real_growth_base1*
real_growth_base2)
```

The chained-dollar real gdp growth is 1.1123549 (i.e. the “authentic” growth).

```
chained_real_gdp1<-gdp1
chained_real_gdp2<-chained_real_gdp1*real_chained_growth
```

If we choose year 1 to be the reference or base year, then real gdp in year 1 will be the same as its nominal gdp, which is 500. Therefore, the chained-dollar real gdp in year 2 will be that value times 1.1123549 which is 556.1774297.

For year 3, if qx=80 px=7 and qy=70 py=8.

```
px<-6
py<-6
real_gdp2.2<- 100*px+60*py
real_gdp3.2<- 80*px+70*py
px<-7
py<-8
real_gdp2.3<- 100*px+60*py
real_gdp3.3<- 80*px+70*py
real_growth_base2<-real_gdp3.2/real_gdp2.2
real_growth_base3<-real_gdp3.3/real_gdp2.3
real_chained_growth2.3<- sqrt(real_growth_base2*
real_growth_base3)
chained_real_gdp3<-chained_real_gdp2*real_chained_growth2.3
```

The chained growth between year 2 and year 3 is 0.9433083. Therefore, the chained-dollar real gdp in year 3 is 524.6467738.