instruction stringlengths 0 29.8k ⌀ |
|---|
Just use the definition: $\phi$ is in UNIQUE-SAT if and only if
$$\underbrace{\phi\in\mathrm{SAT}}_{\text{NP property}}\text{ and not }(\underbrace{\text{$\phi$ has at least two satisfying assignments}}_{\text{NP property}}).$$
Likewise: a CNF $\phi=\bigwedge_{i<n}C_i$ is in CRITICAL-SAT if and only if
$$\Bigl(\un... |
They are defined and proved to be in $D^P$ in the original article by Papadimitriou and Yannakakis, _The complexity of facets (and some facets of complexity)_ published in JCSS in 1984 ([Volume 28, Issue 2, April 1984, Pages 244-259](https://www.sciencedirect.com/science/article/pii/0022000084900680)).
Critical-SAT ... |
I want to formally show that a computational system $\mathcal M$ is *computationally universal* by showing it is *computationally equivalent* to some already known universal system, i.e. some UTM.
To show that system $\mathcal M$ is *computationally equivalent* I need to prove something along the lines of this follo... |
null |
I want to formally show that a computational system $\mathcal M$ is *computationally universal* by showing it is *computationally equivalent* to some already known universal system, i.e. some UTM.
To show that system $\mathcal M$ is *computationally equivalent* I need to prove something along the lines of this follo... |
The direction from regular expressions to MSO is easy, as MSO is versatile. For a regular expressions $R$ let us construct formulae $\varphi_R$.
$\varphi_{\emptyset} := \bot$
$\varphi_{\varepsilon} := \forall x\bot$
$\varphi_a := \exists x(P_a x \wedge \forall y(x=y))$
$\varphi_{R_1 | R_2} := \varphi_{R_1} ... |
null |
I am looking at finding acceptable binary values with maximum 2 consecutive 1s and 0s, from a range of maximum 6 bits (2^6 values).
Also, I want to rank and unrank these subset of values (in polynomial time).
I have formed this regular expression -
R = (ϵ + 1 + 11)((0 + 00)(1 + 11))*(ϵ + 0 + 00)
I want... |
Binary combinatorics with rank |
|finite-automata|regular-expressions|combinatorics|binary|rank| |
I am looking at finding acceptable binary values with maximum 2 consecutive 1s and 0s, from a range of maximum 6 bits (2^6 values).
Also, I want to rank and unrank these subset of values (in polynomial time).
I have formed this regular expression -
R = (ϵ + 1 + 11)((0 + 00)(1 + 11))*(ϵ + 0 + 00)
I want... |
In _Parameterized Complexity for Domination Problems on Degenerate Graphs_, Golovach and Villanger give an algorithm for the Dominating Threshold et problem, which is defined as follows:
**Dominating Threshold Set** <br />
**Input:** A graph $G$, and two integers $k$ and $r$<br />
**Question:** Does there exist a ... |
I am currently trying to figure out whether a flavor of the bin packing problem, which I call the "flexible bin packing problem" (F-BPP), is NP-complete.
I know that the original bin packing problem (BPP) is NP-complete, so I prove that F-BPP is NP-complete via reduction from BPP to F-BPP. I have provided my proof ... |
I am currently trying to figure out whether a flavor of the bin packing problem, which I call the "flexible bin packing problem" (F-BPP), is NP-complete.
I know that the original bin packing problem (BPP) is NP-complete, so I prove that F-BPP is NP-complete via reduction from BPP to F-BPP.
I have provided my pr... |
Here is a potential solution that I came up with for the above problem.
**Proof:**
*F-BPP is in NP:* Suppose that a solution to F-BPP is a list of 2-tuples, where each 2-tuple corresponds to a bin. The first value of the 2-tuple is the bin type, and the second value of the 2-tuple is a key-value mapping between e... |
I am currently trying to figure out whether a flavor of the bin packing problem, which I call the "flexible bin packing problem" (F-BPP), is NP-complete.
Here are the definitions for the traditional bin packing problem (BPP) and the flexible bin packing problem (F-BPP):
**Bin packing problem (BPP):**
*Optim... |
Here is a potential solution that I came up with for the above problem.
Could someone please verify my explanation for why F-BPP is in NP and my reduction of BPP to F-BPP?
**Proof:**
*F-BPP is in NP:* Suppose that a solution to F-BPP is a list of 2-tuples, where each 2-tuple corresponds to a bin. The first v... |
null |
I'm trying to create (or find) an algorithm to iterate over a range (e.g.: 1-100, etc) but randomly, without any duplicate values (similar result to random sort, etc) but without actually storing the full range in memory (such as using list(range(1, 100)) in Python, etc).
Problem is, I'm not sure how to tackle this.... |
Iterate over a range randomly without any duplicate or storing the full range in memory |
|random-number-generator|iteration| |
I'm trying to create (or find) an algorithm to iterate over a range (e.g.: 1-100, etc) but randomly, without any duplicate values (similar result to random sort, etc) but without actually storing the full range in memory (such as using list(range(1, 100)) in Python, etc).
Problem is, I'm not sure how to tackle this.... |
The best searching method for this problem will be binary search and in binary search time complexity of avg or worst case is logn.
and if in question it is not mentioned distict intergers then we can't apply binary search then it we go with linear so in that case time complexity will be o(n). |
In Operating Systems, What is the difference between Application Programs and System Programs? Also, what are examples of each? |
What is the difference between Application Programs and System Programs? |
|operating-systems| |
There aren't hard and fast definitions for this, but here's the basic idea.
A "system program" is a user program (i.e. it does not have kernel privileges) that manages some aspect of the operating system or operating environment. It typically comes installed with the operating system and cannot be uninstalled. It is... |
There aren't hard and fast definitions for this, but here's the basic idea.
A "system program" is a user program (i.e. it does not have kernel privileges) that manages some aspect of the operating system or operating environment. It typically comes installed with the operating system and cannot be uninstalled. It is... |
I've been stuck with this problem for a day or so, and I really can't figure it out. I need to modify this pseudocode so that it works when b is not just a vector, but a matrix with same number of rows as A.
I understand the idea to basically apply the row operations to the matrix b just as if it were a vector, and... |
Modify this GEPP algorithm to work with matrices |
|algorithms|matrices|linear-algebra| |
For example, the following CFG:
S$\rightarrow$aSb|$\epsilon$
A valid string within the language described by the CFG would be, e.g., "aabb".
The converted PDA has the following form:
[![enter image description here][1]][1]
The loop transitions on $q_2$ are:
1) $\epsilon,S{\rightarrow}aSb$
2) $\epsilo... |
After converting a CFG to a PDA, what is an example input string to the PDA? |
|automata|finite-automata| |
For example, the following CFG:
S$\rightarrow$aSb|$\epsilon$
A valid string within the language described by the CFG would be, e.g., "aabb".
The converted PDA has the following form:
[![enter image description here][1]][1]
The loop transitions on $q_2$ are:
1) $\epsilon,S{\rightarrow}aSb$
2) $\epsilo... |
There aren't hard and fast definitions for this, but here's the basic idea.
A "system program" is a user program (i.e. it does not have kernel privileges) that manages some aspect of the operating system or operating environment. It typically comes installed with the operating system and cannot be uninstalled. It is... |
I have a transaction grouping problem that I'm having trouble to devise the algorithm to solve it. Not even ChatGPT (version 3.5) can solve this correctly.
Suppose I have five transactions:
- Transaction ID AA value 10
- Transaction ID BB value 20
- Transaction ID CC value 15
- Transaction ID DD value 17
... |
Grouping transactions having pre-determined sums? |
|algorithms|combinatorics|knapsack-problems|summation| |
If I have a DFA with a language W, and I need to create another DFA which returns all the strings which are a concatenation of an even number of strings in W, how would I solve this?
I was considering an approach where I alternate between accepted even multiples of the DFA and unaccepted odd multiples, and essential... |
DFA for Even Concatenation of Strings from a Language |
|finite-automata|logic|haskell| |
null |
I am looking for a method in python/matlab to calculate the corner points of polytope which is an intersection of a polytope with half spaces.
I have a polytope P1 of the form
- -1<= x0 <= 1
- -1<= x1 <= 1
- -1<= x2 <= 1
- -1<= x3 <= 1
And half spaces defined by the equations as in the following format... |
compute the intersection of two polytopes and it's corner points |
|computational-geometry|linear-programming|python| |
One approach is to use the sequence of values $E(1), E(2), E(3), E(4), \dots$ where $E$ is a [format-preserving encryption](https://en.wikipedia.org/wiki/Format-preserving_encryption) cipher with a random key. This ensures the sequence won't repeat and that each element in the sequence will be in the desired range.
... |
null |
The solution you sketched is using [_recursion with memoization_](https://en.wikipedia.org/wiki/Memoization). One of the reasons to prefer dynamic programming over recursion is because it is much simpler to analyze. Let us analyze the running time of the following snippet (the recusive function is the same as yours, ... |
|algorithms|time-complexity|memoization| |
1) You say it is coNP-hard. However, it tells nothing about whether it is contained in $\mathsf{coNP}$. It only says that it is **at least as hard** as any problem in $\mathsf{coNP}$.
This problem is known to be US-hard. $\mathsf{US}$ is not known to equal $\mathsf{coNP}$. It is only known to be a subset of $\mathsf... |
An example Pyton script using the scipy.optimize.linprog function.
from scipy.optimize import linprog
import numpy as np
# Define coefficients of the half-space inequalities
A = np.array([
[-0.1, 1.0, 2.0, 0.8],
[1.5, 0.5, -3.5, 0.4],
[1.2, 1.8, 15.0, 2.5],
... |
Let me answer the two later questions:
When simulating a concrete M, the number of tapes (or head markers) is a constant. Therefore I can afford to store the number of markers seen it in the state.
When starting the simulation, we simply call the cells on all the tapes where the head is standing as cell 0. Therefor... |
To my knowledge,
The number of CPU registers can tell us the maximum RAM we can have. I am only talking about physical memory, no virtual memory or virtualization in my question.
A 32-bit CPU architecture with 32 registers, each one bit, can give us `2^32 = 4GB RAM (a bit, which is either true or false, times how... |
Understanding the Relationship Between CPU Registers Amounts and Maximum RAM in 32-bit Architectures |
|computer-architecture|operating-systems|cpu|memory-hardware| |
null |
null |
There is absolutely no causal relation between number of registers and maximum amount of RAM. Relation between register size and RAM is limited because x86 16 bit processors had segment registers which made much more addres space available. And then the RAM that you have can exceed the address space, for example some I... |
Suppose a machine $T$, and oracles $A$ and $B$ solve all problems in the complexity classes $\mathcal C_T$, $\mathcal C_A$ and $\mathcal C_B$ respectively.
Let $T^{\{A,B\}}$ denote a machine that is equivalent to a machine $T$ that has access to oracles $A$ and $B$. What would be the complexity class of all problems... |
A machine with multiple oracles |
|complexity-theory|oracle-machines| |
For example, the following CFG:
S$\rightarrow$aSb|$\epsilon$
A valid string within the language described by the CFG would be, e.g., "aabb".
The converted PDA has the following form:
[![enter image description here][1]][1]
The loop transitions on $q_2$ are:
1) $\epsilon,S{\rightarrow}aSb$
2) $\epsilo... |
For example, the following CFG:
S$\rightarrow$aSb|$\epsilon$
A valid string within the language described by the CFG would be, e.g., "aabb".
The converted PDA has the following form:
[![enter image description here][1]][1]
The loop transitions on $q_2$ are:
1) $\epsilon,S{\rightarrow}aSb$
2) $\epsilo... |
For example, the following CFG:
S$\rightarrow$aSb|$\epsilon$
A valid string within the language described by the CFG would be, e.g., "aabb".
The converted PDA has the following form:
[![enter image description here][1]][1]
The loop transitions on $q_2$ are:
1) $\epsilon,S{\rightarrow}aSb$
2) $\epsilo... |
For example on modern (32-64 bit CPUs), some sources say that manipulating a 32-bit or 64-bit integer will actually be faster than manipulating an 8-bit or 16-bit integer. This the reason for the `(u)int_fastN_t` types to be defined in C. Somehow the 8-bit instructions or 16-bit instructions are *'slower.'*
Other so... |
Why is handling word sizes smaller than the native size of a processor sometimes slower? |
|cpu| |
If $P$ is a property, let $\alpha(P)$ be its best sound abstraction. *"Sound"* means that $P\subseteq \gamma(\alpha(P))$, that is, $\alpha(P)$ *overapproximate* $P$. *"Best"* means that if $p$ is another sound abstraction of $P$, then $\alpha(P)\sqsubseteq p$, that is, $\gamma(\alpha(P))\subseteq \gamma(p)$, that is, $... |
**Question:**
I'm looking for a type of connected graph where the number of vertices is $n$ and every pair of vertices is connected by a path with a length less than $k$, where $k$ is a constant. Are there any types of graphs that satisfy this property, apart from complete graphs?
If anyone has insights or sugge... |
Searching for a Connected Graph with Vertex Count $n$ and Path Lengths Less Than $k$ |
|graphs| |
null |
null |
According to Introduction to Algorithms, to show the correctness of a greedy algorithm, we need to show:
1. Greedy Choice Property (i.e. there exists one optimal solution that includes the greedy choice)
2. Optimal Substructure
Also, the book states: "Optimal substructure... is argu[ing] that an optimal solution... |
Why do we need Optimal Substructure when proving the correctness of greedy algorithms |
|greedy-algorithms| |
The diameter of a graph is the length of the longest shortest path. Thus, you are describing graphs of bounded diameter, or graphs diameter $k-1$ in your case. Complete graphs you mention have diameter one. |
i don't understand how these f***** things are meant to work... can someone help me. every internet explanation i see is idiotic, unhelpful. even my super genius friend can't seem to help me here despite valiant efforts :(
a TM has states and a tape, and a set of symbols that can get put on the tape. when it 'read... |
how do universal turing machines actually work |
|algorithms|complexity-theory|turing-machines| |
a TM has states and a tape, and a set of symbols that can get put on the tape. when it 'reads' a symbol on the tape, it's current 'state' tells it what to do next; write a new symbol, where to move next, and what state to transition to.
i do not understand how 'reading' one set of symbols out of the limited set the... |
Actually, UTM's work just the same way as actual, physical computers -- they store their instructions in memory.
Therefore it's easiest to conceptualize a UTM with two tapes: one (read-only) that holds the description of the TM to be simulated (in some standardized format), and one that holds the data to be manipula... |
null |
Given an undirected graph where the vertices are indexed from 1 to n.
We denote each edge by $(l_i,r_i)$ where $1\le l_i<r_i \le n$.
Find the maximum matching (assuming it has $k$ edges) such that in this matching, $l_1<l_2<...<l_k$ and $r_1<r_2<...<r_k$.
This can also be thought of an interval selection problem w... |
complexity of graph matching with order constraint |
|complexity-theory|graphs|reductions|dynamic-programming|intervals| |
|algorithms|complexity-theory|graphs|dynamic-programming|intervals| |
If $P$ is a property, let $\alpha(P)$ be its best sound abstraction. *"Sound"* means that $P\subseteq \gamma(\alpha(P))$, that is, $\alpha(P)$ *overapproximates* $P$. *"Best"* means that if $p$ is another sound abstraction of $P$, then $\alpha(P)\sqsubseteq p$, that is, $\gamma(\alpha(P))\subseteq \gamma(p)$, that is, ... |
It depends entirely on the CPU. Adding an instruction costs transistors, as does making an instruction run faster, and those transistors then can't be used to improve the CPU in some other way.
As far as I know, the 8-bit adders on CPUs that support 8-bit addition are not any slower than 32-bit adders. The problem i... |
null |
I have a graph, and I want to determine the largest possible set (or partition) of nodes such that no two nodes within this set have an edge between them. I am looking for an efficient algorithm to solve this problem.
For instance, given the following graph:
1: [2]
2: [1, 3, 5, 6, 4]
3: [2, 4]
4: [3, 5, 6, 2]
... |
Finding the Largest Partition of Non-Connected Nodes in a Graph in polynomial time |
|algorithms|complexity-theory|graphs|np-complete|discrete-mathematics| |
what is the time complexity of:
for (i = 1; i <= n; i = 2*i)
for (j = 0; j < i; j++)
sum++;
?
I thought it is O(nlogn) since the otter loop run logn time and the inner loop run i time
|
time complexity of loops |
|algorithms|time-complexity|functional-programming|c++|code-generation| |
I think I have developed a logic circuit using combinational logic and flip flops which learn to perform the XNOR logic between 2 bits.It is a kind of state machine. Suppose we built a computer made of blocks which use a built in neural network (such as mine logic circuit).Wouldnt that save a lot of memory and let us r... |
Neural networks as building blocks of a computer |
|computer-architecture|neural-networks|memory-management|cpu| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.