# Search

## mathematics

### (10 points)2. Series 31. Year - P. ooh Oganesson

What properties does the $118^{\rm th}$ element in the Periodic table have? Alternatively, what sort of properties would it have, had it been stable? Discuss at least three physical qualities.

Karel wanted to have something on extrapolation.

### (10 points)2. Series 31. Year - S. derivatives and Monte Carlo integration

1. Plot the error as a function of step size for the method $\begin{equation*} f'(x)\approx \frac {-f(x+2h)+f(x-2h)+8f(x+h)-8f(x-h)}{12h} \end {equation*}$ derived using Richardson extrapolation. What are the optimal step size and minimum error? Compare with forward and central differences. Use $\exp (\sin (x))$ at $x=1$ as the function you are differentiating.
Bonus: Use error estimate to determine the theoretical optimal step size.
2. There is a file with experimentally determined $t$, $x$ and $y$ coordinates of a point mass on the website. Using numerical differentiation, find the time dependence of components of speed and acceleration and plot both functions. What is the most likely physical process behind this movement? Choose your own numerical method but justify your choice.
Bonus: Is there a better method for obtaining velocity and acceleration, then direct application of numerical differentiation?
3. We have an integral $\int _0^{\pi } \sin ^2 x \d x$.
1. Find the value of the integral from a geometrical construction using Pythagoras theorem.
2. Find the value of the integral using a Monte Carlo simulation. Determine the standard deviation.
Bonus: Solve the Buffon's needle problem (an estimate of the value of $\pi$) using MC simulation.
4. Find the formula for the volume of a six-dimensional sphere using Monte Carlo method.
Hint: You can use the Pythagoras theorem to measure distances even in higher dimensions.

Mirek and Lukáš read the Python documentation.

### (10 points)1. Series 31. Year - S. Taking Off

1. Modify the expression $\sqrt {x+1}-\sqrt {x}$, so that it isn't so prone to the problems of cancellation, ordering and smearing. Which of these problems would have originally caused a trouble with the expression and why? What is the difference between the original and the corrected expression when we evaluate it using double precision with $x=1{,}0 \cdot 10^{10}$?
2. Describe the effects of the following code. What is the difference between the functions \texttt {a()} and \texttt {b()}? With which values of \texttt {x} can they be evaluated? Don't be afraid to run the code and play with different values of the variable \texttt {x}. What is the asymptotic computation time complexity as a function of the variable x.
def a(n):
if n == 0:
return 1
else:
return n*a(n-1)
def b(n):
if n == 0:
return 1.0
else:
return n*b(n-1)
x=10
print("{} {} {}".format(x, a(x), b(x)))
3. Let's designate $o_k$ and $O_k$ as the circumference of a regular $k$sided polygon inscribed and circumscribed respectively in a circle. The following recurrent relationships then apply $\begin{equation*} O_{2k}=\frac {2o_k O_k}{o_k + O_k} ,\; o_{2k}=\sqrt {o_k O_{2k}} . \end {equation*}$ Write a program that can calculate the value of $\pi$ using these relations. Start with an inscribed and a circumscribed square. How accurately can you approximate $\pi$ using this method? (A similar method has been originally used by Archimedes for this purpose.)

4. Lukas and Mirek play a game. They toss a fair coin: when it's tails (reverse) Mirek gives Lukas one Fykos t-shirt when it's heads (obverse) Lukas gives one to Mirek. Together they have $t$ t-shirts of which $l$ belongs to Lukas and $m$ to Mirek. When one of them runs out of t-shirts the game ends.
1. Let $m = 3$ and Lukas's supply be infinite. Determine the most probable length of the game, i.e. the number of tosses after which the game ends (because Mirek runs out of t-shirts).
2. Let $m = 10$, $l = 20$. Simulate the game using pseudorandom number generator and find the probability of Mirek winning all of Lukas's t-shirts. Use at least 100 games (more games means more precise answer).
3. How will the result of the previous task change in case Mirek „improves“ the coin and heads now occur with the probability of $5/9$?
Bonus: Calculate the probability analytically and compare the result with the simulation.
5. Consider a linear congruential generator with parameters $a = 65 539$, $m = 2^{31}$, $c = 0$.
1. Generate at least $1 000$ numbers and determine their mean and variance. Compare it to the mean and variance of a uniform distribution over the same interval.
2. Find the relationship that gives the next number in the generated sequence as a linear combination of the two preceding numbers. I.e. find the coefficients $A$, $B$ in the recurrence relationship $x_{k+2} = Ax_{k+1} + Bx_k$. If we consider each three sequential numbers as the coordinates of a point in 3D, how does the recurrence relationship influence the spatial distribution of these points?
Bonus: Generate a sequence of at least $10 000$ numbers and plot the points on a 3D graph that will illustrate the significance of the given recurrence relationship.

Mirek and Lukas dusted off some old textbooks.

### (8 points)0. Series 31. Year - 5.

We are sorry. This type of task is not translated to English.

### (10 points)6. Series 30. Year - S. nonlinear

1. Try to describe in your own words how and for what purpose nonlinear regression is used (it is sufficient to briefly describe the following: model of nonlinear regression, methods for finding regression coefficients, uncertainties in the determination of regression coefficients, uncertainties in the function being fitted, statistic methods for testing the values of the regression coefficients, how to choose the form of the fitting function). It’s not necessary to describe the concepts mathematically, a brief description in your own words is sufficient.
2. In the attached data file regrese1.csv you may find pairs of valuest $(x_i, y_i)$. Fit these data with a sine function in the form $\begin{equation*} f(x) = a+ b \cdot \sin (c x + d) . \end {equation*}$ Plot the measured values and the fit and comment on it briefly. It’s not necessary to perform regression diagnostics.
Hint: Be wary of correct constraints for the values of parameter $c$.
3. In the attached data file regrese2.csv you may find pairs of values $(x_i, y_i)$. Fit these data with an exponential function in the form $\begin{equation*} f(x) = a+ \eu ^{b x + c} . \end {equation*}$ Estimate the values of all regression coefficient including their uncertainties.
Hint: Using graphical method examine homoscedasticity. You may use Huber-White (sandwich) estimator for determining the uncertainties in estimating regression coefficients if necessary.
4. In the attached data file regrese3.csv find the pairs of values $(x_i, y_i)$. Fit these data with a hyperbolic function in the form $\begin{equation*} f(x) = a+ \frac {1}{b x + c} . \end {equation*}$ Plot the measured data in the form of means and error bars and briefly comment on it. Perform the regression diagnostics.

Bonus: In the attached data file regrese4.csv you may find pairs of values $(x_i, y_i)$. We want to fit these data with a function too complex to be expressed analytically. Use spline regression to fit these data with appropriately chosen knots and order).

For data processing and creating the plots, you may use the R programming language. Most of these tasks can be solved by slightly altering the attached scripts.

Michal wanted to make the last series as hard as possible.

### (10 points)5. Series 30. Year - S. linear

1. Try to describe in your own words how and for what purpose linear regression is used (it is sufficient to briefly describe the following: two significant applications of linear regression, least squares method, maximum likelihood estimation, linear regression model, basic graphical methods of regression diagnostics). It’s not necessary to describe the concepts mathematically, a brief description in your own words is sufficient.
2. In the attached data file linreg1.csv you may find the results of a certain physical experiment, in which we measured the pairs of data $(x_i, y_i)$. We want to fit the measured data with a theoretical function in this case a parabola in the form $\begin{equation*} f(x) = ax^2 + bx + c . \end {equation*}$ Determine the value of the coefficient $a$ and its uncertainty. It is not necessary to use regression diagnostics.
3. In the attached data file linreg2.csv you may find the results of a certain physical experiment, in which we measured the pairs of data $(x_i, y_i)$. We want to fit the measured data with a theoretical function, in this case a logarithmic function in the form $\begin{equation*} f(x) = a+ b \cdot \log (x) . \end {equation*}$ Plot the measured data into a graph with the fitting function and briefly comment on it. It is not necessary to use regression diagnostics.
4. Suppose we have measured pairs of data $(x_i, y_i)$ and want to fit them with a linear function in the form $\begin{equation*} f(x) = a+ bx . \end {equation*}$ Derive the exact formula for calculating the regression parameters. You may use any and all sources, if you cite them correctly. (Actually derive the formula, do not just write it.)

Bonus: In the tasks b) and c) perform regression diagnostics and discuss, whether all necessary criteria (assumptions) are met.

For data processing and creating the plots, you may use the R programming language. Most of these tasks can be solved by slightly altering the attached scripts.

Michal heard somewhere, that linear regression is really easy.

### (10 points)4. Series 30. Year - S. testing

1. Try to describe in your own words what purpose serves testing of hypotheses and how its done (it is sufficient to briefly describe the following: null hypothesis and alternative hypothesis, type I and type II error, level of significance, test statistic, confidence level, $p$-value). It’s not necessary to describe the concepts mathematically, a brief description in your own words is sufficient.
2. In the attached data file testovani1.csv there are measurements of a certain physical quantity. Using one-sample $t$-test find out whether the real value of the measured quantity is equal to $20$. Then suppose our aim is to show that the real value is larger than $20$. Test this claim using an appropriate modification of $t$-test (be careful which null hypothesis and alternative hypothesis you choose).
3. In the attached data file testovani2.csv you may find the measurements of two different physical quantities. Assume the measurements to be of the same physical characteristic, just under different conditions (temperature, pressure etc.). Test the hypothesis that the value of said physical characteristic is the same under both sets of outside conditions using the two sample $z$-test.
4. Use the data from the last task in the first series of this year and using Kolmogorov–Smirnov test determine which of the four data samples comes from uniform distribution and which comes from exponential distribution.

Bonus: Assume you have at your disposal measurements of 2 physical quantities (i.e. two sets of measurements), where all the data are independent. Set up a modified $z$-test, that will test the hypothesis that the real value of the first physical quantity is double the real value of the second physical quantity. It is sufficient to set up the corresponding test statistic and confidence level. (Hint: Use the multidimensional central limit theorem with appropriately selected function $f$, and then proceed analogically to setting up a classical two-sample $z$-test) For data processing and creating the plots, you may use the R programming language. Most of these tasks can be solved by slightly altering the attached scripts.

Michal wanted to test, how difficult problems you can solve.

### (3 points)3. Series 30. Year - 2. hellish

A road and a pathway, both leading to Hell, lie on different sides of a river. We are moving along the river in the direction shown in the picture. Banks of the river are formed by concentric circular arcs. The pathway leads along one bank, the road along the other and the width of the river is constant. Route along which bank of the river is faster? For every arc, we know the central angle $φ_{1},φ_{2},\ldots$ and the radius $r_{a1},r_{b1},r_{a2},r_{b2},\ldots$, where the suffices $a,b$ denote the left and right bank respectively.

Occurred to Lukas on the way to Peklo (Hell).

### (3 points)2. Series 30. Year - 1. beach date

Imagine you are going on a date with your girlfriend/boyfriend and you end up watching the sunset on the beach. The sun above the sea horizon looks very romantic, so to prolong this special moment, you decide to use a forklift to lift you up. The forks of the forklift move up with such speed that you can see the sun touching the horizon at any moment. Determine the speed of the forks.

Dominika vzpomínala na Itálii.

### (6 points)1. Series 30. Year - 4. The world is tilted

An observer is on a ship in the open sea, in the height $h$ above the sea surface. There is a horizontal railing in the distance $d$ from him, in such a position, that when he looks directly, perpendicularly at it, the bottom edge of the railings touches the horizon. However, when he looks at the part of the railing that is distance $l$ to the left of the original point, the horizon appears to be $s±s_{s}$ lower. What is the radius of the Earth.

Lubošek trpí mořskou nemocí.