instruction
stringlengths
35
29.1k
Given a directed graph $G = (V, E)$, with all edge weights being non-negative, someone has written a program that he/she claims implements Dijkstra's algorithm. For a fixed starting vertex $s$, the program produces $v.d$ (shortest distance from $s$) and $v.\pi$ (immediate predecessor in the shortest path) for each vert...
As stated in the title: Fix two primes p and q. Given input a number of the form $p^aq^b$, find the immediate next number of the same form. For example: when $p = 2$ and $q = 3$ Next of $2^2*3=12$ is $2^3=16$ and after that is $2*3^2=18$ Question [edited]: Can this be done in poly-time of the representation of $a$ and ...
I have a system where disk requests come to a disk drive for cylinders in the order 10, 22, 20, 2, 40, and 38 at a time when the disk drive is reading from cylinder 20. The seek time is 6ms per cylinder. I have to find total seek time if the disk scheduling algorithm is First-Come-First-Serve (FCFS). To find the ans...
I want to calculate the amount of tree structures that have a given maximal distance between two nodes given an amount n of nodes (or keys). E.g. with n = 3 there are 5 tree structures, each forced to have a maximal distance of two. With n = 4 I can build 14 structures, only 2 of which have a maximal distance of two. T...
There is a definition of integer representation: A positional representation for integers that uses the binary digits 0 and 1, in which the values represented by successive bits are additive, begin with 1, and are multiplied by successive integral power of 2, except perhaps for the bit with the highest position....
This is the problem I have: Compute the Hamming code with odd parity for the memory word 1101 1001 0001 1011 (2 pts.). In your solution, mark the parity bits as in the following example, where parity bits are: 3, 5, 11, and 13 0001 0100 1011 1100 1001 1 P P P P Note: This is only an example on how you...
In terms of CTL formulae, what is the difference between equivalence and implication? (prop = some proposition, && = conjunction, AG = CTL syntax for "globally holds") E.g. AG (prop1 && prop2) versus (AG prop1) && (AG prop2) Are those two formulae related by implication i.e. the left hand side implies the right hand si...
I'm just confused, cause from my knowledge recurrence is applied mostly to recursive procedures or divide and conquer techniques etc.
I was told this question would be better suited here: Suppose you have a table such as: $\begin{array}{ccc} 11.998 & 9.083 & 2.919 &|& 24\\ 12.983 & 10.872 & 3.145 &|& 27\\ 1.019 & 2.045 & 0.936 &|& 4\\ 26&22&7&|&55 \end{array}$ Where the rows add up to the numbers on the right and the columns add up to the numbers on...
If one is given $n$ numbers picked uniformly at random from the interval $[0,1]$ then is it possible to sort them in linear time? It seems to me that some such method exists which uses binary representations of these numbers and compares the sequences of 0s and 1s between any two of them only partially and that someh...
This is what I vaguely understand of what an "incremental algorithm" is - say one such for calculating the $k^{th}$ smallest number for a given sequence of elements $x_1, x_2,...,x_n$ then after the algorithm has seen the elements $x_1, x_2, x_3, ... , x_{i-1}$ it has either, (1) computed the $k^{th}$ smallest elemen...
I am asked to write an efficient method that computes the number of nodes in T, and here is what I did: public int numOfNodes(Node t) { if (t==null) return 0; return numOfNodes(t.left) + numOfNodes(t.right)+1; } Every node needs invokes two recursive calls, so the running time is $O(2^N)$. Is my estim...
I have a time-dependent (dynamic) optimization problem: $$ f_t : [0;1]^2 \mapsto \mathbb{R}^+; t \in [1, \dots, n] $$ $f_t$ is to be maximized. That is for each $t$ I would like to find a relatively high value of $f_t$. Mostly, $f_t$ is a relatively simple, continuous, unimodal function. It changes with time, but not ...
I am trying to find a unary language whose runtime complexity is exponential in $n$ (e.g. $\Theta(2^n)$ or a similar expression). But I am not sure how to reason about the runtime of such languages. I tried the language: $L_1=\{1^{2^k}\}$. This language can be identified by counting the number of ones in the input into...
Is there a data structure to keep track of the connected components of a dynamic graph, when the graph might by changing by deleting edges of the graph? Let $G$ be an undirected graph. I have two operations I'd like to be able to perform: Delete$(u,v)$: delete the edge $(u,v)$ from the graph. SameComponent$(u,v)$: re...
In my first algorithms class we're creating these patterns that are supposed to model a finite state machine. We were given a task to think if we can figure out a way to detect palindromes in binary sequences (no points if we do, it's just a food for thought). I specifically asked the professor, knowing a little about ...
I am reading about probability and beliefs in artificial intelligent agents, and came across the following passage: Why the axioms of probability are reasonable The axioms of probability can be seen as restricting the set of probabilistic beliefs that an agent can hold. This is somewhat analogous to the logical ...
So I have grouped the following formalisms into a power hierarchy (and made classes for them): Class 1 DFA NFA NFAϵ reg.exp Class 2 (DCFL expressivity?) LR(1) DPDA Class 3 CFG PDA Class 4 TM NTM Class 4 is the most powerful class and Class 1 is the least powerful. Now I want to compare them to LR(0) parsers. My...
I know that the both the average and worst case complexity of binary search is O(log n) and I know how to prove the worst case complexity is O(log n) using recurrence relations. But how would I go about proving that the average case complexity of binary search is O(log n)?
Suppose you have three stages for a job: Creation stage = the job gets created Executing stage = the job is executed/served Finishing stage = the job is "marked" as finished. Now, say the quantum time for a round-robin scheduler is 100ms. From what I understand, the 100ms is spent on the executing stage. Am I right to...
Let $$L_\ = \{\langle M\rangle \mid M \text{ is a Turing Machine that accepts the string 1100}\}\, .$$ To proof that the language $L$ is undecidable I should reduce something to $L$, right? I tried with the classic $A\ TM$, but I could not figure out how to reduce properly. How I can I proof that $L$ is undecidable?
Let $\mathcal{J} = \{J_1,...,J_n\}$ be a set of jobs with each $J_i = [a_i,r_i,d_i]$ where the job becomes available at its arrival time $a_i$, requires $r_i$ execution time and needs to be finished at its deadline $d_i$ (hard real time). Assume we have $m$ processors available. Given the above, what scheduling algorit...
NOTE: I asked this on mathstackexchange, but didn't get the responses I wanted, thought I should post in CS. Sorry if i did something wrong but i am a newbie. State the asymptotic (worstcase) runtime found by the master theorem. If the master theorem does not apply state why: 1) $T(n) = T(n/3)$ 2) $T(n)= 5T(2n/5) + n$...
So there are two boxing teams, my team A and the opposing team B, each with m boxers. Based on the player's ranking of skill, x_subscript(i) being the ranking for ith boxer for team A and y_subscript(k) being the ranking for kth box for team B. Each fight round is set up one boxer from team A against one boxer from tea...
Here is a recursive definition for the runtime of some unspecified function. $a$ and $c$ are positive constants. $T(n) = a$, if $n = 2$ $T(n) = 2T(n/2) + cn$ if $n > 2$ Use induction to prove that $T(n) = \Theta(n \log n)$ Any idea on how to solve this?
I have a graph and I need to find a minimum spanning tree to a given graph. What is to be done so that the output obtained is a binary tree?
BACKGROUND: Recently I tried to solve a certain difficult problem that gets as input an array of $n$ numbers. For $n=3$, the only solution I could find was to have a different treatment for each of the $n!=6$ orderings of the 3 numbers. I.e., there is one solution for the case $A>B>C$, another solution for $A>C>B$, etc...
It is known that the runtime complexity of sorting is $\Theta (n \log n)$. But what if we have, for every input array of size $n$, an oracle that can sort any array of $k<n$ numbers in constant time? In this case, the runtime of merge sort becomes $O(n)$. The recursive calls are cheap and the runtime is dominated by th...
I'm trying to understand the difference between these two. They both look at what happens on average, however amortized analysis is actually dealing with exactly the amount of operations you are doing in each step, while average analysis produces an expected cost based on probabilities. For them to both exist as separa...
I'm new to complexity and came upon the following exercise which I'm unable to solve. Prove that if $NP\subseteq BPP$ then $\Sigma_2^p=\Pi_4 ^p$.
Currently I self study CLRS book (Outside of any course, so I got no access to an instructor) And I am stuck proving Insertion Sort, The proof in CLRS book is not so formal. Here's the algorithm: INSERTION-SORT(A) for j=2 to A.length (= n) key = A[j] i = j-1 while (0<i and key<A[i]) A[i+1]...
I need to write a truth table for all possible unique Boolean functions with one input. However, I am confused regarding the word "unique". I thought about writing down the truth table for a NOT, since it has just one input.
Here is a recursive definition for the runtime of some unspecified function. a and c are positive constants. $T(n)=a$, if $n=2$ $T(n)=2T(n/2)+cn$ if $n>2$ Use induction to prove that $T(n)=\theta(n\log(n))$ How should I do my base case? It is not a number, so how do I find my n0?
Supposing a tree T has the identical: Pre-order traversal and in-order traversal Pre-order traversal and post-order traversal In-order traversal and post-order traversal How does T look like? From the previous discussion in SO, I learned that pre- and post-order are same iff. only one node is in the T. How about the ...
I am looking at an example Turing machine in my textbook, Automata and Computability by Dexter C. Kozen, and I'm confused as to how they determine the number of states this particular machine has. The example (Example 28.1, page 211) reads as follows: Here is a TM that accepts the non-context free set $\{a^nb^nc^n \mi...
I got a an exercise problem which should be seen as a HMM scenario and argument some statements. However I'm quite confused about how to properly solve and argument my solutions. Problem tells: Imagine you want to determine the annual temperature centuries of years ago, when of course there wasn't any thermometer or re...
Alex writes down the decimal representations of all natural numbers between and including m and n, (m ≤ n). How many zeroes will he write down? My one friend said to me that this problem can be solved by dynamic programming.But I can't understand how to solve it by dynamic programming .Can someone explain it with great...
While reading a book, I came across a paragraph given below: In order to synchronize all of a computer’s operations, a system clock—a small quartz crystal located on the motherboard—is used. The system clock sends out a signal on a regular basis to all other computer components. And another paragraph: Many person...
I try to work out some consequences of storing (or "communicating"/"transmitting") a rational number by a term expression using the following operators: $0$, $\mathsf{inc}$, $\mathsf{add}$, $\mathsf{mul}$, $\mathsf{neg}$, and $\mathsf{inv}$. Here $\mathsf{add}$ and $\mathsf{mul}$ are binary operators, $\mathsf{inc}$, $...
I am taking a principles of programming languages class right now and am trying to understand the following judgement form. n' = -toNumber(v) ------------------ -v --> n' (Sorry, I can't post pictures yet. And Stack doesn't take LaTeX.) I think it means "n' = -v implies that -v maps to n' " or something along those ...
I asked this question in SO here I have about 1000 sets of size <=5 containing numbers 1 to 100. {1}, {4}, {1,3}, {3,5,6}, {4,5,6,7}, {5,25,42,67,100} ... Is it possible to find a set of size 20 that contains the maximum number of given sets? In other words, let $U = \{1, 2, ..., 100\}$ and $S \subseteq \{Z \in 2...
From my basic understanding of Adaptive Control, I understand that it uses the error and the velocity of the error to approximate the error in the solution space of a problem, thus allowing for guaranteed convergence under certain conditions and rapid adaptation to changing conditions. I've accumulated this knowledge b...
After watching Travis DeWolf presentation on scaling neural computation, I'm a bit confused about the difference between Reinforcement Learning (whether hierarchical or not) and Adaptive Control. They both seem to be exploring environments and minimizing error through learning, but they're obviously used for very diffe...
List the edges (vertex pairs) of a minimum spanning tree for this graph in the order they would be chosen by Prim's algorithm Please help me to understand and complete this. I would very much appreciate it.
$A = \{a^i b^j c^k\mid i = j\text{ or } j = k; i, j, k \ge 0\}$. In its push down automaton should not there be the red colored transition instead of the black colored one?
My professor presented the halting problem as $K' = \{ w \in \{0, 1\}^* | M_w$ Halts on $w \}$, where $M_w$ is the TM whose encoding is $w$ (i.e. $w = \langle M \rangle$), and said it was equivalent to $K = \{ \langle M,v \rangle | M $ Halts on $v \}$. I tried to think it through and this is my understanding so far: $(...
I have a binary heap with $n$ elements. I want to get the $k$ largest elements in this heap, in $O(k \log k)$ time. How do I do it? (Calling deletemax $k$ times yields a $O(k \log n)$ complexity. I'm looking for $O(k \log k)$.) The only solution I've come up with so far is the following: You have 2 arrays. A(largest...
I'm new to the field of program transformation. I'm looking for resources on the techniques and methods one would use to translate object oriented code to its procedural equivalent. In particular, I need to translate arbitrary PHP programs written with Object Oriented constructs into purely procedural PHP programs. ...
I know that it is decidable problem to check whether given context free grammar represents empty language -- for instance, AFAIR one could convert it to Chomsky normal form, and then check if any word of length $\leq 2^n$ (or maybe $\leq 2^{n+1}$, I'm not sure) belongs to the language, where $n$ is IIRC the number of n...
This is the question I asked four months ago and took very satisfactory answers. However, I tackle a new problem now. Here, I summarize the original problem: We have points in 3D space. We do not know the coordinates of the points. We know some of the pairwise Euclidean distances. Those points are deployed on random ...
Let $H$ be a decision problem, where we are given an integer $k$ and some object, say a graph or a formula. We know that $H$ is NP-complete for $k \geq c$, where $c$ is some constant like 3 ($H$ could be $k$-SAT, or $k$-vertex coloring, or something like that). I have a problem $X$ I think is NP-complete as well, and I...
Alex has some (say, n) marbles (small glass balls) and he has going to buy some boxes to store them. The boxes are of two types: Type 1: each box costs c1 Taka and can hold exactly n1 marbles Type 2: each box costs c2 Taka and can hold exactly n2 marbles He wants each of the used boxes to be filled to its capacity and ...
I am working on an algorithm that ranks a set of nodes in a graph with respect to how relative this node is to other predefined nodes (I call them query nodes). The way how the algorithm works is similar to recommendation algorithms. For instance, if i want to buy an item from an online store, the algorithm will look a...
I proved that $$ \{ 0^n 1^{5n} \mid n \geq 0 \}$$ is not a regular language using Pumping Lemma by following way. Solve by contradiction that $ L = \{0^n 1^{5n} \mid n \geq 0 \}$ is regular language. Let $0^p 1^{5p}$ be in L, where $p$ is the pumping length. Now here if the language $L$ is regular language, $0^p 1^{5...
I have a problem that I cannot figure out regarding using the pumping lemma to prove that a language is not regular. I don't understand how I go about proving through contradiction that the language is not regular. When I read about the pumping lemma, all I am finding are complicated explanations involving $x$, $y$, $z...
$L=\{a^{2k}b^nb^k\mid k\geq0, n\geq0\}$ over alphabet $\{a,b\}$ How do I prove that $L$ is not regular using Pumping Lemma? All the examples I've come across had same exponents all around, and I'm a bit confused how should I write this down. Should I start with $w=\{a^pb^pb^p\mid p\leq k, p\leq n\}$ where $w$ is a subs...
When a computer OS supports multi-program, it needs to have a scheduling algorithm to handle which process will be run by the cpu. If a process is in state 'blocked' waiting for IO, the scheduling causes another process to be taken by the cpu while the process in state 'blocked' is waiting for a response I/O. In this ...
I'm aware of the general k-center approximation algorithm, but my professor (this is a question from a CS class) says that in a one-dimensional space, the problem can be solved (optimal solution found, not an approximation) in O(n^2) polynomial time without depending on k or using dynamic programming. A general descrip...
When discussing complexity classes, when we say that problem $A$ reduces to problem $B$, are we saying that problem $A$ is at least as complex as problem $B$, or the other way around?
I'm new to communication theory and I've been wondering where the following simple argument fails: Equality Problem We have two players, player 1 Alice who gets an $n$-bit vector $X$ and player 2 Bob who gets an $n$-bit vector $Y$. We want one of them to output $1$ if and only if for all indices $i:$ $X[i] = Y[i]$. Sup...
How does one prove that some arbitrary language $L$ is not recursively enumerable? I know I can prove that the language $L$ is recursively enumerable by constructing a Turing machine $M$ that accepts all words in the language (and the language would be even recursive if $M$ halts on all inputs). But it is not clear to ...
Is this problem decidable? Given two representations of Turing machines $R(M_1), R(M_2)$, is the length of the computation of $M_1$ longer than the length of the computation of $M_2$ on every input? My guess is not decidable. I am not sure, however, how to justify it. I tried this: Lets enumarate all possible words fro...
Can every recursively enumerable language be defined with regular expression? I came across this question, when studying for my test: Prove that for any finite language $L$, there is a Turing machine $M$ with $L(M) = L$ with time and space complexity $t(n) \leq n+1, s(n) \leq n+2$, respectively ($n$ is the length of th...
Imagine a program, executed by an interpreter to be a Turing Machine. Consider this code: x = read_input print x Does undecidability mean that there may possibly be an input to this program such that the program may never halt?
Given the following (arbitrary language, although I think it is close to Algol 60) program: program main; // A main parent level var i : integer; // A 'global' variable (* Note that all parameters are passed by value here *) function f1 (j : integer) : inte...
In the timepiece (excuse the pun) that is Time, Clocks and the Ordering of Events, Lamport describes the logical clock algorithm as the following: Each process $Pi$ increments $Ci$ between any two successive events. If event a is the sending of a message m by process $Pi$, then the message $m$ contains a timestamp $T...
Hopefully this is not a duplicate How do I prove a Language L={a,b,c} is decidable or not I read somewhere that if a turing machine accepts a language and halts on every input string then the language is decidable. Having said that how do i design / prove that a turing machine accepts {a b c} I am new to concepts of au...
How many comparisons in the worst case, does it take to merge 3 sorted lists of size n/3? (where n is a power of 3) I was told it takes: $$2(n-2) + 1 = 2n-3$$ However, I can't seem to figure out why. The way to merge them I was thinking just to merge two of the lists, and then merge that big 2/3 list with the remainin...
I'm designing a Turing machine that decides a language denoted by a regular expression. Let's say this expression is $a^*bbc^*$. Does this machine accept the string $bb$ since $a^*$ and $c^*$ can have zero instances or more?
I have the following DFA. (Yellow stated are accepting states.) I want to eliminate states step by step to find the regular expression of it. In my steps, I think there is a bug because I do not know what to do with state 4. If you know how to convert this DFA to regular expression please help me.
my issue comes from image processing. The image below is for a better understanding of the problem. I have to detect three dots (shown in black, marked with red arrows). The other points I get from my image after processing it are shown in green. As you can see I get many more points from the image than just the black ...
A Bloom filter is a probabilistic data structure designed to tell, rapidly and memory-efficiently, whether an element is in the set or no. If we can use hash tables where we have O(1) in best time, O(n) in a very bad situations. Why do we need a new abstract data structure that look-up for an element with less certain...
Please help me regarding this one! What will be the communication and computation complexity of this code?? While (m>0) do { While ((m mod 2)==0) do { m ← ⌊m/2⌋ //parties communicate m times; } m = m – 1; } This code been modified from the book "Fundamental of computer algorithm" b...
I have a homework that I should find the formula and the order of $T(n)$ given by $$T(1) = 1 \qquad\qquad T(n) = \frac{T(n-1)}{T(n-1) + 1}\,. $$ I've established that $T(n) = \frac{1}{n}$ but now I am a little confused. Is $T(n) \in O(\frac{1}{n})$ the correct answer for the second part? Based on definition of big-O ...
I've been reading lately about SAT problem, NP and co-NP. Many sources say that the SAT problem is co NP, though, I can't find a co-NP problem equivalent to SAT. Does anyone have any idea about this ? (Or could lighten my misunderstandings)
I am quoting a paragraph from the book "Operating System Principles" by Galvin. Usually, each page-table entry is 4 bytes long, but that size can vary as well. A 32-bit entry can point to one of $2^{32}$ physical page frames. If frame size is 4 kB, then a system with 4-byte entries can address $2^{44}$ bytes (or 16 TB...
Which natural language processing problems are NP-Complete or NP-Hard? I've searched the natural-lang-processing and complexity-theory tags (and related complexity tags), but have not turned up any results. None of the NLP questions that are recommended are helpful, the closest are the following: https://cs.stackexcha...
I have read the Operating System Concepts book, watched a lot of videos on YouTube, practiced with past qualifying exam questions and several exams from other CS departments around the world. Although I feel better about going into the exam, I have been searching for: Large diagram that puts most of OS concepts in pe...
I have a linked list in which I have kept the elements in order (increasing/decreasing). I want to be able to perform a binary search on this linked list. For this I am keeping pointers to the middle element of list of length n, n/2, n/4 so on. I am not able to figure out what would be the order of storage in this case...
I have two non-overlapping sets of items, with feature counts for each. What standard algorithms can I use to extract the most statistically distinct features of each set? For example: Items served at American restaurants (5 restaurants surveyed): bread: 4 burgers: 2 cheese: 1 cronuts: 2 pasta: 2 Items served at Ita...
Suppose we have a set $D$ of denominations of coins and a our input is a "tip jar" containing some finite number of these coins (e.g., five nickels, a dime and three quarters). In the first two problems, we want to know whether it is possible to divide the money in the jar equally between two people; in the third one,...
In DRAM timing constraints, tFAW means length of a rolling window that allows up to four row activations in same Rank. This constraint is mainly due to power budget of each rank. However, I am curious why 4 is the magic number?Would it be wrong if we use Eight Activation Window and double the value or use Two Activatio...
Statement:SCC in G is same as Rev(G) Ex:Consider the following graph g 0->1 1->2 2->4 3->1 4->3 The strong components set would be S={0,1,2,3,4} If I reverse the above graph (i.e) 1->0 1->3 2->1 3->4 4->2 Then the strong components set would be S'1={0} S'2={1,2,3,4} Which shows that strong components in G is not same a...
According to what I have read from two different sources, cache coloring is (was?) required in order to: Counter the problem of aliasing: Prevent two different virtual addresses with the same physical address from mapping to different cache sets. (According to a CS Stack Exchange Answer) Exploit the spatial locality p...
In short: What is the basic difference that allows model checking for hardware to be "easily" solvable, but makes it undecidable for software? I guess it has to boil down to the difference between hardware being finite automata and software having the expressiveness of a Turing machine, which would basically mean that ...
From the book The Nature of Computation by Moore and Mertens, exercise 8.9: Consider the problem ACYCLIC GRAPH of telling whether a directed graph is acyclic. Show that the problem is in NL, and then show that the problem is NL-complete. I am mainly interested in the first part. It's quite easy to show that it's in c...
We have a graph $G=(V,E)$ and we need to divide this graph into two clusters $A$ and $B$. Some pairs of vertices $u$, $v$ should not be in the same cluster, and we define an edge $(u,v) \in E$. The total cost of a solution is the total number of edges with endpoints both in the same cluster. My goal is to find an algor...
Find the total number of positive subsequences in a sequence of numbers with an algorithm that is faster than $O(n^{1.5})$. For example, {-2 3} is a positive subsequence of {1 -2 3} since -2+3 = 1 is positive. The following is my code: import java.util.*; class PSIv3 { public static int mergeSort(int[] a, int i, int ...
I am solving a problem with a bridge, where you have a one way bridge with people coming from each side. To solve this problem while preventing deadlock (two people going opposite directions on the bridge at the same time), I used a mutex lock. However, this could still result in starvation. How would I prevent starvat...
if we define $F_n$ be the $n$th fibonacci number and $\varphi$ be golden number then can we say that $2^{F_n} \in \Theta(2^{\varphi^n})$ or in other word $2^{\frac{\varphi^n - (-\varphi)^{-n}}{\sqrt{5}}} \in \Theta(2^{\varphi^n})$ It's simple to show that $F_n \in \Theta(\varphi^n)$ but about above one I don't have a...
I have data collected from a computer simulation of football games which seem to have recurring patterns of the following form. if madrid plays arsernal and the match ends under 3 goal, then on their next match against each others, madrid will win. if madrid happens to loose and then plays against chelsea next, they w...
This question occurred to me some time ago when I was thinking about whether or not if statements are fundamental in computation. Consider a program that manages a single bank account (for the sake of simplicity). The bank account could be defined as something like Account { int balance; // current amount of Money...
I'm reading Sedgewick and Wayne's book of Algorithm. When I read the following proof in the attached picture, I don't understand why it assumed the comparison number is lg(number of leaves). Any help is appreciated!
In computer architecture class, my lecturer was explaining about I/O interfaces and modules, but somehow neither me nor my classmates understood almost a word he said.. We still don't get which parts of a computer is an I/O interface. For example, which one of these are an I/O interface? A VGA card or PCI Express?
I've come across the CYK algorithm and was wondering, as it's quite old, if it is still relevant today. Is it or an extension of it still being used in compilers (for example), or have other algorithms proven to be better?
In mathematics, there are many existence proofs that are non-constructive, so we know that a certain object exists although we don't know how to find it. I am looking for similar results in computer science. In particular: is there a problem that we can prove it is decidable without showing an algorithm for it? I.e. we...
This question occurred to me some time ago when I was thinking about whether or not if statements are fundamental in computation. Consider a program that manages a single bank account (for the sake of simplicity). The bank account could be defined as something like Account { int balance; // current amount of Money...
The ACM Contest Problem 102 (HTML or PDF) can be paraphrased as: Given 3 bins each containing possibly different number of bottles of 3 colors, move the bottles so that there is one color per bin, minimizing the number of bottle movements. Specifically, we wish to decide on an allocation of colors to bins so that mov...
Could someone give an easily accessible reference containing an algorithm that could be conveniently implemented into a code for computing Knight's Tour (preferably also with fairly good efficiency)?
I think I understand why the string $( [ ) ]$ is not in a Dyck language. In my words, D2* is all the dyck words of 2 parentheses. From the definiton of $D2*$, every words must have exactly 2 pairs correctly nested pairs of parentheses. All the words of the language are given by $\sum = { (1, )1, (2, )2 } $ The alpha...