Bozo sort, not to be confused with the slightly less efficient bogo sort, consists out of checking if the input sequence is sorted and if not swapping...
Two players, Anton and Bernhard, are playing the following game. There is one pile of $n$ stones. The first player may remove any positive number of stones,...
The binomial coefficient $\displaystyle{\binom{10^{18}}{10^9}}$ is a number with more than $9$ billion ($9\times 10^9$) digits. Let $M(n,k,m)$ denote the binomial coefficient $\displaystyle{\binom{n}{k}}$ modulo $m$. Calculate $\displaystyle{\sum M(10^{18},10^9,p\cdot...
A cubic Bézier curve is defined by four points: $P_0, P_1, P_2,$ and $P_3$. The curve is constructed as follows: On the segments $P_0 P_1$, $P_1 P_2$,...
Given two points $(x_1, y_1, z_1)$ and $(x_2, y_2, z_2)$ in three dimensional space, the Manhattan distance between those points is defined as$|x_1 – x_2| + |y_1...