[1] 8 8 5 5 6 2 4 5 7 6 1 10 10 4 2
[1] 8 6 8 2 10 9 7 9 7 2 2 4 2 1 1
2025-04-29
Graded: homework 11 (functions - really: lists)
Today: last edits for scripts
Thursday: submit your screencast
no required attendance in class on Thursday (May 1)
For each of the Things you defined, write out at least three paragraphs:
Make sure to:
are the extension of vector calculus
[1] 8 8 5 5 6 2 4 5 7 6 1 10 10 4 2
[1] 8 6 8 2 10 9 7 9 7 2 2 4 2 1 1
Add the first element in x
to the first element in y
:
Now do that for all elements in x
and y
:
[1] 16 14 13 7 16 11 11 14 14 8 3 14 12 5 3
Plot the graph of the function for \(\alpha = \beta = 1/2\) on the interval [0,1]:
\[
f(x) = \frac{1}{B(\alpha, \beta)} x^{\alpha -1} (1 - x)^{\beta - 1}
\] \(B(\alpha, \beta)\) is the beta function - a generalization of the (inverse) binomial coefficient. Implemented as beta(a, b)
in R, in python use math.gamma
and the relationship to the Gamma function \(\Gamma\):
\[ B(a, b) = \frac{\Gamma(a)\Gamma(b)}{\Gamma(a + b)} \]
Now make \(\alpha\) a vector alpha
and plot graphs for values of \(\alpha \in \{ 0.5, 0.6, ..., 1.2\}\)
… can you vectorize \(\beta\) similarly?