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
ANSWERED
asked 2021-06-06

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.

Answers (1)

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\)

0
 
Best answer

expert advice

Have a similar question?
We can deal with it in 3 hours
...