instruction
stringlengths
0
29.8k
⌀
If you're not absolutely set on the normal SAT, your idea is already a reduction to MIN-ONES (over positive CNF formulae), which is basically SAT, but where you can set at most $k$ variables to true (strictly it's the optimization version where we minimize on the number of true variables). Similarly if you head in a...
It looks like you are trying to compute a **hypergraph transversal** of size $k$. That is, $\{T_1,\dots,T_m\}$ is your hypergraph, and $S$ is your transversal. A standard translation is to express the clauses as you have, and then translate the length restriction into a cardinality constraint. So use your existing e...
I'm reading Garey & Johnsons _"Computers and Intractability"_ and I'm at the part _"Some techniques for solving NP-Completeness"_. Here's the text about Proof by Restriction: > Proof by restriction is the simplest, and perhaps most frequently > applicable, of our three proof types. An NP-completeness proof by > re...
NP-Completeness - Proof by Restriction
|np-complete|proof-techniques|proof-complexity|
I'm reading Garey & Johnsons _"Computers and Intractability"_ and I'm at the part _"Some techniques for solving NP-Completeness"_. Here's the text about Proof by Restriction: > Proof by restriction is the simplest, and perhaps most frequently > applicable, of our three proof types. An NP-completeness proof by > re...
|complexity-theory|np-complete|proof-techniques|proof-complexity|
I have a group of n sets for which I need to calculate a sort of "uniqueness" or "similarity" value. I've settled on the [Jaccard index](http://en.wikipedia.org/wiki/Jaccard_index) as a suitable metric. Unfortunately, the Jaccard index only operates on two sets at a time. In order to calculate the similarity between...
Set Similarity - Calculate Jaccard index without quadratic complexity
|algorithms|time-complexity|
There is an implicit (trivial) reduction, from each instance of the restricted version to itself, really just relabelling it as an instance of the unrestricted problem. To think about it from the other end, if we have a problem $\Pi$ where a restricted subproblem $\Pi'$ is already NP-complete, and we had a PTIME alg...
[Von Neumann machine][1]. And since this answer has to be at least 30 characters long, I need to add another sentence. [1]: http://en.wikipedia.org/wiki/Von_Neumann_architecture
It is said that "The Turing machine is not intended as practical computing technology, but rather as a hypothetical device representing a computing machine. Turing machines help computer scientists understand the limits of mechanical computation." [Wikipedia] So on which model current machines are built?
Mathematical model on which current computers are built
|turing-machines|machine-models|
It is not really clear to me, how and if I can do boosting for correctness (or error reduction) on a [BPP](http://en.wikipedia.org/wiki/BPP_%28complexity%29) (bounded-error probabilistic polynomial-time) search problem. Can anyone of you explain me how it works? With BPP search, I mean a problem that can have false ...
null
|complexity-theory|reductions|np-hard|
|complexity-theory|np-complete|proof-techniques|
|turing-machines|computer-architecture|machine-models|
The one closest to typical CPUs is probably the *register machine* or *random access machine* ([RAM](https://en.wikipedia.org/wiki/Register_machine)). A RAM has * an infinite number of registers, each of which stores an arbitrarily large number, * a set of operations on these registers (typically $\{+ 1, = 0\}$),...
null
As the net-evergreen [The Physics of Santa](http://www.snopes.com/holidays/christmas/santa/physics.asp) establishes, it is physically impossible for Santa to get a gift to every kid on the planet. Route planning won't help much there, but can a good planning algorithm at least make sure that every kid gets a gift once ...
Can Santa be both fair and efficient?
|complexity-theory|graphs|scheduling|
In linear time logic, is $\mathbf{GF}p$ equivalent to $ \mathbf{G}p$ ? *$\mathbf{GF}p$ means that it is always the case that p is true eventually.* Let $\mathbf{G} p$ be defined as: $\forall j \ge0,\ p$ holds in the suffix $q_j, q_{j+1}, q_{j+2},\ldots$ and since: *formula $φ$ holds for state machine $M$ if...
Equivalence of GFp and Gp in LTL
|linear-temporal-logic|
No, not equivalent and not redundant. Consider $p$ being true if and only if $j$ is even. $\mathbf{G}p$ is not true (obviously, since $p$ is false in every odd state), but $\mathbf{GF}p$ is always true.
There are many popular languages. But, computer scientists tell us that in order to understand the behaviour of programs in those languages definitely and unambiguously argue upon program behavior (e.g. prove their identity), we need to translate them into another, well understood language. They call such language "a s...
what is semantics?
It looks like you are trying to compute a **hypergraph transversal** of size $k$. That is, $\{T_1,\dots,T_m\}$ is your hypergraph, and $S$ is your transversal. A standard translation is to express the clauses as you have, and then translate the length restriction into a cardinality constraint. So use your existing e...
I'm reading Garey & Johnsons _"Computers and Intractability"_ and I'm at the part _"Some techniques for solving NP-Completeness"_. Here's the text about Proof by Restriction: > Proof by restriction is the simplest, and perhaps most frequently > applicable, of our three proof types. An NP-completeness proof by > re...
null
I need a concise definition of the "state of an object" in object-oriented programming (for a paper). For about half I day I searched for a paper that I can cite on this topic, but I couldn't find one. All the papers I found where mostly general papers on object-oriented programming and didn't define the state o...
Definition of the state of an object in OOP
|terminology|reference-request|programming-languages|object-oriented|
If the relation $R$ lies in the complexity class P (or even BPP), then boosting works by running your algorithm many times, and testing whether its output satisfies $R$. When $x \in S$, this fails with probability $\mu^N$, where $N$ is the number of times you run $A$. When $x \notin S$, this never fails. This way you c...
I'm reading Garey & Johnsons _"Computers and Intractability"_ and I'm at the part _"Some techniques for solving NP-Completeness"_. Here's the text about Proof by Restriction: > Proof by restriction is the simplest, and perhaps most frequently > applicable, of our three proof types. An NP-completeness proof by > re...
You can take a look to (and cite) the book ["Object-Oriented Analysis and Design" by G. Booch][1]: *... An object is an entity that has state, behavior, and identity. The structure and behavior of similar objects are defined in their common class. The terms instance and object are interchangeable.* *We will con...
I need a concise definition of the "state of an object" in object-oriented programming (for a paper). For about half I day I searched for a paper that I can cite on this topic, but I couldn't find one. All the papers I found were mostly general papers on object-oriented programming and they didn't define the state o...
null
I need a concise definition of the "state of an object" in object-oriented programming (for a paper). For about half of a day I searched for a paper that I can cite on this topic, but I couldn't find one. All the papers I found were mostly general papers on object-oriented programming and they didn't define the stat...
It looks like you are trying to compute a **hypergraph transversal** of size $k$. That is, $\{T_1,\dots,T_m\}$ is your hypergraph, and $S$ is your transversal. A standard translation is to express the clauses as you have, and then translate the length restriction into a cardinality constraint. So use your existing e...
null
I did Google for it but I found that they refer to Random Access method instead of the Direct Access method. However I found the following phrase in Wikipedia: "The direct access capability, occasionally and incorrectly called random access" Source: http://en.wikipedia.org/wiki/Direct_access_storage_device Not...
What is Random Access method?
|memory-allocation|access-control|
I'm reading Garey & Johnsons _"Computers and Intractability"_ and I'm at the part _"Some techniques for solving NP-Completeness"_. Here's the text about Proof by Restriction: > Proof by restriction is the simplest, and perhaps most frequently > applicable, of our three proof types. An NP-completeness proof by > re...
null
I have a book that proves the halting problem with this simple statement: $$ A_{TM} \le mHALTING \le mHALTING^\varepsilon $$ It states that halting problem reduces to the language consisting of $\langle M, \omega \rangle$ for which a turing machine $M$ accepts $\omega$ is undecidable. What does this mean? Wh...
Why does $A_{TM} \le mHALTING \le mHALTING^\varepsilon$?
|turing-machines|undecidability|
I can think of a **O(n log n)** solution: - Input: the set of all 2-D points on your graph in the form of `(a, b)` - where `a` is the x-coordinate and `b` is the y-coordinate. Assumption: points are unique. **O(n)** - Build a HashTable to count the occurrences of each distinct y-coordinate, `b`, over this set. (i.e...
I have encountered the following problem. We have N points in discrete coordinates,distributed through a plane with vertical axis [1..Y] and horizontal axis [1..X]. We can perform the action of removing all points with vertical coordinate y, in short removing y. [ad image example][1] How many y must we remove...
Is the following NP?
|computability|
To me it mostly is a question of viewpoint. If I define objects based on smaller one, I do it inductively, so that is bottom-up. If I solve a problem by breaking it down in smaller pieces that are solved in the same manner I call it recursion, that is top-down. (edit) PS. See a similar question in our Mathematics s...
I have encountered the following problem. We have $N$ points in discrete coordinates,distributed through a plane with vertical axis $[1..Y]$ and horizontal axis $[1..X]$. We can perform the action of removing all points with vertical coordinate $y$, in short removing $y$. ![example][1] How many $y$ must we re...
|algorithms|np-complete|
I have a book that proves the halting problem with this simple statement: $$ A_\text{TM} \le_m \text{HALTING} \le_m \text{HALTING}^\varepsilon $$ It states that halting problem reduces to the language consisting of $\langle M, \omega \rangle$ for which a Turing machine $M$ accepts $\omega$ is undecidable. W...
Why does $A_\text{TM} \le_m \text{HALTING} \le_m \text{HALTING}^\varepsilon$?
|turing-machines|reductions|undecidability|halting-problem|
Would someone please clarify for me the difference between direct and random access? Specifically, why does this Wikipedia article on [Direct Access Storage Devices][1] distinguish between the two: > The direct access capability, occasionally and incorrectly called > random access (although that term survives ...
Direct vs. Random Access
null
When you speak about _direct access_ in small amount of time that could also be logarithmic, you speak about _secondary devices_, so hard disks, floppys, USB flash drives, etc. When you speak about random access you mean that access time to any part of memory **is constant**. This is very hard to achieve with second...
I have encountered the following problem. We have $N$ points in discrete coordinates,distributed through a plane with vertical axis $[1..Y]$ and horizontal axis $[1..X]$. We can perform the action of removing all points with vertical coordinate $y$, in short removing $y$. ![example][1] What is the least numbe...
I'm reading Garey & Johnsons _"Computers and Intractability"_ and I'm at the part _"Some techniques for solving NP-Completeness"_. Here's the text about Proof by Restriction: > Proof by restriction is the simplest, and perhaps most frequently > applicable, of our three proof types. An NP-completeness proof by > re...
Is the following NP-complete?
I have encountered the following problem. We have $N$ points in discrete coordinates,distributed through a plane with vertical axis $[1..Y]$ and horizontal axis $[1..X]$. We can perform the action of removing all points with vertical coordinate $y$, in short removing $y$. ![example][1] What is the least numbe...
If you mean by "the number of $x$ that have points" that the number of distinct values $x$ such that there is a point $(x, y)$ such that $y$ has not been removed is at most $X/2$, then your problem is extremely similar to Set Cover, which is $\mathbf{NP}$-complete. Your problem would be the variant in which you ask ...
Most of the classic examples of dynamic programming algorithms have run-times such as $n$ or $n^2$. Are there any natural examples with a $O(n \log n)$ run-time?
Dynamic programming algorithms with log in the run-time
|algorithms|dynamic-programming|
null
To expand on my comment: While sorting is not doing a "table lookup", remember the actual definition of DP: >Method for solving problems that have optimal substructure. We see that a divide-and-conquer approach for sorting satisfies this.
One natural example is finding the longest increasing subsequence of a sequence of $n$ numbers. Candidate subsequences can be linked in the input sequence. This is a fairly common exercise, and works for other type of subsequences, too. It is actually the exercise 15.4-6 in the 3rd edition of the Cormen et al. book too...
There is an implicit (trivial) reduction, from each instance of the restricted version to itself, really just relabelling it as an instance of the unrestricted problem. To give an example that I think is more illuminating than Partition and Multiprocessor Scheduling, we can look at Vertex Cover and Hitting Set: >...
[Von Neumann machine][1], and if you prefer something more mathematical, look instead at [RAM machine][2]. [1]: http://en.wikipedia.org/wiki/Von_Neumann_architecture [2]: http://en.wikipedia.org/wiki/Random_access_machine
null
From my Googling, it appears that call by value-result is similar to call by reference in that it changes values in the caller, but it's different in that the changes don't take place until the callee exits, and that if the same variable is passed as more than one argument, it'll be treated as separate values in the ca...
Call by value-result vs. call by reference?
|programming-languages|
I'm not very familiar with Pascal, but there are some scoping issues. The 2nd line of `p` modifies global variable `a`. When you pass by reference, line 1 of `p` also modifies `x` which is the same as global `a`. When you pass by value, line 1 does not modify global `a`, but line 2 still does, using the local val...
**No**, but not for the reasons other people have given. The difference between recursion and induction is not that recursion is "top-down" and induction is "bottom-up." Induction is isomorphic to something called "primitve recursion," but, in general, **recursion is strictly more powerful than induction**. The dist...
If the relation $R$ lies in the complexity class P (or even BPP), then boosting works by running your algorithm many times, and testing whether its output satisfies $R$. When $x \in S$, this fails with probability $\mu^N$, where $N$ is the number of times you run $A$. When $x \notin S$, this never fails. This way you c...
null
Given a set of coins with different denominations $c1, ... , cn$ and a value v you want to find the least number of coins needed to represent the value v. E.g. for the coinset 1,5,10,20 this gives 2 coins for the sum 6 and 6 coins for the sum 19. My main question is: when can a greedy strategy be used to solve t...
When can a greedy algorithm solve the coin change problem?
|algorithms|combinatorics|greedy-algorithms|
Both seems same. We use `Random Access` when for primary memory (RAM) and `Direct Access` for secondary storage. For [Direct Access Storage Device][1], this is written The access methods for DASD are Sequential, Indexed and Direct. So, here `Direct` means `Random` only [1]: http://en.wikipedia.org/wik...
One of the key differences between the different paradigms for data management is the underlying structure used to bind pieces of data together. IMHO, the difference between structured, unstructured, semi-structured is not precise enough : the point is that the underlying structure may be more or less flexible. This fo...
What would be the process state in a multi threaded process, in which threads are in different states (running, waiting, blocked etc)
Process state in multi threaded process