instruction
stringlengths
0
29.8k
⌀
I am wondering why some methods transform the underlying graphical model (Bayesian Network for example) to a junction tree? What are the advantages? Also what is the limitations? I believe its for computational purposes if that's the case under what circumstances it is not recommended to transform the underlying ...
Why joint trees in Graphical Models?
|graph-theory|trees|
[Integer linear programming](http://en.wikipedia.org/wiki/Linear_programming#Integral_linear_programs) (ILP) is an incredibly powerful tool in combinatorial optimization. If we can formulate some problem as an instance of an ILP then the [Simplex Algorithm](http://en.wikipedia.org/wiki/Simplex_algorithm) is guaranteed ...
Randomized Rounding of LPs
|optimization|randomized-algorithms|linear-programming|
Having received no response to this question on math.SE, I'm asking it here. Thanks for your help. In [the Wikipedia article on the Clique problem](http://en.wikipedia.org/wiki/Clique_problem), we are told that under the brute-force algorithm, there are potentially exponentially many subgraphs of a given graph that ...
Cliques in an alternate graph representation
|complexity-theory|graphs|
[Integer linear programming](http://en.wikipedia.org/wiki/Linear_programming#Integral_linear_programs) (ILP) is an incredibly powerful tool in combinatorial optimization. If we can formulate some problem as an instance of an ILP then the [Simplex Algorithm](http://en.wikipedia.org/wiki/Simplex_algorithm) is guaranteed ...
Aren't there $n^2$ unique substrings of a string (irrespective of the alphabet size)? Perhaps the number of unique *suffix substrings* is less than the number of unique *substrings* of a string.
Why does a suffix tree have a linear number of nodes (relative to input string size)?
|strings|
Randomized Rounding of Solutions to Linear Programs
1. No. E.g. the Halting problem is a decision problem which is NP-hard but not in NP and therefore not NP-complete. 2. In normal usage yes, because an NP-complete problem must be in NP and NP is a class of decision problems. But see [Decision problems vs “real” problems that aren't yes-or-no](http://cs.stackexchange...
1. Is it always true that a problem which is ${\sf NP}$-hard but not ${\sf NP}$-complete is an optimization problem such as **Minimum-Vertex-Cover** and many others. 2. Is it always true that a ${\sf NP}$-complete problem is always a decision problem such as vertex cover of size $k$, independent set of size $k$ and ...
NP-Hard problems which are not NP-Complete
In general, this is a very relevant and interesting research question. "One way is to run existing solvers..." and what would this even tell us exactly? We could see empirically that an instance seems hard for a specific solver or a specific algorithm/heuristic, but what does it really tell about the hardness of the in...
I assume you can compare two recipes and say which would be preferable to the other. That is, you can define an order between them. Then: 1. You need to find appropriate recipe only **once** (or very few times). A simple scan through all the recipes is the only way possible. You *need* to look at *every* recipe at ...
I assume you can compare two recipes and say which would be preferable to the other. That is, you can define an order between them. Then: 1. You need to find appropriate recipe only **once** (or very few times). A simple scan through all the recipes is the only way possible. You *need* to look at *every* recipe at ...
null
For a test of length $n$ we have up to $1+{ n \choose 2}$ different substrings, however there are only $n+1$ suffixes (for every suffix you can pick the position where it starts). I assume you consider the compressed suffix tree (edge labels are words). This is a tree with $n+1$ leaves and every internal node has at...
|data-structures|strings|trees|
null
I am wondering why some methods transform the underlying graphical model (Bayesian Network for example) to a junction tree<sup>1</sup>? What are the advantages? Also what is the limitations? I believe its for computational purposes if that's the case under what circumstances it is not recommended to transform the...
|algorithms|graph-theory|trees|
An independent set $I$ is a subset of the nodes of a graph $G$ where: no 2 nodes in $I$ are adjacent in $G$. For natural number $k$, the problem $k-\text{IND}$ asks if there is an independent set of size $k$. I'd really love your help with showing that $k-\text{IND} \in {\sf L}$, i.e., can be decided using determini...
Showing that Independent set of size $k$ can be decided using logarithmic space
|complexity-theory|graphs|space-complexity|
For a test of length $n$ we have up to $1+{ n+1 \choose 2}$ different substrings, however there are only $n+1$ suffixes (for every suffix you can pick the position where it starts). I assume you consider the compressed suffix tree (edge labels are words). This is a tree with $n+1$ leaves and every internal node has ...
You can use the following algorithm. I assume that the vertices are labeled $1,\ldots,m$. You enumerate all $k$-tupels $\{1,\ldots , m\}^k$. This can be done by reserving $k$ counters on the TM tape. Since $k$ is not part of your input this needs only $O(\log m )\subseteq O(\log n)$ space. However for every $k$-tupe...
|complexity-theory|terminology|np-complete|np-hard|decision-problem|
I am wondering why some methods transform the underlying graphical model (Bayesian Network for example) to a junction tree¹? What are the advantages? Also what are the limitations? I believe it's for computational purposes. If that's the case under what circumstances it is not recommended to transform the underly...
Why use joint trees in Graphical Models?
|machine-learning|
You haven't specified exactly what your output is, but if it is the standard "output all maximal cliques", then the size of your output is exponential in the worst case, and therefore regardless of what algorithm you use, or what your representation* is, the algorithm may have to spend exponential time, just to output ...
Try these slides http://www.cs.bgu.ac.il/~frankel/HonoraryDay09/Slides/AmirPnueli.pdf or these ones http://www.cs.rice.edu/~vardi/papers/fmco06.ps.gz. Also try googling "From Verification to Synthesis" and look at the work of Moshe Vardi and Orna Kupferman.
Of course, if you round, you have to verify that rounding preserves feasibility. Let us for example consider the **relaxed** VERTEX-COVER LP formulation. $$ \begin{array}{lll} \text{min} & \sum_{v\in V}c(v)x_v & \\ \text{s.t.} &x_u+x_v\ge1, & \quad (u,v)\in E \\ &x_v\ge 0. & \quad v\in V \end{array} $$ It ...
|optimization|randomized-algorithms|linear-programming|approximation|
**Ad 1:** The statement is true, but your reasoning is not: you can not change the enumeration; the definition of $L_2$ is intimately tied to the order of elements. Here is the simple algorithm that decides $L_2$: decide2(w) = { (u,v) = split (w,#) // w = u#v if ( decide1(u) && decide1(v)...
For a text of length $n$ we have up to $1+{ n+1 \choose 2}$ different substrings, however there are only $n+1$ suffixes (for every suffix you can pick the position where it starts). I assume you consider the compressed suffix tree (edge labels are words). This is a tree with $n+1$ leaves and every internal node has ...
Can anyone explain what the function g2() returns? I am able to find out g1() returns a list in binary for example g1(1) = [1] g1(2) = [01] g1(3) = [11] g1(4) = [001] head() returns first bit from list. eg: head([0,1,0]) = 0, head([1])...
Recursion problem
|recursion|
null
$$ for ( i = n , j = 0 ; i > 0 ; i = i / 2 , j = j + 1 ) ; $$ Let $val(j)$ denote the value of $j$, after the termination of the loop. Which of the following is true? $(A)\quad val(j) = \Theta(\log(n)) $ <br> $(B)\quad val(j) = \Theta(\sqrt n) $ <br> $(C)\quad val(j) = \Theta(n) $ <br> $(D)\quad val(j) = \Thet...
How to guess the value of $j$ at the end of the loop?
|time-complexity|
Consider a set of functions: * `head(l)` returns first bit from list `l`, e.g. head([0,1,0]) = 0, head([1]) = 1 * `tail(l)` returns a list by removing first element from `l`, e.g. tail([0,1,0]) = [1,0], tail([1]) = [] * `a:l` appends bit `a` to beginning of ...
|programming-languages|
$$ for ( i = n , j = 0 ; i > 0 ; i = i / 2 , j = j + i ) ; $$ Let $val(j)$ denote the value of $j$, after the termination of the loop. Which of the following is true? $(A)\quad val(j) = \Theta(\log(n)) $ <br> $(B)\quad val(j) = \Theta(\sqrt n) $ <br> $(C)\quad val(j) = \Theta(n) $ <br> $(D)\quad val(j) = \Thet...
for ( i = n , j = 0 ; i > 0 ; i = i / 2 , j = j + i ) ; Let $\text{val}(j)$ denote the value of $j$, after the termination of the loop. Which of the following is true? (A)$\quad \text{val(j)} = \Theta(\log(n)) $ <br> (B)$\quad \text{val(j)} = \Theta(\sqrt n) $ <br> (C)$\quad \text{val(j)} = \Theta(n) $ <br>...
|asymptotics|runtime-analysis|
Yes, this is confusing in the first sight. I see it like this: step1) generate a linear program solution [all the linear program constraints are satisfied in here - except that it is not Integer solution], step2) randomize it (change the value to integers according to a probability distribution you select),...
If you unfold the loop you get: $$\text{val}( j)=n+n/2+n/4+ n/8 \ldots$$ In total you have $\log n$ terms. See [this post](http://math.stackexchange.com/questions/244817/), how to evaluate the sum.
You can use the following algorithm. I assume that the vertices are labeled $1,\ldots,m$. You enumerate all $k$-tupels $\{1,\ldots , m\}^k$. This can be done by reserving $k$ counters on the TM tape. Since $k$ is not part of your input this needs only $O(\log m )\subseteq O(\log n)$ space. However for every $k$-tupe...
for ( i = n , j = 0 ; i > 0 ; i = i / 2 , j = j + i ) ; All variables are integers.(i.e. if decimal values occur, consider their floor value) Let $\text{val}(j)$ denote the value of $j$, after the termination of the loop. Which of the following is true? (A)$\quad \text{val(j)} = \Theta(\log(n)) $ <br> (B)...
This loops never ends. Dividing $i$ by 2 repetitively will always lead to i > 0. Therefore: $ j = n + n/2 + n/4 ... $ $ j = \sum _{i = 0} ^{\inf} n (1/2)^{i}= n \sum _{i = 0} ^{\inf} (1/2)^{i}$ Given that $\sum _{i = 1} ^{\inf} c^i = c / (1 - c) $ then the solution of this equation is $j = 2 n$
In theoretical processor, this loops never ends. Dividing $i$ by 2 repetitively will always lead to i > 0. [This has been changed in the Q. description] Therefore: $ j = n + n/2 + n/4 ... $ $ j = \sum _{i = 0} ^{\inf} n (1/2)^{i}= n \sum _{i = 0} ^{\inf} (1/2)^{i}$ Given that $\sum _{i = 1} ^{\inf} c^i = c ...
In theoretical processor, this loops never ends. Dividing $i$ by 2 repetitively will always lead to i > 0. [This has been changed in the Q. description] Therefore: $ j = n + n/2 + n/4 ... $ $ j = \sum _{i = 0} ^{\inf} n (1/2)^{i}= n \sum _{i = 0} ^{\inf} (1/2)^{i}$ Given that $\sum _{i = 1} ^{\inf} c^i = c ...
I view junction trees as basically an implementation/analysis tool for doing exact MAP and marginal inference in graphical models. They are needed so that you can safely localize the effects of of maxing or summing (in the case of MAP and marginal inference) out a variable. When wouldn't you use a junction tee? We...
In theoretical processor, this loops never ends. Dividing $i$ by 2 repetitively will always lead to i > 0. [This has been changed in the Q. description] Therefore: $ j = n + n/2 + n/4 ... $ $ j = \sum _{i = 0} ^{\inf} n (1/2)^{i}= n \sum _{i = 0} ^{\inf} (1/2)^{i}$ Given that $\sum _{i = 1} ^{\inf} c^i = c ...
Hints: - g1(0) = [0] so you can see that f1 for [0] returns [1] and for [1] returns [0]. From here g1 must be clear. - f2 takes a bit and a list of one element and returns a bit so it is one of the [boolean functions of 2 variables][4] (they are only 8) - after you know that g2(0) = 0 and the above hints...
Hints: - g1(0) = [0] so you can see that f1 for [0] returns [1] and for [1] returns [0]. From here g1 must be clear. - f2 takes a bit and a list of one element and returns a bit so it is one of the [boolean functions of 2 variables][4] (they are only 16) - after you know that g2(0) = 0 and the above hint...
Hints: - g1(0) = [0] so you can see that f1 for [0] returns [1] and for [1] returns [0]. From here g1 must be clear. - f2 takes a bit and a list of one element and returns a bit so it is one of the [boolean functions of 2 variables][4] (they are only 16) - after you know that g2(0) = 0 and the above hint...
|algorithm-analysis|asymptotics|integers|
$f(n)$ = $O(g(n))$ implies that for *all* $n > N_0$, $N_0 > 0$, the relation $f(n) \leq c \cdot g(n)$ holds for some $c > 0$. Following this definition, we have: $n^{1000001} \leq c \cdot (1.000001)^n$ $1000001 \cdot \log(n) \leq \log(c) + n \log(1.000001)$ Checking for $1000001 \cdot \log(n) = n \log(1.00000...
|algorithms|reference-request|optimization|numerical-analysis|
You can use the following algorithm. I assume that the vertices are labeled $1,\ldots,m$. You enumerate all $k$-tuples $\{1,\ldots , m\}^k$. This can be done by reserving $k$ counters on the TM tape. Since $k$ is not part of your input this needs only $O(\log m )\subseteq O(\log n)$ space. However for every $k$-tupl...
Identify the language given by L={x ∈ (0,1)* : x≠wwR, w∈ (0,1)*}. Note: wR is the reverse of the string w. Closure property can/should be applied only in the cases when the actual language is not specified. Otherwise, you may arrive at wrong conclusions. The language in question is fully specified, so I doubt whethe...
complement of CFL
|computation-tree-logic|
making exercises to prepare a test I'm having problems to understand 2 questions, the questions are: how many are the leafs of a decisional tree associated to any algorithm for the search problem in a ordered set? for this question I have 2 set of answer where, for every set, 1 is right, looking at ...
Algorithm exercise
|algorithms|
Identify the language given by $L = \{ x \in (0,1)^* : x \neq ww^R, w \in (0,1)^*\}$. Note: $w^R$ is the reverse of the string $w$. Closure property can/should be applied only in the cases when the actual language is not specified. Otherwise, you may arrive at wrong conclusions. The language in question is fully spe...
null
|formal-grammars|context-free|
Lets break the loop as j = 0; for ( i = n ; i > 0 ; i = i/2 ) j = j + i ; Since the input size decreases by half, the total number of iterations would be $\log(n)+1 $ As $i$ becomes $n, n/2 , n/4 \ldots$ up to $\log(n)+1 $ terms <br> So, $val(j) = n+n/2+n/4+n/8+\ldots n/2^{\log(n)} $ <br...
Consider the following property of recursively enumberable (RP) languages $$ L = \{ J \in RP \mid J \cap L_{uni} \ne \emptyset \}$$ where $L_{uni}$ is the language of the Universal Turing machine. I am wondering if $L$ is semi-decidable. That is (by definition) if the set $$ S = \{ \langle T \rangle \mid L(T)...
Question about a semi-decidable property of languages
|computability|turing-machines|
I'm trying to study for an exam and having difficulty with the following practice questions. Any help would be appreciated. 1. Give a language L such that L is not Recursive but prefix(L) is Regular. 2. Give two languages L1 and L2 such that L1 and L2 are not recursive, but L1 intersect L2 is recursive. 3. Give a ...
Recursive and regular languages
|regular-languages|recursion|
Consider the following property of recursively enumberable (RP) languages $$ L = \{ J \in \text{RP} \mid J \cap L_{uni} \ne \emptyset \}$$ where $L_{uni}$ is the language of the Universal Turing machine. I am wondering if $L$ is semi-decidable. That is (by definition) if the set $$ S = \{ \langle T \rangle \m...
I'm trying to study for an exam and having difficulty with the following practice questions. Any help would be appreciated. 1. Give a language $L$ such that $L$ is not recursive but $\text{prefix}(L)$ is regular. 2. Give two languages $L_1$ and $L_2$, such that $L_1$ and $L_2$ are not recursive, but $L_1\cap L_2$ i...
|formal-languages|regular-languages|context-free|
$\newcommand{\P}{\mathsf{P}}\newcommand{\PH}{\mathsf{PH}}$ $\newcommand{\SUM}[1]{\Sigma_{#1}^{\P}}\newcommand{\PROD}[1]{\Pi_{#1}^{\P}}$ $\newcommand{\NP}{\mathsf{NP}}\newcommand{\coNP}{\mathsf{coNP}}$ From the comments: >Why is $\SUM{1} = \NP$? Recall the definition of $\NP$ using certificates/proofs: >A langua...
$\newcommand{\P}{\mathsf{P}}\newcommand{\PH}{\mathsf{PH}}$ $\newcommand{\SUM}[1]{\Sigma_{#1}^{\P}}\newcommand{\PROD}[1]{\Pi_{#1}^{\P}}$ $\newcommand{\DELTA}[1]{\Delta_{#1}^{\P}}$ $\newcommand{\NP}{\mathsf{NP}}\newcommand{\coNP}{\mathsf{coNP}}$ From the comments: >Why is $\SUM{1} = \NP$? Recall the definition of...
Tips. 1. *Any* (infinite) unary language has regular prefix language. 2. $L_1 = a \cdot K$ and similary $L_2 = b \cdot K$ where $K$ is a well-chosen horrible language. Question. What is unary($L$)? If it is what I think, there is an easy example. Powers of two are not regular.
$\Omega(n!)$ is not a reasonable answer. The decision tree for the search problem on the ordered set is just a binary search tree. It has $\Theta(n)$ leaves. Unless they mean something non-standard by "search problem" and "decision tree". These arguments in terms of number of leaves in the decision tree are typically u...
Tips. 1. *Any* (infinite) unary language has regular prefix language. 2. $L_1 = a \cdot K$ and similary $L_2 = b \cdot K$ where $K$ is a well-chosen horrible language. Question. What is unary($L$)? If it is what I think, there is an easy example. Powers of two are not context-free: $\{ a^{2^n} \mid n\g...
Given a universe $U$ consisting of k sets of vectors with each vector $\vec{v} \in {\mathbb{F}_{p^m}}^n $. Given also another vector $\vec{c} \in {\mathbb{F}_{p^m}}^n$. Now decide if there is a set $X$ with $|X| = |U|$ and $X_i \in U_i, i = 1,2,...,k$ such that $\sum\limits_i X_i = \vec{c}$. If there is, output this s...
Find vectors with elements of finite fields that sum up to given value
|algorithms|combinatorics|discrete-mathematics|
You seem to be right. But as Raphael says, be careful. Statement 1. Note that the $L_2$ is defined using the enumerating algorithm $\cal E$ for $L_1$, not by $L_1$ itself. To decide whether $u\#v \in L_2$, decide whether both $u,v$ in $L$, and if confirmed run the enumerator $\cal E$ and see whether $u$ is output be...