instruction stringlengths 35 11.4k |
|---|
A question was posted on Stack Overflow asking for an algorithm to solve this problem:
I have a matrix (call it A) which is nxn. I wish to select a subset
(call it B) of points from matrix A. The subset will consist of n
elements, where one and only one element is taken from each row and
from each column of A. T... |
My organization wants to maintain multiple copies of data in order to preserve access in the case of localized disasters as well as for the purpose of long term preservation. Are there accepted formal models for determining the appropriate variety of media (eg tape, disk) and their placement in the network? Are current... |
I have a general question about mapping reductions. I have seen several examples of reducing functions to $A_{TM}$
where $A_{TM} = \{\langle M, w \rangle : \text{ For } M \text{ is a turing machine which accepts string } w\}$
which is great for proving undecidability. But say I want to prove unrecognizability instead. ... |
Consider the following version of the Clique problem where the input is of size $n$ and we're asked to find a clique of size $k$. The restriction is that the decision procedure cannot change the input graph into any other representation and cannot use any other representation to compute its answer, other than $\log(n^k... |
I'm working through Simon Peyton Jones' "The Implementation of Functional Programming Languages" and on page 20 I see:
IF TRUE ((λp.p) 3) ↔ IF TRUE 3 (per β red) (1)
↔ (λx.IF TRUE 3 x) (per η red) (2)
↔ (λx.3) (3)
Step 1 to 2 is explained as ... |
Is the following example correct about whether an inference algorithm is sound and complete?
Suppose we have needles a, b, c in a haystack, and have also an inference algorithm that is designed to find needles.
sound - Only needles a, b and c are obtained.
complete - Needles a, b and c are obtained. Other hay may als... |
I read on the site on how to use the pumping lemma but still I don't what is wrong with way I'm using it for proving that the following language is not a regular language:
$L = \{a^ib^jc^k \mid \text{if } i=1 \text{ then } j=k \}$
for $i\neq1$ the language is obviously regular but in the case which $i=1$ , we get that ... |
I'm making a graduate thesis about proving correctness of program for multiplying 2 matrices using Hoare logic. For doing this, I need to generate the invariant for nested loop for this program:
for i = 1:n
for j = 1:n
for k = 1:n
C(i,j) = A(i,k)*B(k,j) + C(i,j);
end
end
end
I've tr... |
I'm trying to write a spell-checker which should work with a pretty large dictionary. I really want an efficient way to index my dictionary data to be used using a Damerau-Levenshtein distance to determine which words are closest to the misspelled word.
I'm looking for a data structure who would give me the best compro... |
When I was a student, I saw a problem in a digital systems/logic design textbook, about N soldiers standing in a row, and want to shoot at the same time. A more difficult version of the problem was that the soldiers stand in a general network instead of a row. I am sure this is a classical problem, but I cannot remembe... |
[previously appearing in cstheory, it was closed there and introduced here instead]
Given an edge-weighted graph $G=(V,E)$ the problem of finding the shortest path is known to be in P ---and indeed a simple approach would be Dijkstra's algorithm which can solve this problem in $O(V^2)$. A similar problem is to find the... |
I can understand the importance that computer scientists or any software development related engineers should have understood the study of basic logics as a basis.
But is there any tasks/jobs that explicitly require the knowledge about these, other than the tasks that require any kind of knowledge representation using... |
Say I have a weighted undirected complete graph $G = (V, E)$. Each edge $e = (u, v, w)$ is assigned with a positive weight $w$. I want to calculate the minimum-weighted $(d, h)$-tree-decomposition. By $(d, h)$-tree-decomposition, I mean to divide the vertices $V$ into $k$ trees, such that the height of each tree is $h$... |
Normally in algorithms we do not care about comparison, addition, or subtraction of numbers -- we assume they run in time $O(1)$. For example, we assume this when we say that comparison-based sorting is $O(n\log n)$, but when numbers are too big to fit into registers, we normally represent them as arrays so basic oper... |
I have had problems accepting the complexity theoretic view of "efficiently solved by parallel algorithm" which is given by the class NC:
NC is the class of problems that can be solved by a parallel algorithm in time $O(\log^cn)$ on $p(n) \in O(n^k)$ processors with $c,k \in \mathbb{N}$.
We can assume a PRAM.
My prob... |
Consider the operator $A(L)= \{w \mid ww \in L\}$. Apparently, the class of context free languages is not closed against $A$. Still, after a lot of thinking, I can't find any CFL for which $A(L)$ wouldn't be CFL.
Does anyone have an idea for such a language?
|
I am confused about the following claim: "The only values in the untyped lambda calculus are lambda-abstractions".
Why are the other terms not values? What does it mean for a lambda-abstraction to be a value? The first thing that came to my mind was that maybe lambda-abstractions are the only possible normal forms, but... |
I am currently learning assembly programming on wombat 4, I am looking at Frame pointers. I understand exactly what a frame pointer is: it is a register and are used to access parameters on a stack. But i'm confused on how they affect the program counter and why they are preferred over normal registers.
Could some one... |
I am trying to attack TAOCP once again, given the sheer literal heaviness of the volumes I have trouble committing to it seriously. In TAOCP 1 Knuth writes, page 8, basic concepts::
Let $A$ be a finite set of letters. Let $A^*$ be the set of all strings in $A$ (the set of all ordered sequences $x_1$ $x_2$ ... $x_n$ wh... |
Let $A_P = (Q,\Sigma,\delta,0,\{m\})$ the string matching automaton for pattern $P \in \Sigma^m$, that is
$Q = \{0,1,\dots,m\}$
$\delta(q,a) = \sigma_P(P_{0,q}\cdot a)$ for all $q\in Q$ and $a\in \Sigma$
with $\sigma_P(w)$ the length of the longest prefix of $P$ that is a Suffix of $w$, that is
$\qquad \displaystyle... |
I am wondering if there are any connection between convex polygon and castable object? What can we say about castability of the object if we know that the object is convex polygon and vice versa.
Let's gather together few basic things that we have to know.
The object is castable if it can removed from the mold.
The po... |
If there is a way to identify if two sets of points can be separated by a line?
We have two sets of points $A$ and $B$ if there is a line that separates $A$ and $B$ such that all points of $A$ and only $A$ on the one side of the line, and all points of $B$ and only $B$ on the other side.
The most naive algorithm I ca... |
When setting up an access point and selecting WPA2, one must manually enter a pre-shared key (a password), PSK, into both the AP and the STA.
Both parties, AP and STA, must authenticate each other. But they have to do so without revealing the PSK. Both have to proof to the other party that they know the PSK without ac... |
Reading a book I was redirected to "On holy wars and a plea for peace" paper by Danny Cohen, which covers the "holy war" between big-endians and little-endians considering byte-order.
Reaching the summary of the memory section I got confused as the author sais:
To the best of my knowledge only the Big-Endians of Blef... |
I am trying to find a $\Theta$ bound for the following recurrence equation:
$$ T(n) = 2 T(n/2) + T(n/3) + 2n^2+ 5n + 42 $$
I figure Master Theorem is inappropriate due to differing amount of subproblems and divisions. Also recursion trees do not work since there is no $T(1)$ or rather $T(0)$.
|
I found the P vs NP problem some time ago and I have recently worked on the subset sum problem. I have read Wikipedia article on the Subset Sum problem as well as the question Subset Sum Algorithm
I have looked at the problem and found some solutions but so far they seem to be NP,
I believe I can make a sufficientl... |
Let $a \neq b$ be two integers from the interval $[1, 2^n].$ Let $p$ be a random prime with $ 1 \le p \le n^c.$ Prove that
$$\text{Pr}_{p \in \mathsf{Primes}}\{a \equiv b \pmod{p}\} \le c \ln(n)/(n^{c-1}).$$
Hint: As a consequence of the prime number theorem, exactly $n/ \ln(n) \pm o(n/\ln(n))$ many numbers from $\{ 1... |
Here I'm really interested in lowering barriers to mathematical education.
Target:
I'd like to see created for the JavaScript community, an equivalent of the Python-based/linked scientific and high-performance computing libraries (great lists of which are available through Sage and otherwise). And I want that, because ... |
Let's say I am trying to break all the numbers from 1 to N down into their prime factors. Once I have the factors from 1 to N-1, is there an algorithm to give me the factors of 1 to N using dynamic programming?
|
Are there undecidable properties of linear bounded automata (avoiding the empty set language trick)? What about for a deterministic finite automaton? (put aside intractability).
I would like to get an example (if possible) of an undecidable problem that is defined without using Turing machines explicitly.
Is Turing co... |
I am looking for an algorithm to find a minimal traversal of a directed graph of the following type. Two vertices are given, a start vertex and a terminating vertex. The traversal consists of several runs; each run is a path from the start vertex to the terminating vertex. A run may visit a node more than once. The len... |
I've decided to read Operating Systems Concepts by Silberschatz, Galvin Gagne (8th edition) over the summer. I've gotten to a topic that's confusing me - interrupts and their role as it relates to operating systems.
The text says that an operating system will begin a first process such as "init" and then wait for an "... |
Consider this example (taken from this document: Showing that language is not regular):
$$L = \{1^n \mid n\text{ is even}\} $$
According to the Pumping Lemma, a language $L$ is regular if :
$y \ne ε$
$|xy| \lt n$
$\forall k \in N, xy^kz \in L$
In the above example, $n$ must be even. Suppose we have $n = 4$, we can ex... |
What are devices and their interconnections used alongwith Quantum Processors? Are they compatible with hardware devices like Cache, RAM, Disks of current computers?
|
I need to detect whether a binary pattern $P$ of length $m$ occurs in a binary text $T$ of length $n$ where $m < n$.
I want to state an algorithm that runs in time $O(n)$ where we assume that arithmetic operations on $O(\log_2 n)$ bit numbers can be executed in constant time. The algorithm should accept with probabilit... |
What is the expected space used by the skip list after inserting $n$ elements?
I expect that in the worst case the space consumption may grow indefinitely.
Wikipedia says space $O(n)$.
How can this be proven one way or another?
|
As it is, how do you prove that SAT is NP-complete?
I know what it means by NP-complete, so I do not need an explanation on that.
What I want to know is how do you know that one problem, such as SAT, is NP-complete without resorting to reduction to other problems such as hamiltonian problem or whatever.
|
I wanted to confirm something and will appreciate your help. Suppose we have three nodes called A,B and C. All are connected to a switch whose port supports 1 Gbps. Now suppose, Node's A network card is 100 Mbps while the the remaining have a 1 Gbps. Following are the constraints;
A can send B only with a maximum of 1... |
I am currently reviewing the potentials of cloud computing regarding energy efficiency and green IT. In connection with this review I am having a look on techniques for increasing energy-efficiency in data centers (computing), hardware, networking and storage devices.
Specificially for computing/servers I have found al... |
Define $\mathrm{Prefix} (L) = \{x\mid \exists y .xy \in L \}$. I'd love your help with proving that $\mathsf{RE}$ languages are closed under $\mathrm{Prefix}$.
I know that recursively enumerable languages are formal languages for which there exists a Turing machine that will halt and accept when presented with any st... |
I am struggling with hashing and binary search tree material.
And I read that instead of using lists for storing entries with the same hash values, it is also possible to use binary search trees. And I try to understand what the worst-case and average-case running time for the operations
insert,
find and
delete
is i... |
Lets $L_z \ := \{ a^i b^i c^i : 0 \leq i < z \}$
$\{a,b,c\} \in \sum^*$
there is a DFA with $\frac{z(z+1)}{2}+1$ states - How can I prove this?
And I need largest possible number $n_z$, for which i can prove that every NFA, which accepts $L_z$, have $n_z$ states, at least!
But first I need to show that $n_z = \frac{z(z... |
A divide and conquer algorithm's work at a specific level can be simplified into the equation:
$\qquad \displaystyle O\left(n^d\right) \cdot \left(\frac{a}{b^d}\right)^k$
where $n$ is the size of the problem, $a$ is the number of sub problems, $b$ is the factor the size of the problem is broken down by at each recursio... |
Let $A[1...N]$ be an Array of size $N$ with maximum element $\max$.
I want to transform array $A$ such that after transformations all elements of $A$ contain $\max$, i.e. after transformation $A = [\max,\max,\max,\max,\dots,\max]$.
In one step, I can apply the following operation to any consecutive sub-array $A[x..y]$:... |
I am a novice(total newbie to computational complexity theory) and I have a question.
Lets say we have 'Traveling Salesman Problem' ,will the following application of Dijkstra's Algorithms solve it?
From a start point we compute the shortest distance between two points. We go to the point. We delete the source point. T... |
Having extracted the data-flow in some rather large programs as directed, acyclic graphs, I'd now like to optimize the order of evaluation to minimze the maximum amount of memory used.
That is, given a graph {1 -> 3, 2 -> 3, 4 -> 5, 3 -> 5}, I'm looking for an algorithm that will decide the order of graph reduction to ... |
Possible Duplicate:
How to prove that a language is not regular?
Why $L_a$ and $L_b$ are not reguluar?
$L_a = \{ e^i f^{n-i} g^j h^{n-j} : n \in N, 1 \leq i, j \leq n \}$.
$L_b= \{nm^{i_1} nm^{i_2}...bn^{i_z}: z \in N, (i_1,...,i_n) \in N^z, 1 \leq j \leq z, i_j ≠ j \}$.
|
On from Page 1 of these lecture notes it is stated in the final paragraph of the section titled CREW Mergesort:
Each such step (in a sequence of $\Theta(\log_2\ n)$ steps) takes
time $\Theta(\log_2\ s)$ with a sequence length of $s$. Summing these, we
obtain an overall run time of $\Theta((\log_2\ n)^2)$ for $n$
... |
This question has been prompted by Efficient data structures for building a fast spell checker.
Given two strings $u,v$, we say they are $k$-close if their Damerau–Levenshtein distance¹ is small, i.e. $\operatorname{LD}(u,v) \geq k$ for a fixed $k \in \mathbb{N}$. Informally, $\operatorname{LD}(u,v)$ is the minimum num... |
As a follow up to this question (the number of rooted binary trees of size n), how many possible binary trees can you have if the nodes are now labeled, so that abc is different than bac cab etc ? In other words, order matters. Certainly it will be much more than the Catalan number.
What would the problem be if you hav... |
I have just completed the first chapter of the Introduction to the Theory of Computation by Michael Sipser which explains the basics of finite automata.
He defines a regular language as anything that can be described by a finite automata. But I could not find where he explains why a regular language is called "regular... |
I'm building an application which should suggest products for the users. I want to base my recommendation on different attributes, like location, weather, date, etc. Each of these attributes can have multiple values so the feature space I need to consider is huge.
I was thinking about two approaches to solve this probl... |
Due to the nature of the question, I have to include lots of background information (because my question is: how do I narrow this down?) That said, it can be summarized (to the best of my knowledge) as:
What methods exist to find local optimums on extremely large combinatorial search spaces?
Background
In the tool-assi... |
I was interested in finding regular expression for all strings with at least two $0s$ over alphabet $\{0,1\}$.
I attempted and formulated
$$(0+1)^* 0 (0+1)^* 0 (0+1)^*$$
Is this correct? And if not can somebody post and explain the correct one?
|
Suppose that $L(M) = L$ where $M$ is a $TM$ that moves only to the right side.
I need to Show that $L$ is regular.
I'd relly like some help, I tried to think of any way to prove it but I didn't reach to any smart conclusion. what is it about the only side right moves and the regularity?
|
When we compare the complexity of two algorithms, it is usually the case that either $f(n) = O(g(n))$ or $g(n) = O(f(n))$ (possibly both), where $f$ and $g$ are the running times (for example) of the two algorithms.
Is this always the case? That is, does at least one of the relationships $f(n) = O(g(n))$ and $g(n) = O(... |
I want to turn one string into another with only single letter substitions. What is a good way to do this, passing through only valid words in between (this website has some examples)?
Valid here means "a word in English" as this is the domain I consider.
My current idea is that I could use a shortest path algorithm w... |
Why is the worst scenario $\mathcal{O}\left(n^2\right)$ when using quicksort to find the median of a set of numbers?
If your algorithm continually picks a number larger than or smaller than all numbers in the list wouldn't your algorithm fail? For example if the list of numbers are:
$S = (12,75,82,34,55,15,51)$
and yo... |
A recent exam question went as follows:
$A$ is an infinite recursively enumerable set. Prove that $A$ has an infinite recursive subset.
Let $C$ be an infinite recursive subset of $A$. Must $C$ have a subset that is not recursively enumerable?
I answered 1. already. Regarding 2., I answered affirmatively and argued ... |
I have trouble understanding the cyclic coordinate method. How does it differ with the Hook and Jeeves method and the Rosenbrock method?
From a past exam text:
Describe the cyclic coordinate method and outline the similarities and the
differences between the Cyclic Coordinate method, the Hooke and Jeeves
method,... |
I am seeking a fast algorithm to compute the following function, a quantile of the Poisson distribution:
$$f(n, \lambda) = e^{-\lambda} \sum_{k=0}^{n} \frac{\lambda^k}{k!} $$
I can think of an algorithm in $O(n)$, but considering the structure of the series, there is probably a $O(1)$ solution (or at least a good $O(1)... |
it's a well known statement that
"Cryptographic security must rely on a secret key instead of a secret algorithm."
I would like to ask about some details about it. And which are their differences?
I see the obvious thing that for a multi user system, generating a key is overwhelmingly easier than generating a distinct... |
If there were an algorithm that factored in polynomial time by means of examining each possible factor of a complex number efficiently, could one not also use this algorithm to solve unbounded knapsack problems since two factors can be viewed as one value, say within the set for the knapsack problem, and the other bei... |
Consider a board of $n$ x $n$ cells, where $n = 2k, k≥2$. Each of the numbers from $S = \left\{1,...,\frac{n^2}{2}\right\}$ is written to two cells so that each cell contains exactly one number.
How can I show that $n$ cells $c_{i, j}$ can be chosen with one cell per row and one cell per column such that no pair of cel... |
If the weights of the weighted 3-DIMENSIONAL-MATCHING problem are restricted to let's say, 1 and 2, is there a possibility to reduce this case to the unweighted 3-DIMENSIONAL-MATCHING problem?
(Because for the unweighted version, there is a (1.5+$\epsilon$)-approximation1 algorithm, for the weighted version, there is o... |
Given three matrices $A, B,C \in \mathbb{Z}^{n \times n}$ we want to test whether $AB \neq C$. Assume that the arithmetic operations $+$ and $-$ take constant time when applied to numbers from $\mathbb{Z}$.
How can I state an algorithm with one-sided error that runs in $O(n^2)$ time and prove its correctness?
I tried ... |
Are there any known problems in $\mathsf{NP}$ (and not in $\mathsf{P}$) that aren't $\mathsf{NP}$ Complete? My understanding is that there are no currently known problems where this is the case, but it hasn't been ruled out as a possibility.
If there is a problem that is $\mathsf{NP}$ (and not $\mathsf{P}$) but not ... |
I am doing FFT-based multiplication of polynomials with integer coefficients (long integers, in fact). The coefficients have a maximum value of $BASE-1, \quad BASE \in \mathbb{n},\quad BASE > 1$.
I would like to put forward a formal argument that if we use complex DFT for computing a convolution on a physical machine,... |
Most of us know the correspondence between combinatory logic and lambda calculus. But I've never seen (maybe I haven't looked deep enough) the equivalent of "typed combinators", corresponding to the simply typed lambda calculus. Does such thing exist? Where could one find information about it?
|
I have been working on the following problem from this book.
A certain string-processing language offers a primitive operation which splits a string into two
pieces. Since this operation involves copying the original string, it takes n units of time for a
string of length n, regardless of the location of the cut. ... |
I try to find an approach to the following problem:
Given the set of point $S$ and radius $r$, find the center point of circle, such that the circle contains the maximum number of points from the set. The running time should be $O(n^2)$.
At first it seemed to be something similar to smallest enclosing circle problem... |
Some frontmatter: I'm a recreational computer scientist and employed software engineer. So, pardon if this prompt seems somewhat out of left field -- I routinely play with mathematical simulcra and open problems when I have nothing better to do.
While playing with the Riemann hypothesis, I determined that the prime ga... |
I'm looking for intuition about when a language is regular and when it is not. For example, consider:
$$ L = \{ 0^n 1^n \mid n \geq 1 \} = \{ 01, 0011, 000111, \ldots \}$$
which is not a regular language. Intuitively it seems a very simple language, there doesn't seem to be anything complicated going on. What is the di... |
What does the complexity class $\oplus P^{\oplus P}$ mean? I know that $\oplus P$ is the complexity class which contains languages $A$ for which there is a polynomial time nondeterministic Turing machine $M$ such that $x \in A$ iff the number of accepting states of the machine $M$ on the input $x$ is odd.
But what does... |
I am still fighting with hashing and I am ask myself: what is the most efficient way to count the number of different words in a text using a hash table?
My intuition says that applying the hashcode function to every word in the text, as result we will have words with different hash values in different buckets and the ... |
There is a problem which I cannot solve. If you give a tip I will be very glad.
Prove that following language is not context free:
$L= \{ a^nb^m | \gcd(n,m) = 1 \}$.
It can be proven using the pumping lemma, but how?
If I start with some prime numbers $m$ and $n$ where $m>n>2$ and pump it up from $uVxYz$, there are thr... |
I wonder if somebody could quickly and briefly outline some of the similarities and differences between the line search methods Golden Section Search, Fibonacci Search and Dichotomic Search.
I know Dichotomous has two functional evaluations per iteration whereas the other two only one, and that the Fibonacci search ten... |
Wikipedia has the following definition of the pumping lemma for regular langauges...
Let $L$ be a regular language. Then there exists an integer $p$ ≥ 1
depending only on $L$ such that every string $w$ in $L$ of length at
least $p$ ($p$ is called the "pumping length") can be written as $w$ =
$xyz$ (i.e., $w$ can... |
I'm trying to work out an assignment (taken from the book Algorithms - by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani, Chap 8, problem 8.6a), and I'm paraphrasing what it states:
Given that 3SAT remains NP-complete even when restricted to formulas in which
each literal appears at most twice, show that if each... |
I think I heard in somewhere that it has been proven that $\mathsf{NP}$ is strictly contained in $\mathsf{EXP}$, that is $\mathsf{NP} \subsetneq \mathsf{EXP}$. Is this right? Wikipedia and book resources do not seem to bring me an answer..
I just found a post similar to this, but I am not sure whether $\mathsf{NP}$ is ... |
This question was inspired by a comment on StackOverflow.
Apart from knowing NP-complete problems of the Garey Johnson book, and many others; is there a rule of thumb to know if a problem looks like an NP-complete one?
I am not looking for something rigorous, but to something that works in most cases.
Of course, every ... |
Since Integer Linear Programming is NP-complete, there is a Karp reduction from any problem in NP to it. I thought this implied that there is always a polynomial-sized ILP formulation for any problem in NP.
But I've seen papers on specific NP problems where people write things like "this is the first poly-sized formula... |
I am trying to understand Hoare logic presented at Wikipedia,
Hoare logic at Wikipedia
Apparently, if I understand correctly, a Hoare triple $$\{P\}~ C ~\{Q\}$$ means
if P just before C, then Q holds immediately after C, as long as C terminates. (A)
However, the assignment axiom schema seems to be interpreted in a d... |
This is a question I have stumbled upon in my exam revision and I find it intriguing:
My computer is blue and it has a massive graphics card and a DVD and every-
thing so which is more powerful: my computer or a Pushdown Automaton?
My Thoughts
When we talk about power I have assumed this to be computational power. I b... |
Brzozowski's DFA minimization algorithm builds a minimal DFA for DFA $G$ by:
reversing all the edges in $G$, making the initial state an accept state, and the accept states initial, to get an NFA $N'$ for the reverse language,
using powerset construction to get $G'$ for the reverse language,
reversing the edges (and... |
There are lots of attempts at proving either $\mathsf{P} = \mathsf{NP} $ or $\mathsf{P} \neq \mathsf{NP}$, and naturally many people think about the question, having ideas for proving either direction.
I know that there are approaches that have been proven to not work, and there are probably more that have a history of... |
Possible Duplicate:
Prove fingerprinting
Let $a \neq b$ be two integers from the interval $[1, 2^n].$ Let $p$ be a random prime with $ 1 \le p \le n^c.$ Prove that
$$\text{prob}(a \equiv b \pmod{p}) \le c \ln(n)/(n^{c-1}).$$
Hint: As a consequence of the prime number theorem, exactly $n/ \ln(n) \pm O(n/\ln(n))$ man... |
Given a degree distribution, how fast can we construct a graph that follows the given degree distribution? A link or algorithm sketch would be good. The algorithm should report a "no" incase no graph can be constructed and any one example if multiple graphs can be constructed.
|
I'm am stuck solving the next exercise:
Argue that if $L$ is context-free and $R$ is regular, then $L / R = \{ w \mid \exists x \in R \;\text{s.t}\; wx \in L\} $ (i.e. the right quotient) is context-free.
I know that there should exist a PDA that accepts $L$ and a DFA that accepts $R$. I'm now trying to combine these a... |
Clearly there aren't any undecidable problems in NP. However, according to Wikipedia:
NP is the set of all decision problems for which the instances where the answer is "yes" have [.. proofs that are] verifiable in polynomial time by a deterministic Turing machine.
[...]
A problem is said to be in NP if and only if t... |
The identities used in multiplication algorithms by
Karatsuba (integers)
Gauss (complex numbers)
Strassen (matrices)
seem very closely related. Is there a common abstract framework/generalization?
|
Is there any way to estimate how much data is added to the world wide web each second? Are there any studies about this?
|
I am learning the A* search algorithm on an 8-puzzle problem.
I don't have questions about A*, but I have some for the heuristic score - Nilsson's sequence score.
Justin Heyes-Jones web pages - A* Algorithm explains A* very clearly. It has a picture for Nilsson's sequence scores.
It explains:
Nilsson's sequence score... |
How to prove that $\mathsf{NP}^A \neq \mathsf{coNP}^A$ ? I am just looking for a such oracle TM $M$ and a recursive language $L(M) = L$ for which this holds.
I know the proof where you show that there is an oracle $A$ such that $\mathsf{P}^A \neq \mathsf{NP}^A$ and an oracle $A$ such that $\mathsf{P}^A = \mathsf{NP}^A... |
Grammars seem to be used for different purposes. In formal languages, they are used to describe sequences of symbols. In programming language theory, they are used to describe objects in a term algebra (possibly enriched with some implicit, extra structure such as variable scoping rules). My question is, are these t... |
Combinatorics plays an important role in computer science. We frequently utilize combinatorial methods in both analysis as well as design in algorithms. For example one method for finding a $k$-vertex cover set in a graph might just inspect all $\binom{n}{k}$ possible subsets. While the binomial functions grows exponen... |
To find the median of an unsorted array, we can make a min-heap in $O(n\log n)$ time for $n$ elements, and then we can extract one by one $n/2$ elements to get the median. But this approach would take $O(n \log n)$ time.
Can we do the same by some method in $O(n)$ time? If we can, then how?
|
Given the following tree:
Which traversal method would give as result the following output: CDBEA?
The answer in my study guide is Postorder, but I think postorder would output: DEBCA. Am I wrong?
|
So I'm reading "Introduction to Machine Learning" 2nd edition, by Bishop, et. all. On page 27 they discuss the Vapnik-Chervonenkis Dimension which is,
"The maximum number of points that can be shattered by H [the hypothesis class] is called the Vapnik-Chervonenkis (VC) Dimension of H, is denoted VC(H) and measures th... |
Given an array $a_1,\ldots,a_n$ of natural numbers $\leq k$, where $k$ is a constant, I want to answer in $O(1)$ queries of the form: "how many times does $m$ appear in the array between indices $i$ and $j$"?
The array should be preprocessed in linear time. In particular I'd like to know if there's a reduction to Range... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.