instruction
stringlengths
0
29.8k
⌀
As Artem notes in his [comment](http://cs.stackexchange.com/questions/2222/complexity-np-complete-and-p-complete#comment5885_2222), the question is rather unmeaning as you can define whatever you like. Let me illustrate where things start to be "kind of silly". Some notation: For two decision problems $P,Q$, write $...
Are there non-standard reductions for NP and P?
I get the proof of going from an enumerator to a Turing Machine (keep running enumerator and see if it matches input) but I don't see how the other way works. According to my notes and the book (Intro to the Theory of Computation - Sipser), to get Turing enumerator from a Turing machine, we basically write all combi...
There are a few things wrong with this automata: 1. It does not accept the empty string. 2. It is not a DFA – there should be no undefined transitions in a DFA. 3. It only accepts strings of length three, not multiples of three. You are on the right track. Dealing with 1. and 3. above are fairly straightforward...
(I've asked a similar question [on cstheory stack][1]) <strike>I can't find the reference right now, but I remember about</strike> [Here it is][2] an algorithm that on a non-lazy pure functional programming language has an $\Omega(n \log n)$ complexity, while the same algorithm in imperative programming is $\Omega(n...
*I've asked a similar question [on cstheory.SE][1].* According to [this answer on Stackoverflow][2] there is an algorithm that on a non-lazy pure functional programming language has an $\Omega(n \log n)$ complexity, while the same algorithm in imperative programming is $\Omega(n)$. Adding lazyness to the FP language...
In a functional programming language that is powerful enough (for example, with data types to implement [closures][1]) you can eliminate all uses of higher order by the transformation of [defunctionalization][2]. Since this method is used to compile this kind of language, you can reasonably assume that this does not af...
null
Two processors $A, B$ with inputs $a \in \{0, 1\}^n$ (for $A$) and $b \in \{0, 1\}^n$ (for $B$) want to decide whether $a = b$. $A$ does not know $B$’s input and vice versa. A can send a message $m(a) \in \{0, 1\}^n$ which $B$ can use to decide $a = b$. The communication and computation rules are called a *proto...
Let's start with the following observation: > Let $max$ denote the maximum of the sequence $a_1,...,a_n$, and let $min$ denote its minimum. If $a_1=max$, then choosing $b_1=b_2=...=b_n=\lfloor(max+min)/2\rfloor$ is optimal. Why is this the case? Well, since the sequence starts with the maximum, either we ...
Let's start with the following observation: > Let $max$ denote the maximum of the sequence $a_1,...,a_n$, and let $min$ denote its minimum. If $a_1=max$, then choosing $b_1=b_2=...=b_n=\lfloor(max+min)/2\rfloor$ is optimal. Why is this the case? Well, since the sequence starts with the maximum, either we ...
What would be the standard topics covered in an 'Advanced Placement Computer Science A' test? Is there any good study reference someone can share? **Edit: Answer** An adjustment for my search term returned a [Wikipedia page][1] just for this type of exam and the AB version. @Gigili suggest [Barron's AP Comput...
null
This is halfway a joke question, but I would like to know the answer anyway. Can iPhone be considered turing complete, if I cannot load my code on it without Apple's approval? (if this question is completely off for some reason, I would like to know, too)
Is iPhone turing complete?
|turing-completeness|
|programming-languages|concurrency|
As Artem notes in his [comment](http://cs.stackexchange.com/questions/2222/complexity-np-complete-and-p-complete#comment5885_2222), the question is rather unmeaning as you can define whatever you like. Let me illustrate where things start to be "kind of silly". Some notation: For two problems $P,Q$, write $P \leq_F ...
What would be the standard topics covered in an 'Advanced Placement Computer Science A' test? Is there any good study reference someone can share? **Edit: Answer** An adjustment for my search term returned a [Wikipedia page][1] just for this type of exam and the AB version. [1]: http://en.wikipedia.org/wi...
{"Voters":[{"Id":31,"DisplayName":"Dave Clarke"},{"Id":472,"DisplayName":"mrm"},{"Id":98,"DisplayName":"Raphael"}]}
I think that if you could reuse pontoons you would have a http://en.wikipedia.org/wiki/Minimum_spanning_tree problem, which you could solve in polynomial time. That suggests two approaches with unknown but perhaps affordable complexity. 1) Use the cost of minimum spanning tree solution (whether it reuses pontoons or...
After the drawing, This is still an NPC problem. Even if we cut the problem down to each pontoon can assume 1 of n positions (i.e. known connection lines. To get the most optimal answer, we would have to try each pontoon in each position, adding their distance to get to those repsective positions each time, and compa...
First: This is not the Travelling Salesman Problem. The TSP requires the identification of a minimal weight Hamiltonian cycle; this cycle does not require a cycle, or even a minimal weight path at all. It requires a minimal cost *construction* of a connecting set of edges, where the construction cost is based on mov...
I have a problem in my mind, I think it is a NPC problem but I don't know how to prove it. Here is the problem: There are **k** islands in a very big lake, and there are **n** fan-shaped pontoons. Those pontoons are in the same size but have different initial directions and are in different original positions in...
Need a NP-Complete Proof on an example
|np-complete|np-hard|
Can the iPhone be considered [turing complete](http://en.wikipedia.org/wiki/Turing_completeness), if I cannot load my code on it without Apple's approval? Is it still considered a *universal machine*?
null
Can the iPhone be considered [Turing-complete](http://en.wikipedia.org/wiki/Turing_completeness), if I cannot load my code on it without Apple's approval? (This is halfway a joke question, but I would like to know the answer anyway.)
Is an iPhone Turing-complete?
There are many closed-platform computing devices on the market these days that do not have an (normaly/easily accessible) general-purpose programming interface. New applications are loaded (solely) from so-called app-stores. Now some maintainers of app-stores do not allow *all* apps to be published; they censor code (f...
Is a device with restrictive execution policies Turing-complete?
|complexity-theory|np-complete|np-hard|
|computability|security|turing-completeness|digital-rights-management|
null
After looking at the new diagrams, I see that you may need multiple pontoons to cross between islands. Given that, you could get very close to a solution of the http://en.wikipedia.org/wiki/Steiner_tree_problem by turning the nodes into islands and creating a sufficiently diverse collection of pontoons with small arcs....
null
I was reading **Linux Kernel Development** by Robert Love, where I came across this > Linux takes an interesting approach to thread support: It does not > differentiate between threads and normal processes.To the kernel, all > processes are the same— some just happen to share resources. Now, I am not an OS expe...
Linux: Are threads and processes really treated equally?
|linux|threads|
Many areas in the world suffer from conflicts between two groups (usually ethnic or religious). For the purpose of this question, I assume that most people of both sides want to live in peace, but there are few extremists who incite hatred and violence. The goal of this question is to find an objective way to filter ou...
voting scheme for peaceful coexistance
|game-theory|voting|
Threads and processes are execution contexts. They mostly differ only by the amount of shared state (memory, signal handlers, file descriptors,...) with the other execution contexts (processes share little with other processes; threads share a lot with the other threads in the same process). Most OS keep the two th...
I really wonder how torrent downloads can be resumed at later point of time. If such a technology exists then why in browsers it is not possible. I guess, everyone might have faced the following situation in his life sometime. When you are downloading a file from browser or say using some download manager, and sup...
Difference between Torrent downloads and browser downloads
|computer-networks|
Try solving problems based on an algorithm as soon as you read one. Moreover, for understanding algorithms and implementing them better you need to have a better understanding of Data structures. There is very nice book of data structures written by Sahni. You can use that and for algorithms you can solve problems of ...
Actually, most browsers can resume downloads, provided they are from an [FTP][1]-server. The difference between [HTTP][2] and FTP downloads is that whereas FTP has the `REST`(art) command to start a file transfer from a specified point, the HTTP protocol knows no such method. With HTTP, you always get the whole fil...
It depends of the server. If the server accepts the _resume_ or _continue_ operation then you can resume the download if you have the appropriate software, e.g. [wget][1] that does that since the beginning, even for HTTP. Some download manager that you can integrate in your browser does that, but for some reason bro...
Let's start with the following observation: > Let $max$ denote the maximum of the sequence $a_1,...,a_n$, and let $min$ denote its minimum. If $a_1=max$, then choosing $b_1=b_2=...=b_n=\lfloor(max+min)/2\rfloor$ is optimal. Why is this the case? Well, since the sequence starts with the maximum, either we choose...
|reference-request|game-theory|voting|
After looking at the new diagrams, I see that you may need multiple pontoons to cross between islands. Given that, you could get very close to a solution of the [Steiner Tree problem](http://en.wikipedia.org/wiki/Steiner_tree_problem) by turning the nodes into islands and creating a sufficiently diverse collection of p...
Many areas in the world suffer from conflicts between two groups (usually ethnic or religious). For the purpose of this question, I assume that most people of both sides want to live in peace, but there are few extremists who incite hatred and violence. The goal of this question is to find an objective way to filter ou...
Actually, most browsers can resume downloads, provided they are from an [FTP][1]-server. The difference between [HTTP][2] and FTP downloads is that whereas FTP has the `REST`(art) command to start a file transfer from a specified point, <s>the HTTP protocol knows no such method</s>. With HTTP, you always get the wh...
null
Suppose we want to join two relations on a predicate. Is this in NC? I realize that a proof of it not being in NC would amount to a proof that $P\not=NC$, so I'd accept evidence of it being an open problem as an answer. I'm interested in the general case as well as specific cases (e.g. perhaps with some specific ...
Many areas in the world suffer from conflicts between two groups (usually ethnic or religious). For the purpose of this question, I assume that most people of both sides want to live in peace, but there are few extremists who incite hatred and violence. The goal of this question is to find an objective way to filter ou...
null
Questions algorithmic solutions of geometric problems.
The class of *regular languages* is the set of formal languages which is -- among other formalisms -- (equivalently) accepted by finite automata, generated by left- and right-linear grammars and described by regular expressions.
Questions about properties of the class of regular languages and individual languages.
Questions about ways of storing data so that it can be used advantageously by algorithms.
Questions about ways of storing data so that it can be used advantageously by algorithms.
Questions about graphs, discrete structures of nodes which are connected by edges. Popular flavors are trees and networks with edge capacity. See [this wiki book](http://en.wikipedia.org/wiki/Book:Graph_Algorithms) (edited by David Eppstein) for an introduction to graphs and algorithms on them.
Questions about graphs, discrete structures of nodes which are connected by edges. Popular flavors are trees and networks with edge capacity.
Questions about properties of and problems on graphs, discrete data structures that have the form of nodes connected by edges, that is networks.
voting scheme for peaceful coexistence
Context: I'm working with this problem - http://stackoverflow.com/questions/10875675/how-to-find-out-all-the-popping-out-possibilities-of-two-stacks The problem is this: If you have two source stacks with n unique elements (all are unique, not just per stack) and two destination stacks and you pop everything off e...
Generating number of possibilites of popping two stacks to two other stacks
|combinatorics|
null
Context: I'm working with [this problem](http://stackoverflow.com/questions/10875675/how-to-find-out-all-the-popping-out-possibilities-of-two-stacks). The problem is this: If you have two source stacks with $n$ unique elements (all are unique, not just per stack) and two destination stacks and you pop everything off...
|algorithms|combinatorics|efficiency|
I know that the complexity class $\mathsf{P}$ has complete problems w.r.t. $\mathsf{NC}$ and $\mathsf{L}$ reductions. Are these two classes the only possible classes of reductions under which $\mathsf{P}$ has complete problems? Also, what classes of reduction can be used for $\mathsf{NP}$ beside polynomial-time...
Are there complete problems for P and NP under other kinds of reductions?
Note that if complexity class $C$ has a complete problem under a class of reductions $A$, then the same problem will be complete for $C$ under and class of reductions containing $A$. Typically completeness proofs go through with much weaker class of reductions than usually stated (e.g. under $\mathsf{AC^0}$ reductio...
There are many closed-platform computing devices on the market these days that do not have an (normaly/easily accessible) general-purpose programming interface for user. In other words, users cannot execute an arbitrary code on their machine. Take iPad as an example where new applications are loaded (solely) from a...
There are devices that do not allow users to perform arbitrary computations with their device but only run a limited class of applications. Take iPad as an example where new applications are loaded (solely) from app-store and programs that would allow execution of arbitrary code by user (without permission of Apple)...
Say that $a_1a_2\ldots a_n$ and $b_1b_2\ldots b_n$ are two strings of the same length. An **anagramming** of two strings is a mapping $p:[1\ldots n]\to[1\ldots n]$ such that $a_i = b_{p(i)}$ for each $i$. There might be more than one anagramming for the same pair of strings. For example, If $a=$`abcab` and $b=$`ca...
Finding permutations of strings that contain many increasing runs
|algorithms|search-algorithms|
|operating-systems|kernel|linux|threads|ipc|
Finding constrained permutations that contain long runs of consecutive numbers
Finding interesting anagrams
Say that $a_1a_2\ldots a_n$ and $b_1b_2\ldots b_n$ are two strings of the same length. An **anagramming** of two strings is a mapping $p:[1\ldots n]\to[1\ldots n]$ such that $a_i = b_{p(i)}$ for each $i$. There might be more than one anagramming for the same pair of strings. For example, If $a=$`abcab` and $b=$`ca...
Inter-Process-Communication
null
Say that $a_1a_2\ldots a_n$ and $b_1b_2\ldots b_n$ are two strings of the same length. An **anagramming** of two strings is a mapping $p:[1\ldots n]\to[1\ldots n]$ such that $a_i = b_{p(i)}$ for each $i$. There might be more than one anagramming for the same pair of strings. For example, If $a=$`abcab` and $b=$`ca...
null
Say that $a_1a_2\ldots a_n$ and $b_1b_2\ldots b_n$ are two strings of the same length. An **anagramming** of two strings is a bijective mapping $p:[1\ldots n]\to[1\ldots n]$ such that $a_i = b_{p(i)}$ for each $i$. There might be more than one anagramming for the same pair of strings. For example, If $a=$`abcab` a...
I have the following problem: "We want to implement a filtering strategy in e-mail servers to reduce the number of spam messages. Each server will have a buffer, and before sending an e-mail, it checks whether there is a duplicate of the same message in its own buffer and contacts k distinct neighboring servers at r...
Combinatronics problem