There are 10 slots and some marbles: 5 red, 3 blue, 2 green, how many ways can you fit those marbles into those slots? Those marbles fit in 10!/(5! 3! 2!) ways Now we have 10 slots but the slots have a restriction: slots #1 thru #4 can fit red, blue, or green marbles. But […]

I’m wondering if there exists any rule/scheme of proceeding with proving algorithm correctness? For example we have a function $F$ defined on the natural numbers and defined below: function F(n,k) begin if k=0 then return 1 else if (n mod 2 = 0) and (k mod 2 = 1) then return 0 else return F(n […]

The radix-2 FFT using Cooley-Tukey utilises two interleaved transforms of length $N/2$, and you can see near the bottom of that section that we can find the second half of the original transform by multiplying the twiddle factor by $-1$. (See the fourth paragraph in that section). Now, let’s say we have a higher radix. […]

I have to find a closed form formula for the following recurrence relation which describes Strassen’s matrix multiplication algorithm – $$T(n) = 7\,T\left(n \over 2\right) + \frac{18}{16}n^2$$ with the base case $T(1) = 1$ and $n = 2^j$, I have been able to reduce the formula to the following form: $$T(2^j) = 7^j + \frac{3}{2}\,4^{j} […]

I’m trying to solve the following recurrence relation (Strassen’s):- $$ T(n) =\begin{cases} 7T(n/2) + 18n^2 & \text{if } n > 2\\ 1 & \text{if } n \leq 2 \end{cases} $$ So I multiplied the $7$ by $2$ several times and the 18n^2^2 several times and ended up with this general equation:- $$ 7k T(n/2^k) + […]

In this Python code, the function f is defined, which then immediately calls itself: def f(): f() It’s not very complicated, the first line defines the function, and the second line calls it. Therefore, once the function is initially called, it will be continued to be called forever, as there is no base case. I […]

This question already has an answer here: Why does the Fibonacci Series start with 0, 1? 5 answers

For my own exercising I tried to find a closed form expression for the Newton-approximation algorithm, beginning with the simple example for getting the squareroot of some given $ \small z^2 $ by recursion according to $$ \small x_0 = 1 \qquad x_{k+1} = \left( {z^2 \over x_k}+x_k \right)/2 $$ where only $ \small z^2 […]

I have a square grid of size $N$, with rows numbered from $0$ to $N – 1$ starting from the top and columns numbered from $0$ to $N – 1$ starting from the left. A cell $(u, v)$ refers to the cell that is on the $u$-th row and the $v$-th column. Each cell contains […]

A context free language is generated by a context free grammar, which can be expressed in the Backus-Naur form e.g. I believe that if we only allow one nonterminal symbol in the grammar, the resulting languages must be simpler, possibly even regular. I don’t see how to prove this yet, so can you help me: […]

Intereting Posts

Cardinality of the union of infinite and countable sets
Local coefficient System and universal cover
How can I show that the “binary digit maps” $b_i : [0,1) \to \{0,1\}$ are i.i.d. Bernoulli random variables?
What are the Axiom of Choice and Axiom of Determinacy?
Given a graph, can we delete exactly k edges and the minimum degree of remaining graph is at least 4
Proving that $x$ is irrational if $x-\lfloor x \rfloor + \frac1x – \left\lfloor \frac1x \right\rfloor = 1$
Do there exist closed subspaces $X$, $Y$ of Banach space, such that $X+Y$ is not closed?
Question about all the homomorphisms from $\mathbb{Z}$ to $\mathbb{Z}$
Show that axiom of replacement implies from the Axiom of Specification
Solve $au_x+bu_y+cu=0$
Surface area with cavalier's principle
Notation problem in integration: write $dx$ or ${\mathrm{d}}x$?
The set of all sets of the universe?
Evaluate $ \sum\limits_{n=1}^{\infty}\frac{n}{n^{4}+n^{2}+1}$
How can this equation produce an integer as a result? $\frac{1}{1+\cos(40^0)}+\frac{1}{1+\cos(80^0)}+\frac{1}{1+\cos(160^0)}=18$