Question

# Let L be an SList. Define a recursive function Wham as follows. B. Suppose L = x. Then Wham(L) = x · x. R. Suppose L = (X, Y). Then Wham(L) = Wham(X)

Probability and combinatorics

Let L be an SList. Define a recursive function Wham as follows. B. Suppose L = x. Then Wham$$(L) = x \dot\mid x. R.$$ Suppose L = (X, Y). Then $$Wham(L) = Wham(X) + Wham(Y)$$. Evaluate Wham (2, 4), (7, 9) , showing all work.

2021-06-07

Given:
$$Wham(x)= x\times x$$
$$Wham(X,Y) = Wham(X)+ Wham(Y)$$
We need to evaluate $$Wham((2,4),(7,9)).$$

$$Wham(X,Y) = Wham(X)+ Wham(Y)$$
$$Wham((2,4), (7,9)) = Wham(2,4) + Wham(7,9)$$
$$Wham(X,Y) = Wham(X)+ Wham(Y) = Wham(2)+ Wham(4) + Wham(7)+ Wham(9)$$
$$Wham(z) = x\times x =\displaystyle{2}\cdot{2}+{4}\cdot{4}+{7}\cdot{7}+{9}\cdot{9} =4+16+49+81 =150$$