instruction stringlengths 0 29.8k ⌀ |
|---|
The problem is NP-hard. (It is at least as hard as maximum independent set, which can be seen by setting $G$ to be the fully connected graph.)
Therefore, a reasonable approach is to use an off-the-shelf ILP solver. Introduce zero-or-one variables $x_{v}$, with the intended meaning that $x_v=1$ means that $v \in \t... |
null |
null |
null |
The formal definition of the pushdown automata according to Mike Sisper's book on theory of computation is as follows: [![formal definition][1]][1]. The transition function however only takes in one symbol from the stack (after popping it) and returns sets where each set only has a single letter from the stack alphabet... |
Can a pushdown automaton write more than one symbols on to stack on one reading from from input tape? |
|complexity-theory|computability|automata|computational-geometry|pushdown-automata| |
Recently I am training for an algorithm contest. One of the older textbooks for that contest contains this question:
>Generate all strings $S$ that contained the letters $\begin{Bmatrix}A, B, C\end{Bmatrix}$ only, and satisfy these
requirements:
>1) The string's length (number of characters) must be exactly 10... |
Generate all strings with length 100, only contains the letter $\begin{Bmatrix}A, B, C\end{Bmatrix}$ and satisfy some oher requirements |
|algorithms| |
The formal definition of the pushdown automata according to Mike Sisper's book on theory of computation is as follows: [![formal definition][1]][1]. The transition function however only takes in one symbol from the stack (after popping it) and returns sets where each set only has a single letter from the stack alphabet... |
Except for $\emptyset$ and $\mathbb{N}$, every set $A$ in P is P-complete. The question is thus essentially "given a poly-time oracle $A$, what are $P^A$ and $NP^A$?"
The answer is that these are $P$ and $NP$ respectively. For any poly-time computable set $A$ there exists a Turing machine $M_A$ that computes it. ... |
Say I have boolean formula in form of a `CNF(x1,x2,...)` with $x_i$ being boolean variables.
Testing the satisfiability of the CNF is the SAT problem, i.e. determine if there are $x_i$ for which the formula becomes True. So far I understand, this assumes that the variables are independent.
But what if my $x_i$ ar... |
How to solve boolean SAT with equality constraints |
|satisfiability|boolean-algebra|constraint-satisfaction| |
Nevermind, I guess the answer is very simple.
Simply test if `CNF(x_1,x_2,...) & CONST-CNF(x_1,x_2,...)` is satisfiable.
If the problem and constraints are already in CNF form this a trivial append operation.
|
After $m$ iterations, the interval size is
$$\frac{t_2-t_1}{2^m}=\frac{n}{2^m}.$$
This becomes smaller than $k^{-2}$ when
$$\frac{n+1}{2^m}\le\frac1{k^2}$$
or
$$m\ge\log_2(k^2n)=2\log_2(k)+\log_2(n).$$ |
Let $\mathcal{F}$ be a family of pairs of the form $(A,b)$, where $A$ is an integer matrix and $b$ is an integer vector with the same number of rows. For every integer $k$, define $L(\mathcal{F}, k)$ to be the following family of decision problems.
> INPUT: a pair $(A,b)\in \mathcal{F}$.
>
> OUTPUT: "True" if ther... |
You are given $n$ lists. The $i$-th list contains $k_i$ subsets of $\{1, \ldots, m\}$. You are also given an integer $s$. You should decide whether it's possible to pick up exactly one element (that is subset of $\{1, \ldots, m\}$) from each list, such that the cardinality of a union of all picked subsets is at most $s... |
Is this set choice problem NP-hard? |
|complexity-theory|np-complete|reductions|np-hard| |
Let $\mathcal{F}$ be a family of pairs of the form $(A,b)$, where $A$ is an integer matrix and $b$ is an integer vector with the same number of rows. For every integer $k$, define $L(\mathcal{F}, k)$ to be the following family of decision problems.
> INPUT: a pair $(A,b)\in \mathcal{F}$.
>
> OUTPUT: "True" if ther... |
An optimization problem can be described by two functions $f$ and $g$, such that:
* $f$ a predicate representing the constraints: $f(x,y)$ is True if the output $y$ is feasible for the input $x$;
* $g$ is an integer-valued function representing the objective value: $g(x,y)$ is the value of the output $y$ for the in... |
Based on the given definition, you cannot have a single transition that pushes multiple symbols from a single state. But you can simulate it. The idea here is to add auxiliary states and take advantage of $\varepsilon$ in the transition. Say you want to push $abc$ ($c$ will be the topmost symbol after) when reading $1$... |
Based on the given definition, you cannot have a single transition that pushes multiple symbols from a single state. But you can simulate it. The idea here is to add auxiliary states and take advantage of $\varepsilon$ in the transition. Say you want to push $abc$ ($c$ will be the topmost symbol after) when reading $1$... |
The short answer is that the "untyped lambda calculus" from 1932 is not the modern untyped lambda calculus. The modern one comes from a later (I think) realization that just the lambda/application part can be used as a computational system.
The calculus from 1932 was developed to be a logical system. There are addit... |
## Question
Is it possible to find a solution to the weighted minimum dominating set problem, by solving a (related), unweighted minimum dominating set?
## Elaboration
In essence, can one convert a `weighted_input_graph` into an `unweighted_input_graph` such that the minimum dominating set of the `unweighted_input... |
Converting a weighted minimum dominating set into an unweighted minimum dominating set? |
|graphs|np-hard|decision-problem|weighted-graphs| |
The short answer is that the "untyped lambda calculus" from 1932 is not the modern untyped lambda calculus. The modern one comes from a later (I think) realization that just the lambda/application part can be used as a computational system.
The calculus from 1932 was developed to be a logical system. There are addit... |
Let $\mathcal{I} = \{I_0, \ldots, I_{m-1}\}$ a collection of subset of some universe $U$.
We want to find a partition $P$ of $\mathcal{I}$ of minimal cardinality such that the intersection of each set in $P$ is **not** empty.
Is this, or the corresponding decision problem, a well known problem? I found many sim... |
Minimal Hitting Sets Problem |
|decision-problem|sets|scheduling|set-cover| |
Yes, this decision problem is NP-hard. The following is a proof.
------
Name this decision problem the nested-bounded-union problem.
Consider the special case when all $n$ lists are the same and hence all $k_i$ are equal to some integer $k$. The problem becomes "given $k$ subsets of $\{1,\cdots,m\}$ and an int... |
null |
Is it NP-hard to decide the existence of n subsets picked from n lists of subsets the union of which contains at most s elements? |
I have been reading up on the bin packing problem. In the bin packing problem, we are given $n$ items with sizes $a_1,a_2,\dots, a_n$ such that
$$
1 > a_1 \geq a_2 \geq \dots \geq a_n > 0
$$
The goal is to pack the items into bins such that each bin can hold any subset of items of total size at most 1, so as to min... |
Hardness of the bin packing problem |
|algorithms|complexity-theory|algorithm-analysis|np-hard|approximation| |
**Seeking an indexing data structure that is smaller than quadratic in space.**
As part of an NLP algorithm using word embeddings of 300-dimensions, I am trying to improve the speed of Word Mover's Distance (WMD). (Isn't everybody?) Computing the cost matrix is expensive, as it is size MxN (where M and N are the num... |
Space efficient data structure to store precomputed All Nearest Neighbors in high dimensions |
|algorithms|space-complexity|nearest-neighbour| |
I have been reading up on the bin packing problem. In the bin packing problem, we are given $n$ items with sizes $a_1,a_2,\dots, a_n$ such that
$$
1 > a_1 \geq a_2 \geq \dots \geq a_n > 0
$$
The goal is to pack the items into bins such that each bin can hold any subset of items of total size at most 1, so as to min... |
NPO is defined to be the class of optimization problems whose decision versions are in **NP**. \
I would like to get the complexity class of optimization problems whose decision versions are in **P**.
Is such a complexity class already defined? |
Class of optimization problems whose decision versions are in P |
|complexity-theory|optimization|np|complexity-classes| |
I have been reading up on the bin packing problem. In the bin packing problem, we are given $n$ items with sizes $a_1,a_2,\dots, a_n$ such that
$$
1 > a_1 \geq a_2 \geq \dots \geq a_n > 0
$$
The goal is to pack the items into bins such that each bin can hold any subset of items of total size at most 1, so as to min... |
Solving a weighted minimum dominating set problem with its unweighted counterpart? |
null |
$$\begin{align}5-2&\to3\\6-1&\to5\\3-4&\to-1\to7,\text{ borrow }\color{green}1\\4-3-\color{green}1&\to0\end{align}$$ |
$$\begin{matrix}&4&3&6&5\\&\scriptsize\color{green}{-1}&\scriptsize\color{green}{+8}\\-&3&4&1&2\\\hline&0&7&5&3\end{matrix}$$
There is a borrow from the "thousands" to the "hundredths". |
null |
**Seeking an indexing data structure that is smaller than quadratic in space.**
As part of an NLP algorithm using word embeddings of 300-dimensions, I am trying to improve the speed of [Word Mover's Distance](http://proceedings.mlr.press/v37/kusnerb15.pdf) (WMD). (Isn't everybody?) Computing the cost matrix is expen... |
You've not specified which notion of P-completeness you mean, but no matter which one, note that every $P$-complete set is in particular in $P$. The question is thus essentially "given a poly-time oracle $A$, what are $P^A$ and $NP^A$?"
The answer is that these are $P$ and $NP$ respectively. For any poly-time comp... |
This is NP-hard and is closely related to the set cover problem.
Define $s_x = \{I_j \mid x \in I_j\}$ for each $x \in U$. The set cover problem is to find a minimal cardinality set $X$ such that $\cup_{x \in X} s_x = U$. Any solution to this set cover problem immediately yields a partition $P$ of the same cardina... |
## Question
Is it possible to find a solution to the weighted minimum dominating set problem, by solving a (related), unweighted minimum dominating set?
## Elaboration
In essence, can one convert a `weighted_input_graph` into an `unweighted_input_graph` such that the minimum dominating set of the `unweighted_input... |
**Seeking an indexing data structure that is smaller than quadratic in space.**
As part of an NLP algorithm using word embeddings of 300-dimensions, I am trying to improve the speed of [Word Mover's Distance](http://proceedings.mlr.press/v37/kusnerb15.pdf) (WMD). (Isn't everybody?) Computing the cost matrix is expen... |
The short answer is that the "untyped lambda calculus" from 1932 is not the modern untyped lambda calculus. The modern one comes from a later (I think) realization that just the lambda/application part can be used as a computational system.
The calculus from 1932 was developed to be a logical system. There are addit... |
null |
**Seeking an indexing data structure that is smaller than quadratic in space.**
As part of an NLP algorithm using word embeddings of 300-dimensions, I am trying to improve the speed of [Word Mover's Distance](http://proceedings.mlr.press/v37/kusnerb15.pdf) (WMD). (Isn't everybody?) Computing the cost matrix is expen... |
null |
I can reduce 3-Sat to the following NP-Complete decision problem:
Let $S = ${0,1,...,s-1}, $D \subseteq S$ and $P$ be a multivariate polynomial in $n$ variables. Decide yes iff there exists $\vec x \in D^{n}$ such that $P(\vec x) \neq 0 (mod \ s)$.
That got me thinking that I can make the problem seem much harde... |
What are the sizes of 'functions' and 'fields' in the context of input to a decision problem? |
|complexity-theory|time-complexity| |
You can't. First, you have to specify the problem in a precise way, before it is meaningful to talk about its time complexity. If you are not sure how to formulate the problem exactly, then you can't talk about its time complexity yet.
Part of the problem statement involves specifying how the inputs are represente... |
Suppose we have an undirected graph $(V, E)$ and we want to know [whether or not it has a vertex cover](https://en.wikipedia.org/wiki/Vertex_cover) with at most $s$ vertices.
Let $n = |E|$, and for each edge $e_i = \{u, v\} \in E$ let the $i$th list be $\{\{u\}, \{v\}\}$. Then there is a vertex cover of size at most... |
null |
|automata|pushdown-automata| |
null |
Suppose we have an undirected graph $(V, E)$ and we want to know [whether or not it has a vertex cover](https://en.wikipedia.org/wiki/Vertex_cover) with at most $s$ vertices.
Let $m = |V|$ and $n = |E|$, and for each edge $e_i = \{u, v\} \in E$ let the $i$th list be $\{\{u\}, \{v\}\}$. Then there is a vertex cover o... |
Find a walk with the shortest length starting from a vertex $v$ , passing through all vertices and returning back to $v$?
We allow vertices and edges to be repeated along the walk. The *length* of a walk is the number of edges it has, counting repeated edges as many times as they appear.
I'm not sure if such ... |
Find a shortest walk starting from a vertex $v$ , passing through all vertices and returning back to $v$? |
|graphs|graph-traversal| |
Find a walk with the shortest length starting from a vertex $v$ , passing through all vertices and returning back to $v$?
We allow vertices and edges to be repeated along the walk. The *length* of a walk is the number of edges it has, counting repeated edges as many times as they appear.
I'm not sure if such ... |
<!-- All graphs here are simple finite undirected graphs.-->
What you are looking at is called "[Hamiltonian walk](https://mathworld.wolfram.com/HamiltonianWalk.html)". People have studied the problem of finding Hamiltonian walk extensively as seen with [a google scholar search](https://scholar.google.com/scholar?q=... |
How can we find a walk with the minimal length starting from a vertex $v$, passing through all vertices and returning back to $v$?
We allow vertices and edges to be repeated along the walk. The *length* of a walk is the number of edges it has, counting repeated edges as many times as they appear.
I'm not sure... |
How can we find a shortest closed walk passing through all vertices? |
|graphs|np-complete|terminology|np-hard|graph-traversal| |
An optimization problem can be described by two functions $f$ and $g$, such that:
* $f$ is a binary predicate representing the constraints: $f(x,y)$ is True if the output $y$ is feasible for the input $x$;
* $g$ is an integer-valued function representing the objective value: $g(x,y)$ is the value of the output $y$ ... |
I wish to learn CO&A (computer organisation and architecture) from scratch via some toy system and its simulator. I found the following resource: [Toy Machine](https://introcs.cs.princeton.edu/java/62toy/) developed at Princeton University.
**Toy Machine**, however, is quite old and although a good starting point, d... |
Learn computer architecture and organisation via an oversimplified machine |
|computer-architecture|simulation|instruction-set| |
How would one design an algorithm to PAC learn linear threshold functions with random classification noise using membership queries? |
PAC Learning LTFs with random classification noise and membership query |
|machine-learning| |
How would one design an algorithm to PAC learn linear threshold functions with random classification noise using membership queries?
More formally, the learner has access to unlabeled examples from an unknown distribution $D$ on $X$ and membership query access to the target concept. |
null |
null |
Random number generators generally fit into 3 categories IMO:
1. ad-hoc designs serving as stub to be replaced by something else if this ever happens,
2. considerate designs aiming at achieving statistical quality and usable in their respective application domain,
3. cryptographic RNGs of various kinds and purpose... |
The awkward status of Mersenne Twister |
|efficiency|pseudo-random-generators|algorithm-design| |
I was requested to draw the graph of a finite state machine whose language is exactly
$$L = \{ w \in \{0, 1\}: w \text{ has $2k$ ones and $3q$ zeros }\}$$
In other words, there must be an even number of ones and the number of zeros must be a multiple of $3$.
I have failed in my attempts to draw the graph of ... |
Creating a deterministic finite automaton given a specific language |
|automata|finite-automata|logic| |
null |
null |
There is a general approach, though I am not sure knowing it is of practical use. Fix an alphabet $\Sigma$ and let $L$ be a regular language. Define the following equivalence relation on $\Sigma^*$: $x \sim y$ precisely when for all $z$, $xz \in L$ if and only if $yz \in L$. You can now construct a DFA with states $... |
One way to look at these specific problems is to have states labeled $(x,y)$ where $x$ will correspond to the ones seen so far and $y$ similarly to the zeros so far. These are taken mod 2 or mod 3 respectively so, for instance the $y$ value 2 will represent $2,5,8,11,\dots$.
You'll then have six states: $(0,0),(1,0)... |
null |
The Hidden Subgroup Problem (HSP) is an extremely prevalent problem in quantum computation, especially for factorization in Shor’s algorithm.
The problem is stated
> Given an oracle for some function, $f: G \mapsto X$, that is promised to satisfy $g_1 H = g_2 H \iff f(g_1) = f(g_2)$
But the HSP is often spoken... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.