instruction
stringlengths
0
29.8k
⌀
|complexity-theory|time-complexity|asymptotics|big-o-notation|
In [*Conflict-free Replicated Data Types: An Overview*](https://arxiv.org/pdf/1806.10254.pdf) and other CRDT-related publications by Preguiça's group, a dot symbol often appears without definition. What does it indicate, how standard is it as notation, and what field's literature does it come from? For example: $$\{...
|distributed-systems|concurrency|notation|
You are correct. If $f(n) \in O(g(n))$ and $g(n) \in \Omega(f(n))$ then $f(n) \not\in \Theta(g(n))$. $\Omega(f(n))$ contains all functions growing as fast or faster than $f(n)$. $n^2 \in O(n^3)$ and $n^3 \in \Omega(n^2)$ so $n^2 \not\in \Theta(n^3)$.
{"Voters":[{"Id":58193,"DisplayName":"Björn Lindqvist"}]}
You are correct. If $f(n) \in O(g(n))$ and $g(n) \in O(f(n))$ then $f(n) \in \Theta(g(n))$, otherwise $f(n) \not\in \Theta(g(n))$. $n^2 \in O(n^3)$ but $n^3 \not\in O(n^2)$ so $n^2 \not\in \Theta(n^3)$. It works analogously to regular numbers. If $x \leq y$ and $y \leq x$ then $x=y$, otherwise $x \neq y$. ...
{"Voters":[{"Id":58193,"DisplayName":"Björn Lindqvist"}]}
"for some input size $n$ greater than $n'$" is wrong. The correct statement is "for *all* input sizes $n$ greater than $n'$". Obviously, $$\frac{n^3}2\le n^2\le 2n^3,$$ which is equivalent to $$\frac12\le n\le 2,$$ cannot hold for unbounded $n$.
"for some input size $n$ greater than $n'$" is wrong. The correct statement is "for *all* input sizes $n$ greater than $n'$". Obviously, $$\frac{n^3}2\le n^2\le 2n^3,$$ which is equivalent to $$\frac12\le n\le 2,$$ cannot hold for unbounded $n$. ---------- More generally, $$\frac1{c_2}\le n\le\fra...
Are there any freely available resources to study randomized algorithms?
null
If $f(n) \in O(g(n))$ and $g(n) \in O(f(n))$ then $f(n) \in \Theta(g(n))$, otherwise $f(n) \not\in \Theta(g(n))$. $n^2 \in O(n^3)$ but $n^3 \not\in O(n^2)$ so $n^2 \not\in \Theta(n^3)$. It works analogously to regular numbers. If $x \leq y$ and $y \leq x$ then $x=y$, otherwise $x \neq y$.
Let's say there is a single objective optimization problem SP (e.g. a linear program) and an optimization algorithm SA for it (e.g. simplex). Then applying SA to SP yields an optimal solution ```s=SA(SP)```. Now let's assume there is a multi objective optimization problem MP (e.g. a linear program with two linear ob...
Multi Objective Optimization Using Only Single Objective Optimization Algorithms
|optimization|
"for some input size $n$ greater than $n'$" is wrong. The correct statement is "for *all* input sizes $n$ greater than $n'$". Obviously, $$\frac{n^3}2\le n^2\le 2n^3,$$ which is equivalent to $$\frac12\le n\le 2,$$ cannot hold for unbounded $n$. ---------- More generally, $$\frac1{c_2}\le n\le\fra...
If $f(n) \in O(g(n))$ and $g(n) \in O(f(n))$ then $f(n) \in \Theta(g(n))$, otherwise $f(n) \not\in \Theta(g(n))$. $n^2 \in O(n^3)$ but $n^3 \not\in O(n^2)$ so $n^2 \not\in \Theta(n^3)$. It works analogously to regular numbers. If $x \leq y$ and $y \leq x$ then $x=y$, otherwise $x \neq y$. The error in your t...
I have a list of 256-bit data to store. Can I compress it so that I can retrieve an entry by its index without decompressing the whole data. I will also need to code this algorithm ground-up in a domain-specific language.
Binary compression algorithem with decompress by index
|algorithms|complexity-theory|data-structures|data-compression|
null
|algorithms|complexity-theory|data-structures|information-theory|data-compression|
Actually, using a weighted sum *does* find all Pareto-optimal solutions. Let your two objective functions be $f_1,f_2$. Define a single objective function $$f(x) = \alpha f_1(x) + (1-\alpha) f_2(x),$$ where $\alpha$ is a constant. If you sweep $\alpha$ over all possible values in $[0,1]$ and, for each such $...
null
The standard proof for the undecidability of $E_{TM}$ is [this right?][1]. Doesn't this automatically create a mapping reduction from $A_{TM}$ to $E_{TM}$ ? [1]: https://cs.stackexchange.com/questions/53836/etm-undecidability
$A_{TM}$ is not mapping reducible to $E_{TM}$?
|reductions|undecidability|
The standard proof for the undecidability of $E_{TM}$ is [this right?][1]. Doesn't this automatically create a mapping reduction from $A_{TM}$ to $E_{TM}$ ? Whenever $w \in A_{TM}, f(w) \in E_{TM} $ obviously. The other way: $ f(w) \in E_{TM} \Rightarrow w \in A_{TM} $ seems true, although I don't know how to prove tha...
The standard proof for the undecidability of $E_{TM}$ is [this right?][1]. Doesn't this automatically create a mapping reduction from $A_{TM}$ to $E_{TM}$ ? Whenever $w \in A_{TM}, f(w) \in E_{TM} $ obviously. The other way: $ f(w) \in E_{TM} \Rightarrow w \in A_{TM} $ seems true, although I suspect that's where the fu...
$E_{TM}$ is mapping reducible to $A_{TM}$. Here is a sketch of a possible reduction: Given (the description of) a Turing Machine $T$, compute (the description of) a Turing Machine $T'$ that behaves as follows: - $T'$ takes two inputs, a word $w$ and a non-negative integer $n$. - $T'$ simulates $T$ with input $w$ ...
By the definition, in an Interactive Proof system the verifier is allowed to generate random numbers, which allows the omniscient prover to not fool it in the vast majority of cases for every problem in $\mathsf{PSPACE}$. The verifier is a polynomial time machine, therefore an ability to generate random numbers makes i...
The program does have a precondition: `true`. Which means that it is fulfilled, regardless the state variables.
$A_{TM}= \{ <M,w> | <M>$ is a TM that accepts $w\}$ $E_{TM}= \{ <M> | L(M) = \epsilon \}$ The standard proof for the undecidability of $E_{TM}$ is [this right?][1]. Doesn't this automatically create a mapping reduction from $A_{TM}$ to $E_{TM}$ ? Whenever $w \in A_{TM}, f(w) \in E_{TM} $ obviously. The other way...
The program does have a precondition: `true`. Which means that it is fulfilled, regardless the state variables. The annotation would still be correct with a stronger precondition, such as `a.length > 0`. `true`cannot be weakened, so it is the weakest precondition.
$A_{TM}= \{ <M,w> | <M>$ is a TM that accepts $w\}$ $E_{TM}= \{ <M> | L(M) = \epsilon \}$ The standard proof for the undecidability of $E_{TM}$ is [this right?][1]. Doesn't this automatically create a mapping reduction from $A_{TM}$ to $E_{TM}$ ? Whenever $w \in A_{TM}, f(w) \in E_{TM} $ obviously. The other way...
{"Voters":[{"Id":6759,"DisplayName":"Steven"}]}
{"Voters":[{"Id":6759,"DisplayName":"Steven"}]}
**Note:** This answer was given *before* the definition of $A_{TM}$ was added to the question and was assuming the following definition instead $A_{TM} = \{ \langle T \rangle \mid L(T) = \Sigma^* \}$. $E_{TM}$ is mapping reducible to $A_{TM}$. Here is a sketch of a possible reduction: Given (the description of) a...
I have a list of 256-bit data to store. Can I compress it so that I can retrieve an entry by its index without decompressing the whole data. I will also need to code this algorithm ground-up in a domain-specific language. Edit: The whole data will only be binary. Each entry in list is a 256 bit random binary number....
I have a list of 256-bit data to store. How to compress it losslessly so that I can retrieve an entry by its index without decompressing the whole data. I will also need to code this algorithm ground-up in a domain-specific language. Edit: The whole data will be strictly binary. Each entry in list is a 256 bit prett...
I have started to play around with HTTP3 which relies on QUIC for transport. I have noticed that I very often have a finite number of Web Transport sessions stream data continuously along side burst-y HTTP3 REST calls. At the QUIC level, all of these streams are going over the same connection and are demultiplexed via ...
I have a list of 256-bit data to store. How to compress it losslessly so that I can retrieve an entry by its index without decompressing the whole data. I will also need to code this algorithm ground-up in a domain-specific language. Edit: The whole data will be strictly binary. Each entry in list is a 256 bit sligh...
Here is an $O(n)$ two-finger algorithm for the problem in Python: from random import random from sys import exit n = 500 vels = [1 + 10*random() for _ in range(n)] i = 0 j = 0 d = 0 mv = 0 while j < n: # Scan until d >= 100 while d < 100 and j < n: ...
$A_{TM}= \{ <M,w> | <M>$ is a TM that accepts $w\}$ $E_{TM}= \{ <M> | L(M) = \epsilon \}$ The standard proof for the undecidability of $E_{TM}$ is [this right?][1]. Doesn't this automatically create a mapping reduction from $A_{TM}$ to $E_{TM}$ ? Whenever $w \in A_{TM}, f(w) \in E_{TM} $ obviously. The other way...
We want to design a **[Deterministic Finite Automaton (DFA)][1]** that **accepts** Binary Representation of Integers which are divisible by 3. > Now, by **accept**, in layman terms, we can say that when we are done with scanning string, we should be in one of the multiple possible Final States. > > More Formally...
**Hint:** If the remainders of $n$ by $3$ are $0, 1, 2$, then the remainders of $n$ followed by zero (i.e. $2n$) are $0, 2, 1$, and the remainders of $n$ followed by one (i.e. $2n+1$) are $1,0,2$. This explains the transitions between the bottom states marked $0,1,2$.
null
i am relatively new here, so if this was asked before, feel free to redirect me. I am searching for an answer in form of a (iterative or recursive) Formula or even better, an algorithm to list them all. But if you know the name of what i am searching for or have some strategy how i could approach this or tips for liter...
How many different boolean functions exist up to permutation of its $n$ variables
|boolean-algebra|permutations|boolean-complexity|
null
What is the tightest lower and upper bound for the expected maximum value of k IID Binomial(n, p) random variables I tried to derive it : $$Pr[max \leq C] = (\sum_{i = 0}^C {n \choose i}p^i(1 - p)^i)^k$$ $$E[max] = \sum_{C = 1}^n C(pr[max \leq C] - pr[max \leq C - 1]) = \sum_{C = 1}^n c((\sum_{i = 0}^C {n \choose ...
Tight bounds for expected maximum of k binomial(n,p) IIDs
|probability-theory|lower-bounds|statistics|upper-bound|
i am relatively new here, so if this was asked before, feel free to redirect me. I am searching for an answer in form of a (iterative or recursive) Formula or even better, an algorithm to list them all. But if you know the name of what i am searching for or have some strategy how i could approach this or tips for liter...
You are looking for [A003180](https://oeis.org/A003180). The related sequence [A003181](https://oeis.org/A003181) counts functions depending on all variables. Often one allows further operations: negation of inputs, and negation of the output. The corresponding sequence is then [A000370](https://oeis.org/A000370)...
I found this in information theory [paper, P.3883][1]* the authors states the following >Most existing theoretic studies of network coding focus on DAGs due to its simpler structure and dure to the fact that one can always convert a cyclic network to its acyclic counterpart by taking into account the time index and...
null
I have an undirected, unweighted graph where each node stores a numerical value(say *p*) in the range 0-1. The edges denote the neighbors of each node. I need to enumerate all sub-graphs given an input value for the threshold on *p*. Let's say our input for the threshold on p is 0.7. We need to all/largest connected...
Undirected unweighted sub-graph enumeration with threshold on node value
|algorithms|graphs|data-structures|
$A_{TM}= \{ \langle M,w\rangle \mid M$ is a TM that accepts $w\}$ $E_{TM}= \{ \langle M\rangle \mid L(M) = \emptyset \}$ The standard proof for the undecidability of $E_{TM}$ is [this right?][1]. Doesn't this automatically create a mapping reduction $f$ from $A_{TM}$ to $E_{TM}$ ? Whenever $w \in A_{TM}, f(w) ...
Why is $A_{TM}$ not mapping reducible to $E_{TM}$?
|turing-machines|reductions|undecidability|
Given $\langle M,w\rangle\in A_{TM}$, the mapping $f$ in the question maps $\langle M,w\rangle$ to $\langle M_1\rangle$, where $M_1$ accepts input $x$ iff $x$ is $w$ and $M$ accepts on $w$. $f$ is NOT a Turing many-to-one reduction from $A_{TM}$ to $E_{TM}$, since $M_1$ accepts $w$, i.e., $f(\langle M,w\rangle )=\l...
$A_{TM}= \{ \langle M,w\rangle \mid M$ is a TM that accepts $w\}$ $E_{TM}= \{ \langle M\rangle \mid L(M) = \emptyset \}$ The standard proof for the undecidability of $E_{TM}$ is given in [this question][1], right?. Doesn't this automatically create a mapping reduction $f$ from $A_{TM}$ to $E_{TM}$ ? Whenever $...
Given $\langle M,w\rangle\in A_{TM}$, the mapping $f$ in the question maps $\langle M,w\rangle$ to $\langle M_1\rangle$, where Turing machine $M_1$ accepts input $x$ iff $x$ is $w$ and $M$ accepts $w$. $f$ is NOT a mapping reduction from $A_{TM}$ to $E_{TM}$, since $M_1$ accepts $w$, i.e., $f(\langle M,w\rangle )=\...
I have an undirected, unweighted graph $G=(V,E)$, and a function $f:V\to [0,1]$ where $[0,1]$ denotes the interval of real numbers from $0$ to $1$ inclusive. Given an input threshold $t\in [0,1]$, I need an algorithm which returns all maximum sized connected sub-graphs $H\subseteq G$, such that every node $u\in H$ h...
null
$A_{TM}= \{ \langle M,w\rangle \mid M$ is a TM that accepts $w\}$ $E_{TM}= \{ \langle M\rangle \mid L(M) = \emptyset \}$ The standard proof for the undecidability of $E_{TM}$ is given in [this question][1], right?. Doesn't this automatically create a mapping reduction $f$ from $A_{TM}$ to $E_{TM}$ ? Whenever $...
I read an example of using cosine distance in RGB space, and it pointed out that (eg.) dark red and light red have a cosine distance (CD) of zero because CD only gives you the angle between vectors and doesn't consider length. Fair enough. I wondered if a way to fix this was by making it a four dimensional problem by a...
Cosine distance in RGB space, and cheating?
|machine-learning|
I read an example of using cosine distance in RGB space, and it pointed out that (eg.) dark red and light red have a cosine distance (CD) of zero because CD only gives you the angle between vectors and doesn't consider length. Fair enough. I wondered if a way to fix this was by making it a four dimensional problem by a...
null
Cosine distance in a space, and cheating?
let's suppose we've got a simple Recurrence Relation: $$ T(n) = \begin{cases} 1 & n=1 \\ T(n-1) + \Theta(n) & \text{otherwise} \end{cases} $$ At lesson we've resolved it, but I tried two other ways of resolution, and I would like to ask you if they're right and which, among a...
Formal mathematical resolution for Recurrence Relations
|recurrence-relation|
let's suppose we've got a simple Recurrence Relation: $$ T(n) = \begin{cases} 1 & n=1 \\ T(n-1) + \Theta(n) & \text{otherwise} \end{cases} $$ At lesson we've resolved it, but I tried two other ways of resolution, and I would like to ask you if they're right and which, among a...
|machine-learning|euclidean-distance|
I read an example of using cosine distance in RGB space, and it pointed out that (eg.) dark red and light red have a cosine distance (CD) of zero because CD only gives you the angle between vectors and doesn't consider length. Fair enough. I wondered if a way to fix this was by making it a four dimensional problem by a...
To compare colors, the cosine distance is interesting as it cancels the effect of light intensity (so yes, dark red and light red are both two reds). If you don't want this effect, the Euclidean distance is fine.
I read an example of using cosine distance in RGB space, and it pointed out that (eg.) dark red and light red have a cosine distance (CD) of zero because CD only gives you the angle between vectors and doesn't consider length. Fair enough. I wondered if a way to fix this was by making it a four dimensional problem by a...
To compare colors, the cosine distance is interesting as it cancels the effect of light intensity (so yes, dark red and light red are both two reds). If you don't want this effect, the Euclidean distance (in RGB space) is fine.
Suppose given number $k$ and undirected unweighted graph $G=(V,E)$, also given two vertices $s$ and $t$. Can we find $k$ shortest paths between $s$ and $t$ in $O(n+m)$? I read this [link][1] but I can't findout the answer of my question. [1]: https://cs.stackexchange.com/questions/60368/linear-time-algorithm-...
Find $k$ shortest paths in linear time
|algorithms|
Suppose given number $k$ and undirected unweighted graph $G=(V,E)$, also given two vertices $s$ and $t$. Can we find $k$ shortest paths between $s$ and $t$ in $O(n+m)$ without term $k$? I read this [link][1] but I can't findout the answer of my question. I think this problem can't solve in polytime. [1]: http...
I'm not 100% sure about this but here's what I think: "Would applying DeMorgan's rule to the minimal DNF result in the minimal CNF?" If you negate the expression and then apply De Morgan's laws you a CNF for the negation of the original expression. I think it's also minimal though I don't have a rigorous proof. ...
L is a group of all languages that satisfy the pumping lemma, including non-regular languages that satisfy it. Is the group L closed under concatenation? I couldn’t prove it or find a counter-example. Thanks!
Are all languages the satisfy the pumping leema closed under concatenation?
|regular-languages|pumping-lemma|closure-properties|
L is a group of all languages that satisfy the pumping lemma, including non-regular languages that satisfy it. Is the group L closed under concatenation? I couldn’t prove it or find a counter-example. Thanks!
Are all languages the satisfy the pumping lemma closed under concatenation?
null
Let $L$ be the set of all languages that satisfy the pumping lemma, including non-regular languages that satisfy it. Is the set $L$ closed under concatenation? I couldn’t prove it or find a counterexample.
Is the set of languages satisfying the pumping lemma closed under concatenation?
Suppose that $L_1$ satisfies the pumping lemma: there exists $p_1$ such that every word $w \in L_1$ of length at least $p$ can be decomposed as $w = xyz$, where $|xy| \leq p_1$, $y \neq \epsilon$, and $xy^iz \in L_1$ for all $i \geq 0$. Similarly, suppose that $L_2$ satisfies the pumping lemma, with constant $p_2$. ...
null