Problem Detail: I’m trying to find a solution for this exercise: Give the pseudocode of an algorithm which takes two positive integers n and k and prints all the non-decreasing sequences of length k (1,2,…,n). For example n=4, k=3: 111 112 Read More …
Author: ignougroup
[Solved]: Why is one often requiring space constructibility in Savitch’s theorem?
Problem Detail: When Savitch’s famous theorem is stated, one often sees the requirement that $S(n)$ be space constructible (interestingly, it is omitted in Wikipedia). My simple question is: Why do we need this? I understand the requirement for $S(n)$ being in Read More …
[Solved]: Does closure against countable union survive union of classes?
Problem Detail: A class of languages $mathcal{C}$ is closed under countable union (cucu) if for all series of languages in $mathcal{C}$ ($(L_i)_{iinmathbb{N}} in mathcal{C}^mathbb{N}$) the language $bigcup_{iinmathbb{N}}L_i = {xmid exists iinmathbb{N}: x in L_i}$ is an element of $mathcal{C}$. As we Read More …
[Solved]: Under what conditions is K-means clustering transformation-invariant?
Problem Detail: Given a set of data points $X = {x_1, x_2, ldots, x_m}$ where $x_i in mathbb{R}^d$ we run K-means on $X$ and obtain the clusters $c_1, c_2, ldots, c_k$. Now, if we create a new dataset $Y = {y_1, Read More …
[Solved]: What are the difference between and consequences of using type parameters and type indexes?
Problem Detail: In type theories, like Coq’s, we can define a type with parameters, like this: Inductive ListP (Element : Type) : Type := NilP : ListP Element | ConsP : Element -> ListP Element -> ListP Element. Alternatively, we can Read More …
[Solved]: Pumping Lemma for $L = left { a^{c}mid text{c is a composite number} right }$
Problem Detail: $L = left { a^{c}mid text{c is a composite number} right }$ I feel that this is not a context-free language as checking this constraint requires divisibility checking, but I am facing a hard time in proving that $L$ Read More …
[Solved]: Given a Red-Black Tree of n keys, is there a way to quickly determine if a red-node exists?
Problem Detail: My best attempt at a specific case of the problem where $n =$ 256: For a specific case that a RB tree has 256 nodes, we can use the RB tree theorem to deduce that the height of the Read More …
[Solved]: On the minimum order of a maximal independent set in cycle graphs and path graphs
Problem Detail: I can see from this question that a $K_{r + 1}$-free graph with $n$ vertices and $e$ edges contains an independent set of order at least $$frac{n}{2e/n + 1} tag{1} $$ Since for a $C_{n}$/$P_{n}$ we know how many Read More …
[Solved]: Why does this graph show the tightness of MST heuristic’s 2-approximation bound?
Problem Detail: This is a homework problem I’ve been given and I’ve been raking my brain for hours (so I’m satisfied with some pointers). I know already that the approximation ratio cannot be worse than $2$. I have a wheel graph, Read More …
[Solved]: How does a regular language satisfies the second condition of the pumping lemma
Problem Detail: I’m a little bit confused about the second condition of the pumping lemma which are: $|y|geq1$ $|xy|leq p$ $forall i geq 0:xyizin L$ I don’t understand why the length of substrings $xy$ has to be less than the pumping Read More …