instruction stringlengths 35 11.4k |
|---|
I know that the disjoint set datastructure is used to keep track of the connected components of an undirected graph when the edges are added to the graph dynamically . I also know that is is used in Kruskal's algorithm for minimum spanning trees . What are the other possible applications of this datastructure ?
|
$L_0 = \{ \langle M, w, 0 \rangle \mid \text{$M$ halts on $w$}\}$
$L_1 = \{ \langle M, w, 1 \rangle \mid \text{$M$ does not halt on $w$}\}$
$L = L_0 \cup L_1$
I need to determine where in the hierarchy of languages (recursive, recursively enumerable, not recursively enumerable) $L$ and its complement $\overline L... |
I'm in a first year discrete math course and we started algorithms. I created a recursive algorithm to multiply two numbers together:
function multiply($n, $r) {
if($n == 1)
return $r;
else if($r == 1)
return $n;
else
return $r + multiply($n - 1, $r);
}
How do I prove my algorithm is correct?
A q... |
Given the following formal language $L$:
$$ L=\{ww \mid w\in\{a,b\}^*\}$$
Why is $a$ not a member of this language?
So what is $\{a,b\}^*$ exactly? I thought it means $(a+b)^*$?
|
While reading the Wikipedia article about the subset sum problem I came across this example: "is there a non-empty subset whose sum is zero? For example, given the set $\{ −7, −3, −2, 5, 8 \}$, the answer is yes because the subset $\{ −3, −2, 5 \}$ sums to zero".
I have noticed that if we shift all the values of the s... |
Intro:
I'm working with huge data set that i need to plot in browser, and since there may be up to 1M points my idea was to create different representations for different zoom levels
lets say i have 100k points, i would average two-by-two until i get 50k, then i would repeat that until i get below 500 points (my arbitr... |
When one shuffles playing cards, the goal is evidently to achieve a possibly big derangement
of a given deck. For manual shuffling there are terms like inshuffle, outshuffle etc. I like
to know whether there is a sensible general measure of derangements of n objects and
efficient algorithm to compute that measure and e... |
Bruinier and Ono have found an algebraic formula for the partition function, which was widely reported to be a breakthrough. I am unable to understand the paper, but does it have any algorithmic consequences for fast computation of the partition function?
|
What is the procedure for computing the rank of a multiset after inserting an element?
For instance, lets say we have a set $S = (0,1)$ containing $n = 2$ distinct elements.
The multiset $M = (1,1)$ has rank $5$ because there are $4$ multisets less than it based on lexicographic ordering: $(0), (1), (0,0), (0,1)$.
If w... |
I was looking at details on finite fields. Finite binary fields, e.g. $\mathbb{F_2}$, are used in CS in some places such as circuit theory [1].
What are some key applications of finite fields in CS?
I am also looking for uses of $\mathbb{F_{2}^n}$ which Mathworld shows can be represented as binary vectors.
[1] Noga... |
What's the use of studying trigonometry in computer science? I mean, is it essential? Does it have a specific application in computer science? Because I can't seem to muster enough motivation for learning it.
|
Consider the two hash functions used to map IP addresses. $x_i$ represents a octave (or "bit field") of the address.
Hash Function 1:
$$h_a(x_1, x_2, x_3, x_4) = \sum^{4}_{i=1} a_ix_i \bmod n$$
Where $n$ is a prime number closest to the total number of IP addresses being mapped. The probability of two IP addresses bein... |
I can not understand the following equality $$\langle ij|(|0\rangle \langle 0|\otimes I)kl \rangle= \langle i|0\rangle \langle 0|k \rangle \langle j|I|l \rangle?$$
Also to estimate phase $\phi$ in Nielsen & Chuang book, I can not understand why
$(|0 \rangle + e^{2\pi i 2^{t-1}\phi} |1 \rangle)(|0 \rangle + e^{2\pi i... |
How do you prove that the expected height of a randomly built binary search tree with $n$ nodes is $O(\log n)$? There is a proof in CLRS Introduction to Algorithms (chapter 12.4), but I don't understand it.
|
Suppose I am making a red-black search tree, and in my right subtree, I have a black node, then a red node, and it has two black children, the black children further black childrens. As such a lemma has been made that red-black trees with $n$ internal nodes have height at most $2\log(n+1)$, would this proof still hold ... |
I have the following pseudo code:
Multiply(y,z)
1. if (z==0) return 0
2. else if (z is odd)
3. then return (Multiply(2y, floor(z/2)) + y )
4. else return (Multiply(2y, floor(z/2)))
Towards analysing this procedure's runtime, this recurrence relation is given as answer:
$\qquad \displaystyle... |
The following equation is a matrix expression where $B_i$ and $C_i^T$ are $n\times n$ matrices and k is a positive integer:
$$P = \sum_{i=1}^k B_i C_i^T $$
So $P = B_1 C_1^T + B_2 C_2^T + \cdots +B_k C_k^T $
If $B_i $ and $C_i$ are $n\times n$ matrices themselves, we have a total of 2 $\times$ k matrices that some ... |
To prevent collisions, hash tables with open addressing use a methodology to chain the contents. Why can't we use another hash table allocated to each slot of the primary hash table?
|
I am new to this topic, and in some scientific papers I've been reading about prediction in sports I encountered the term rule based reasoner. Is it this term the same as a semantic reasoner( where the two main directions are forward and backwards chaining?). If yes, can you point out the difference between a decision ... |
Possible Duplicate:
List of intro TCS books for those who don’t know much about TCS
Im taking a course on Theoretical computer Science. and I use Sipser's Introduction to Theory of Computation as my reference manual. However, many times I find myself lost in the proofs. Ive tried following Shai Simpson's online lec... |
From what I've read, an example of infinite ambiguity is usually given in a form of a loop:
$S \rightarrow aA \\
A \rightarrow B \\
B \rightarrow A \\
B \rightarrow b$
But a grammar is called ambiguous if there's more than 1 way to derive the input string ω. What if I then take this well-known ambiguous grammar:
$S \ri... |
One can compress data with straight-line grammars. An algorithm that employs this technique is called Sequitur. If I understood correctly, Sequitur basically starts with one rule representing the input and then does these three steps till the grammar does not change anymore:
For each rule, try to find any sequences of... |
Can all packing problems be rephrased as set packing problems?
Can all covering problems be rephrased as set covering problems?
In other words, I was wondering if set packing/covering problems are the most general forms of packing/covering problems?
|
Problem : Two players have in front of
them a single pile of objects, say a stack of 7 pennies. The first player divides the original
stack into two stacks that must be unequal. Each player alternatively thereafter does the
same to some single stack when it is his turn to play. The game proceeds until each stack has
e... |
I have two vector points $p_1$ and $p_2$. Each point has a color value $c_1$ and $c_2$.
Now using linear interpolation, I would like to get the color value at point $p_3$.
Concrete example:
$\qquad \displaystyle p_1 = (1, 3) \text{ with } c_1 = (2, 4, 1)$
$\qquad \displaystyle p_2 = (4, 4) \text{ with } c_2 = (3, 1, 2)... |
Let $n$ be the number of strings which are sorted in lexicographical order and stored in a balanced binary search tree. You are provided with a prefix $x$ of which $M$ strings have the prefix $x$. I have devised the following algorithm, where I search until I find the first occurence of the prefix $x$ in one of the nod... |
By making use of the fact that sorting $n$ numbers requires
$\Omega(n \log n)$ steps for any optimal algorithm (which uses 'comparison' for sorting), how can I prove that finding the convex-hull of $n$ points is bounded by $\Omega (n \log n)$ steps?
|
The well known SAT problem is defined here for reference sake.
The DOUBLE-SAT problem is defined as
$\qquad \mathsf{DOUBLE\text{-}SAT} = \{\langle\phi\rangle \mid \phi \text{ has at least two satisfying assignments}\}$
How do we prove it to be NP-complete?
More than one way to prove will be appreciated.
|
I got a n*m matrix updated in realtime (i.e. about every 10ms) with values between 0 and 1024, and I want to work out from that matrix a multitouch trackpad behaviour, which is:
generate one or more points on the surface given the values on the matrix,
make this or those point as big as the value can be.
For example ... |
We know that the clique problem is NP-complete. Is the restriction of the problem to bipartite graphs or planar graphs still NP-complete?
|
According to some sources, the time complexity of finding the successor of a node in a tree is $O(h)$. So, if the tree is well balanced, the height $h=\log n$, and the successor function takes time $O(\log n)$.
Yet, according to this stackoverflow post on the time complexity of an inorder traversal of a binary search ... |
I am working on problem (15-11) Inventory planning from Introduction to Algorithms (CLRS, 3rd Ed).
15-11: Inventory Planning, p.411
The Rinky Dink Company makes machines that resurface ice rinks. The demand for such products varies from month to month, and so the company needs to develop a strategy to plan its manufac... |
I'm writing a JavaScript library for calculating graph measurements such as degree centrality, eccentrality, closeness and betweenness.
In order to validate my library I use two exist applications Gephi and NodeXL to run calculation with them.
The problem is I got what looks like different results.
I build simple graph... |
Introduction: I recently learned that a multi-tape Turing Machine $\text{TM}_k$ is no more "powerful" than a single tape Turing machine $\text{TM}$. The proof that $\text{TM}_k \equiv \text{TM}$ is based on the idea that a $\text{TM}$ can simulate a $\text{TM}_k$ by using a unique character to separate the respective... |
We throw two coins in a row and thus get the event space $\{ZZ, WW, ZW, WZ\}$.
Each of the 4 elementary events has a probability $1/4$.
how can I construct 3 binary random variable $x_1$, $x_2$, $x_3$ about this event space, which are 2-fold independent, but not independent.
|
I wonder what relations are between the knapsack problem, the bin packing problem and the set packing problem?
From their mathematical formulations, I don't see the first two belong to the third one i.e. the set packing problem, although I feel the third one sounds more general than the other two.
Or under what conditi... |
How can one formally prove
$L \cdot L^{*} = L^{+}$
It looks obvious to me since with the concatenation you get rid of $\varepsilon$, but I cannot think of a formal proof through induction or something.
|
Does anybody know a good definition of 2 decision / optimization problems being equivalent?
I am asking since for example allowing polynomial time computations any 2 problems in NP could be considered equivalent.
|
Possible Duplicate:
How to prove that a language is not regular?
Show that $L_2=\{a^nb^k|n\not= k-1\}$ is not regular by Pumping Lemma.
|
Possible Duplicate:
Runtime of the binary-GCD state machine
Hello I am doing self study from MIT OCW exercises and I could not understand this question. Can anyone explain me,
First, why does this state machine assume it halves the $(max(a,b))$ at every two transitions beacuse we can follow steps 4 and 7 and one ex... |
I am doing self study from MIT OCW exercises and I could not understand this question.
The following rules define the binary-GCD state machine working on states in $\mathbb{N}^3$ with start state $(a,b,1)$ for $a>b>0$. If multiple rules apply, smaller numbers have precedence.
Provided $\min(x,y) >0$, then $(x,y,e) \to... |
How is $\frac{n}{2^{h+1}}$ the maximum possible number of nodes at height $h$ for a binary search tree or heap tree? I saw this as proof to asymptotically bound the build_heap function in the book, but I don't get it.
|
I am trying to teach myself computability theory with a textbook. According to my book, a function $f$ over an alphabet $A=\{a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z\}$ is only computable iff the language
$$
L = \{s\#^j\sigma : s\in A^*, \sigma \in A, \text{ the }j\text{'th symbol of... |
As far as I understand, you receive an output from a quantum computer for an algorithm in the form of an amplitude, which is one of the many states your qubits may be in, however this amplitude is a complex number.
I understand that you have to square the amplitude to find the probability of finding that amplitude, but... |
Consider the recurrence
$\qquad\displaystyle T(n) = \sqrt{n} \cdot T\bigl(\sqrt{n}\bigr) + c\,n$
for $n \gt 2$ with some positive constant $c$, and $T(2) = 1$.
I know the Master theorem for solving recurrences, but I'm not sure as to how we could solve this relation using it. How do you approach the square root param... |
Turing completness is being typically proved via reduction to already proved Turing-complete machine.
Can the same be obtained by showing, that the machine in question is capable of generating arbitrary output – if proper input is given?
|
The language is $L = \{a^{i} b^{j} c^{k} \;|\; k \neq 2j\}$. I'm trying to write a grammar for this language, what I have so far is:
$S \rightarrow AT_{1} \;|\; AT_{2} \;|\; AT_{3} \;|\; AB \;|\; AC$
$A \rightarrow aA \;|\; \varepsilon$
$B \rightarrow bB \;|\; \varepsilon$
$C \rightarrow cC \;|\; \varepsilon$
$T_{1} \... |
I've been studying for an exam I have tomorrow, and I was looking through some previous sample exam questions, when I came across this problem:
Give a non-regular language $L$ such that $L \cup L^R$ is regular.
I've been sitting here and thinking and thinking, and I can't seem to come up with a situation where this i... |
Possible Duplicate:
How to prove that a language is not context-free?
I'm having a hard time figuring this out, any help is appreciated.
Let EQUAL be the language of all words over $\Sigma = \{a,b,c\}$ that have the same number of $a$’s, $b$’s and $c$’s
$\qquad \text{EQUAL} = \{ w \in \Sigma^* \mid |w|_a = |w|_b = ... |
A certain political party wants to encourage women to participate in their primary elections, so they decide, that the 4th position is reserved for a woman. That is, if there is no woman in the top 4 positions, then the woman with the largest number of votes will be promoted to the 4th position, and the candidates at p... |
Is there is a study or classification available on different types of databases? (Examples include structured, unstructured, semi structured relational, object oriented, folksonomies, etc.)
|
I would like to know what impacts does a scheduling algorithm, let's say Round Robin or FIFO, have on an Operating System. I understand that a scheduling algorithm has the processes run in burst then switch between one another. But what does this mean for an OS. All I can figure out is that the OS has to keep track of ... |
This is a textbook based question. In The Art of Computer Programming Volume 3, Knuth says that for a hash function $h(k) = k \bmod M$, $M$ should not be a multiple of $3$.
The explanation given is:
If keys are alphabetic, two keys that differ only by permutation of letters would differ in numeric value by a multiple ... |
For Prim's and Kruskal's Algorithm there are many implementations which will give different running times. However suppose our implementation of Prim's algorithm has runtime $O(|E| + |V|\cdot \log(|V|))$ and Kruskals's algorithm has runtime $O(|E|\cdot \log(|V|))$.
What is the base of the $\log$?
|
This is a beginners question. I and reading the book "Introduction to Computer Theory" by Daniel Cohen. But I end up with confusion regarding simplification of regular expressions and finite automata. I want to create an FA for the regular expression
$\qquad \displaystyle (a+b)^* (ab+ba)^+a^+\;.$
My first question is t... |
I am currently working on a project where I'm using an implementation of Hoffman and Pavley's "Method for the Solution of the Nth Best Path Problem" to find n-th best path through a directed graph. The implementation is based on QuickGraph's Ranked Shortest Path implementation.
I have been trying to determine the compl... |
Although I know that the Hamilton Path problem is ${\sf NP}$-complete, I think the following variant can be solved in polynomial time:
Given a planar graph with vertex set $V$, edge set $E$, start node $S$ and target node $F$,
our task is to find the Hamiltonian path from $S$ to $F$ or write that the path doesn't ex... |
Take a Turing machine, with a terminating program, convert it to some representation of the machine which captures, in a lossless manner, its state as it performs the computation.
So you have a complete representation of the machine, the program, and its internal organisation as it performs the computation.
I am going ... |
We are given a graph with $n$ vertices, $m$ edges, and path edge costs of $x$. For vertices without a direct path that are distant exactly one neighbor, we can add new edge with edge cost $y$. Our task is to find shortest path (i.e minimum cost) between the start vertex and all others vertices.
I have developed an algo... |
How can one show that a machine with a three dimensional memory arranged in an infinite grid can be simulated by a single-tape Turing machine? I'd imagine there's some sort of mapping possible from three dimensional coordinates to single coordinates (eg. (0,0,0) -> 0, (1,0,0) -> 1, (-1,0,0) -> 2, ...) but I can't figur... |
Assume that we have a set $D$ and each member of $D$ is a data and key pair. We want a data structure that would support the following operations:
Insert $(d,k)$ into $D$,
Delete member $e$, (no need to search to find $e$, e.g. $e$ points to a member in $D$),
MostFrequent, which returns a member $e \in D$ such that $e... |
How many different max-heaps exist for a list of $n$ integers?
Example: list [1, 2, 3, 4]
The max-heap can be either 4 3 2 1:
4
/ \
3 2
/
1
or 4 2 3 1:
4
/ \
2 3
/
1
|
How would I solve these problems involving time complexity:
Suppose we are comparing implementations of insertion sort and merge sort on the same machine. For inputs of size $n$, insertion sort runs in $8n^2$ steps, while merge sort runs in $64n \log_2 n$ steps. For which values of $n$ does insertion sort beat merge s... |
A grammar is ambiguous if at least one of the words in the
language it defines can be parsed in more than one way. A simple example of an ambiguous grammar
$$
E \rightarrow E+E \ |\ E*E \ |\ 0 \ |\ 1 \ |\ ...
$$
because the string 1+2*3 can be parsed as (1+2)*3 and 1+(2*3). For
context free grammars (CFGs) ambiguit... |
I'm a little bit confused about the analysis of binary search.
In almost every paper, the writer assumes that the array size $n$ is always $2^k$.
Well I truly understand that the time complexity becomes $\log(n)$ (worst case) under this assumption. But what if $n \neq 2^k$?
For example if $n=24$, then we have
5 iterati... |
I am trying to understand summation for amortization analysis of a hash-table from a MIT lecture video (at time 16:09).
Although you guys don't have to go and look at the video, I feel that the summation he does is wrong so I will attach the screenshot of the slide.
|
I ran into the following problem:
Given a directed acyclic graph with real-valued edge weights, and two vertices s and t, compute the minimum s-t cut.
For general graphs this is NP-hard, since one can trivially reduce max-cut to it by simply reversing the edge weights (correct me if I'm wrong).
What is the situation wi... |
I was asking on academia.se, if anyone knows scientific search engines offering a proximity operator like Google Web Search does, while Google Scholar Search does not. That's sad, because this operator would be most useful for literature research offering you a nearly semantic/context-sensitive search and I've seen req... |
For a list of integers, of size n, where n is exponential, will merge-sort(n), run in poly-time or psuedo poly-time?
|
I am having difficulty with one of the exercises in the Dragon Book:
Exercise 2.4.1(c): Construct recursive-descent parsers, starting with
the following grammars:
$$S \rightarrow 0S1\ |\ 01$$
Yet, for constructing a feasible parser, it is required that for two productions $A \rightarrow \alpha\ |\ \beta$, their FIR... |
We know error correcting codes are parameterized as (n,k,d) codes. I wanted to know the values of these parameters for some commonly used error correcting codes in computer memories or in DRAMs, etc.
I just wanted to see some values for these parameters, used in real life applications.
|
So I've been scratching my head over this problem for a couple of days now. Given some language $A$ and $B$ that is regular, show that the language $L$ which consists of all strings in $A$ whose length is equal to some string in $B$ is a regular language.
In equation form:
$$L = \{x \in A \mid \exists y \in B \text{ s... |
I've read first-order logic is in general undecidable, and that could be decidable only when working with unary operators. (I think that's propositional logic, correct me if I am wrong)
The question is why arity leads to undecidable problems?
I would like to see some reference material, or at least some simple example ... |
Assume I have an incomplete knowledge base, for example:
(rich(dave), poor(dave)) // dave is either poor or rich
(not rich(dave), not poor(dave)) // dave is not poor and rich at the same time.
My questions are:
1. If I do resolution on the above clauses, will I get the empty clause? and 2. If Yes, Does that mean m... |
I have rank-deficient matrix $M \in \mathbb{R}^{n\times m}$ with $\text{rank}(M) = k$ and I want to find a rank factorization $M = PQ$ with $P \in \mathbb{R}^{n \times k}$ and $Q \in \mathbb{R}^{k \times m}$.
A popular approach is to compute the singular value decomposition (SVD) $M = UDV^*$ and keep the columns of $U... |
Is it possible for a graph to have a cycle that goes through all the nodes, but it does not have a Hamiltonian cycle (i.e. the cycle goes through some nodes more than once)? If yes, can anyone prove it? If not, can anyone give a counterexample?
|
I am not sure how to draw parallel between the Wagner–Fischer algorithm and dtw algo.
In both case we want to find the distance of each index combination (i,j).
In Wagner–Fischer, we initiate the distance by the number of insert we'd have to do from one empty string to another.
let wagnerFischer (s: string) (t: string)... |
It is not really clear to me, how and if I can do boosting for correctness (or error reduction) on a BPP (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 positive-negative, correct solution, and no-solution. He... |
According to this Wikipedia article, unrestricted grammars are equivalent to Turing machines. The article notes that I can convert any Turing machine into an unrestricted grammar, but it only shows how to convert a grammar to a Turing machine.
How do I indeed do that and convert the Turing machine the recognizes langua... |
Lots of basic questions are there in my mind. I need to clear them.
Statement 1: A compiler converts a human-readable codes to object codes, and those are converted to a machine code (executable) by linker.
Am I right here?
At wikipedia, it is written that
Object files are produced by an assembler, compiler, or other l... |
We have a stochastic random source. This gives the bit $0$ (or $1$) with probability $1/2$.
We want to generate a uniform distribution on the set S = $\{0, 1,..., n-1\}$.
Which algorithm gives with probability $1/n$ the value $i\in S$. And how many bits are needed.
|
Looking for some tutorials / references that discuss Breadth First Search that takes into consideration the cost of paths, but could not find much information.
Could someone refer a tutorial?
|
I have a rather interesting one to ponder and would love if I could get an answer for it. We were discussing the topic of mapping reduction today in my Computing theory course and I was wondering why this reduction can't exist, $A_{LBA} \leq_{m} E_{LBA}$, since both of them are linear bound automata (LBAs). I do realiz... |
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... |
It's well-known that this 'naive' algorithm for shuffling an array by swapping each item with another randomly-chosen one doesn't work correctly:
for (i=0..n-1)
swap(A[i], A[random(n)]);
Specifically, since at each of $n$ iterations, one of $n$ choices is made (with uniform probability), there are $n^n$ possible 'pa... |
Here is the problem. Given $k, n, T_1, \ldots, T_m$, where each $T_i \subseteq \{1, \ldots, n\}$. Is there a subset $S \subseteq \{1, \ldots, n\}$ with size at most $k$ such that $S \cap T_i \neq \emptyset$ for all $i$? I am trying to reduce this problem to SAT. My idea of a solution would be to have a variable $x_i$ f... |
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
restriction ... |
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 as a suitable metric. Unfortunately, the Jaccard index only operates on two sets at a time. In order to calculate the similarity between all $n$ sets, it will require in the order of... |
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?
|
As the net-evergreen The Physics of Santa 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 in a while while Santa also serves as many kids as possible ea... |
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 $φ$ holds fo... |
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 state o... |
Would someone please clarify for me the difference between direct and random access?
Specifically, why does this Wikipedia article on Direct Access Storage Devices distinguish between the two:
The direct access capability, occasionally and incorrectly called
random access (although that term survives when referrin... |
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.
What does th... |
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$.
What is the least number of $y$'$s$ we must re... |
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?
|
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... |
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 this pr... |
What would be the process state in a multi threaded process, in which threads are in different states (running, waiting, blocked etc)
|
Let's start with the comparison sorting lower bound proof, which I'll summarize as follows:
For $n$ distinct numbers, there are $n!$ possible orderings.
There is only one correct sorted sequence of the $n$ numbers.
We are given that comparison ($<$) is the only operation we have that can narrow down the $n!$ possible ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.