Sources: Wikipedia (CC BY-SA 4.0) ยท Simon Kuznets, national income accounting (public domain concepts)
GDP = C + I + G + NX. Four components, one number. It measures market activity, not welfare. Knowing what GDP misses is as important as knowing what it counts.
The expenditure identity
GDP sums all final spending in an economy. C = consumption (households), I = investment (business capital + housing + inventories), G = government purchases (not transfers), NX = net exports (exports minus imports). This is an accounting identity, not a theory. It holds by definition.
Scheme
; GDP = C + I + G + NX; US 2023 approximate values (trillions)
(define C 18.5) ; Consumption
(define I 4.9) ; Investment
(define G 4.6) ; Government
(define NX -0.8) ; Net exports (deficit)
(define GDP (+ C I G NX))
(display "C = $") (display C) (display "T") (newline)
(display "I = $") (display I) (display "T") (newline)
(display "G = $") (display G) (display "T") (newline)
(display "NX = $") (display NX) (display "T") (newline)
(display "GDP = $") (display GDP) (display "T") (newline)
; Shares
(display "C share: ") (display (round (* 100 (/ C GDP)))) (display "%") (newline)
(display "I share: ") (display (round (* 100 (/ I GDP)))) (display "%")
Python
# GDP = C + I + G + NX
C, I, G, NX = 18.5, 4.9, 4.6, -0.8
GDP = C + I + G + NX
for name, val in [("C", C), ("I", I), ("G", G), ("NX", NX)]:
print(str(name) + " = $" + str(val) + "T")
print("GDP = $" + str(GDP) + "T")
print("C share: " + str(round(C/GDP*100, 2)) + "%")
Nominal vs real GDP
Nominal GDP uses current prices. Real GDP adjusts for inflation by using constant base-year prices. The GDP deflator = (Nominal / Real) * 100. If nominal GDP rises 8% but the deflator rises 5%, real growth is roughly 3%. Without this adjustment, inflation masquerades as growth.
Scheme
; Nominal vs Real GDP; GDP deflator = (Nominal / Real) * 100
(define nominal-2020 21.0)
(define nominal-2023 27.4)
; If prices rose ~15% from 2020 to 2023
(define deflator-2023 115) ; base year 2020 = 100
(define real-2023 (* (/ nominal-2023 deflator-2023) 100))
(display "Nominal GDP 2023: $") (display nominal-2023) (display "T") (newline)
(display "GDP deflator: ") (display deflator-2023) (newline)
(display "Real GDP 2023 (2020 dollars): $")
(display (/ (round (* real-2023 10)) 10))
(display "T") (newline)
; Nominal growth vs real growth
(define nominal-growth (/ (- nominal-2023 nominal-2020) nominal-2020))
(define real-growth (/ (- real-2023 nominal-2020) nominal-2020))
(display "Nominal growth: ") (display (round (* 100 nominal-growth))) (display "%") (newline)
(display "Real growth: ") (display (round (* 100 real-growth))) (display "%")
What GDP misses
GDP counts market transactions. It misses inequality (a country can grow while most people stagnate), environmental damage (pollution increases GDP via cleanup spending), unpaid work (childcare, household labor), and leisure. A hurricane that destroys and rebuilds raises GDP. Kuznets himself warned against using his measure as a welfare indicator.
Scheme
; GDP per capita hides distribution; Two economies, same GDP per capita, different welfare
(define (gini-from-shares shares)
; Simplified: mean absolute difference / (2 * mean)
(let* ((n (length shares))
(mean (/ (apply + shares) n))
(pairs (apply append
(map (lambda (x)
(map (lambda (y) (abs (- x y))) shares))
shares)))
(mad (/ (apply + pairs) (* n n))))
(/ mad (* 2 mean))))
; Economy A: relatively equal
(define economy-a (list 4045505560))
; Economy B: very unequal
(define economy-b (list 10152030175))
(display "Economy A - GDP/capita: ")
(display (/ (apply + economy-a) (length economy-a))) (newline)
(display "Economy B - GDP/capita: ")
(display (/ (apply + economy-b) (length economy-b))) (newline)
(display "Economy A - Gini: ")
(display (/ (round (* 100 (gini-from-shares economy-a))) 100)) (newline)
(display "Economy B - Gini: ")
(display (/ (round (* 100 (gini-from-shares economy-b))) 100))