instruction
stringlengths
35
29.1k
I'm a computer engineer and I've met hash functions theoretically speaking in "algorithms and data structure" and then in several applications (like databases, operating systems, computer architecture etc). But I was wondering if there's some general theory about these functions and, specifically, if there's a general ...
In Kosaraju's Algorithm, using first dfs (traversing on reverse graph) we calculate finishing time of nodes, and then traverse (actual graph) in reverse order of finishing times. why not without reversing graph, using first dfs (traversing on actual graph) we calculate finishing time of nodes, and then traverse (actual...
In my previous question ( Can Turing machines be converted into equivalent Lambda Calculus expressions with a systematic approach? ), I got the answer that it is indeed possible. And as I have read before, every program written in all programming languages is convertible to a Turing Machine. And of course, since there ...
I am studying the proof of the following theorem: Given the language $\mathit{REGULAR}_\mathit{TM} = \{\langle M \rangle | M $ is a turing machine and $\mathit{Accept}(M)$ is regular$\}$ $\mathit{REGULAR}_\mathit{TM}$ is undecidable. The proof given in Sipser shows that if we already have a machine $R$ that decides $\...
I'm studying context free grammars and I can grasp how to create context free grammars given a set notation, and now to convert these context free grammars to Chomsky Normal form but I am utterly stumped on how to go past that and get to Greibach Normal Form, I am given the follow grammar which is already in Chomsky No...
Wikipedia says union by rank without path compression gives an amortized time complexity of $O(\log n)$, and that both union by rank and path compression gives an amortized time complexity of $O(\alpha(n))$ (where $\alpha$ is the inverse of the Ackerman function). However, it does not mention the running time of path ...
Is there a mutual exclusion or semaphore or locking algorithm that only relies on atomic reads and atomic writes of shared memory and can tolerate a delay in propagation of the written data between processes? I.e. if process A writes to shared memory, process B might not see the change for a while (but process A will s...
I'm trying to figure out a problem reported in Kleinberg (ch 6 no.16). I know that there are solutions based on ordering, anyway i'd like to understand if another way exists. Basically, we have a hierarchy of people represented by a tree. The root person has to postpone a picnic due to rain: in a first moment he calls ...
How to find all shortest paths between node 1 and N in a weighted undirected graph? There can be multiple edges between two nodes. I want to find all nodes that can be on a shortest path. For example: 10 11 1 2 1 1 3 1 3 4 2 4 5 1 5 6 1 5 10 2 1 7 1 7 8 3 7 9 2 9 10 2 8 10 1 The answer is 1 7 8 9 10 because there a...
How to approach to solve this question and the likes of it? Let $L$ be the set of strings $\langle M\rangle$ such that $M$ accepts all strings of even length and does not accept any strings of odd length. a) Is $L$ Turing-recognizable? Prove your answer. b) Is the complement of $L$ Turing-recognizable? Again prove y...
A system has 6 identical resources and $N$ processes competing for them. Each process can request at most two requests. Which one of the following values of $N$ could lead to a deadlock? 1 2 3 4 My attempt: Deadlock free condition is: $R \geq P(N-1)+1 ,$ Where R is total number of resources, P is the number of pr...
Is "flops" a reliable measure of deciding computational capacity? If we do matrix multiplication and matrix addition of the same size of matrix, do the flops remain the same? Referring to question https://stackoverflow.com/questions/329174/what-is-flop-s-and-is-it-a-good-measure-of-performance I am curious to know if ...
I'm having some thoughts and I'd like to have your opinion about it. Given a basic, normal instance of SMP (men-women, men choose), we define $\mu$ to be the set of all stable matches. Each member of $\mu$ consists of men-rank, which describes the satisfaction index of the men - which in this case the member with the h...
The questions is as follows with the answer: Q) Given the arrival and departure time of various trains in a station. Calculate the minimum number of platforms required such that no train has to wait for another train to vacate the platform. The question basically means calculate the maximum number of trains that would...
Good evening! I tried to model the Binomial theorem, that allows to expand any power of x + y into a sum of the form: $$(x+y)^n = {n \choose 0}x^n y^0 + {n \choose 1}x^{n-1}y^1 + {n \choose 2}x^{n-2}y^2 + \cdots + {n \choose n-1}x^1 y^{n-1} + {n \choose n}x^0 y^n$$ Then, tried to estimate the number of recursive calls ...
As defined by Wikipedia, (The Curry-Howard correspondence) is a generalization of a syntactic analogy between systems of formal logic and computational calculi that was first discovered by the American mathematician Haskell Curry and logician William Alvin Howard. Related to it is the λ-cube, which is a graphical rep...
I am trying to prove a theorem (title) given in a starred problem in Sipser's book. I have absolutely no idea how I would go about showing it, and after trying a few different approaches came here looking for a hint. I don't want a full answer, but would really appreciate a few words to point me in the right direction....
The data structure is used for example in Scala: https://github.com/scala/scala/blob/v2.12.0-M3/src/library/scala/collection/concurrent/TrieMap.scala More details in this paper: http://lampwww.epfl.ch/~prokopec/ctries-snapshot.pdf The logic I'm confused about is on line 139 in Figure 11 on page 6 of ctries-snapshot.pdf...
I want to know how it can process spoken English words and Pull out a matching response? Is it a chip or a installed software? Does it take up a lot of space? Thanks.
The wikipedia page (here) assumes the existence of some $L \in \Sigma_4 - SIZE(n^k)$. How can one show that such a language exists? This is related to a homework question, I'd prefer some hint to the answer. Using the hierarchy theorems, we can find some language $L \in SIZE(n^{k+1})$ for which $L \not \in SIZE(n^k)$....
I am learning about artificial neural networks and I've decided to go with perceptrons. I already made a sample program that can learn based on the learning data, but when I tried to make it recognize the color green it stopped working. The learning data is based off of RGB values. So at first the perceptron was learn...
Let be $F=(A\land B)$ and $G=\neg(\neg A \lor \neg B)$. Which of the following statements are correct $F=G, F\equiv G, \neg F=\neg G, \neg F\equiv\neg G$? Is there a difference?
I have a homework assignment where I am supposed to make a visual representation of a deterministic FSM. Basically, the FSM is to accept the input string if it does not contain the letters a and c immediately after the other. The input alphabet I is I = {a, b, c}. As a hint, the class was told that 4 states would be en...
I have been reading the paper[1] in the title. But there are some parts of it that are unclear to me, more specifically the way you typecheck a lambda. I have attached the typing rules below as images[2] [3] Typing them all in Mathjax would have been a lot of work. I will explain the issue I am having by means of an ex...
Suppose that a DBMS recognizes increment as an atomic operation, in addition to the read and write operations. Let $V$ be the value of the data item $X$. The operation increment (X) by c sets the value of $X$ to $V + c$ in an atomic step. The value of $X$ is not available to the transaction unless the latter executes...
So, I have the following propositional formula: (((P → Q) ∨ S) ↔ T) How do I decide if it's well formed?
Firstly, I would like to apologize if I misplaced this topic / i think the theory of coding is close to CS / I am little bit confused right now, in the school we were learning about Hamming's code, Block codes etc. I was given a homework, in which I should explain how does the two dimensional parity check finds 3-bit e...
If $L$ is the set of strings $\langle M\rangle$ such that $M$ accepts all strings of even length and does not accept any strings of odd length. What will be $\overline L$ ? a) set of strings $\langle M\rangle$ such that $M$ accepts all strings of even length as well as any strings of odd length. b) set of strings $\la...
I want to work on automatic grammar correction using machine learning (possibly using recurrent or deep neural networks). The algorithm will be supplied with both corrected and initial documents for supervised learning. I am now looking for some survey or research papers to start with. I have searched and downloaded te...
I'm trying to write an algorithm to compute a minimum size dominating set of an undirected graph G(V,E). I think the following works: 1) Sort vertices by number of edges (descending) 2) Add the first vertex to the set D (which will be the dominating set output) 3) Delete all vertices connected to D by one edge 4) Add ...
Let us consider the subset sum problem with $S = S_i = \{1,2,..,i\}$. There are of course $2^{|S|}$ different sums that can be formed. Now it seems that though the sums are not in order and thus not searchable efficiently there is some structure as indicated by the picture below. In the image there are the cases i = 1....
Is there a functional specification of alpha-beta search that makes it easy to prove by induction that the algorithm works?
I have a weighted, directed graph. I do the following. Given nodes $s$ and $t$ I compute shortest path. Then, I decrease weights of some edges and want to see if there is now another shortest path. Of course, I can recompute shortest path, but I want something faster. For example, one approach would be to store shortes...
An exercise problem stated that : Which of the following addressing modes permits relocation without any change whatsoever in the code? Indirect addressing Indexed addressing Base register addressing PC relative addressing Somewhere it explained as : Base register addressing : In this mode , content of base register...
Suppose we have language $a^{\binom{n}{k}} n,k \in N$ is this language regular ? If it is not, I should use pummping-lemma? It it is regular, I will use proof by induction ?
I'm converting hex ( in positional fractions) to decimal question : 0x3c.e8 my attempt: $3*16^1 + 12*16^0$ yields $60$ $ 3c$ = $ 60 $ in decimal so i know its 60. then $.e8 *10 $ (since I want base ten) = $232$ my question is do I just say 60.232?
Let's say I have a file with symbols of an alphabet [0,N-1], N around 50. The actual data is a file with a lot of lines, each containing 100 of these symbols. I want to compress this data. By doing a frequency analysis over a large amount of lines to build a probability density function and then calculate the entropy y...
We know CLIQUE and HALF-CLIQUE problems are NP-complete. Now consider the class of graphs (let's call it $\mathcal{G}_{2K}$) where a graph $G=(V,E)$ is a member of $\mathcal{G}_{2K}$ iff $G$ has two SEPARATE cliques $K_1$ and $K_2$ of size $\dfrac{N}{2}$ (where $|V| = N$). My speculation is that $\mathcal{G}_{2K}$ is i...
Is there an algorithm that performs the following: Input: A directed graph and two vertices within that graph Output: Whether one of the two vertices is the ancestor of the other For example, in this graph: A is an ancestor of D. B is neither the ancestor nor the descendant of C. The best I can think of doing is perfo...
(Using Haskell syntax, since the question is inspired by Haskell, but it applies to general Hindley-Milner polymorphic type systems, such as SML or Elm). If I have a type signature f :: a -> [a], what is the logical proposition encoded by that type signature? I know that type constructors like ->, (,) correspond to "op...
I was wondering, are there any famous algorithms in NLP or NLG that can take some text (say a news article online) and transform it to a lower reading level?
I am learning about compiler optimization technique and there is a technique that use associativity of addition to transform code. For example, consider the following expression: (a + b) + ((c + d) + e) It can be transformed into: a + (b + (c + (d + e))) Does anybody know the name of this transformation?
Are there any reasons to work with the DIMACS framework, such as to test algorithms, coding, and heuristics of TSP (Traveling Salesman Problem)? It is nearly 15 years since establishment of the benchmark in 2001.
I want to understand type theory but I have to know first how I can apply it. Could there be more non-obvious applications of type theory aside from in type systems in programming? Could there be other applications, let's say in personality profiling and the likes?
When we would like to prove lower bound comparison algorirthm, we often use decision tree, for example sorting by comparisons. So let's consider find minimum in array $a[1..n]$ by comparison. Lower bound for that problem is commonly known - $n-1$ comparisons. However, how to use decison tree in order to prove lower...
What is the time complexity of the following piece of code in worst case? s=0; for(i=1;i<=n;++i){ for(j=1;j<=i*i;j++){ for(k=1;k<=j and j%i==0;k++) /* k<=j and j%i==0 */ s++; } } Each loop depend on the outer loop variable.How to proceed in such case? Innermost loop will run only some...
I have read in my subject "Operating Systems" that CPU can't access secondary memory. Any program that is stored on secondary memory is executed once its retrieved from secondary memory to primary memory. Is this true? If the CPU can't execute code directly out of secondary memory, why not?
The Google Hash Code 2015 Test Round (problem statement) asked about the following problem: input: a grid $M$ with some marked squares, a threshold $T \in \mathbb{N}$, a maximal area $A \in \mathbb{N}$ output: the largest possible total area of a set of disjoint rectangles with integer coordinates in $M$ such that eac...
Suppose algorithm A is given for a maximization problem and we are asked to show that it is a 1/2-approximation algorithm. As you know it is enough to show Sol >= 1/2 OPT What I need to know is, is it true to assume this problem as a minimization one and prove Sol <= 2 OPT Or is there any correspondence between these ...
Is the language $\qquad L=\{ \langle \text{M} \rangle \; | \; \text{M is a Turing machine that decides some language} \}$ a Turing-recognizable language? I think it's not, as, even if I am able to tell somehow that a Turing machine halts for some input there are still infinite strings to check for. Similarly I think...
Suppose I have 100 qubits that I want to entangle and put into superposition. To do so I construct a Hadamard gate to do this. By definition, the Hadamard is going to be a 2^100 X 2^100 matrix - which is huge. How does one go about actually performing this operation? The size of the Hadamard matrix is exponential relat...
When a local variable is reassigned a different value/object, does its position/address change in the stack?
INPUT: directed non negative weighted graph, s, t, k OUTPUT: SSSP from s to t where the path has $\leq k$ vertices MY PROGRESS: heap.add(s,0) where s is vertex and 0 is weight and heap is minheap depth[s] = 1; do c = heap.poll(); SSSP[c] = c.weight if(depth[c] >= k) continue loop; for v in c's adjacent vertices...
Given a monotone polygon, with it's vertices given in counter-clockwise orientation, is there any fast process to determine whether the line between two vertices of that polygon A and B is a valid diagonal of that polygon? A valid diagonal is a line between those two vertices that lies inside the polygon and doesn't in...
I have a problem that is similar to this that I am trying to solve: "Given a randomly-shaped field, what is the best (fastest I guess) way to plow it? Every part of the field must be plowed, plowing outside the area is not a problem, and turning around is slower than going straight." Basically, I'm in the situation of ...
I'm stuck with one of my homework exercises: Consider the following variant of Karger’s algorithm for finding a minimum s-t cut, i.e., a minimum cut separating two specific given nodes s and t: As in the original algorithm, edges are iteratively contracted. In any iteration, let s and t denote the possibly contracted ...
What would be the general approach for that? And what are the things that generally overlooked while proving such things? For example, I have a Language, L ={e:$L(M_e)$ such that it accepts only 'a where a$\in \sum^{*}$}? Is it possible, 1. To prove its not a CE, Can we reduce $(Acceptance\space problem)^{complement}$ ...
I was recently going through the Wiki page List of unsolved Problems in Computer Science. There was a problem which I do not understand Do one-way functions exist ? [Is public-key cryptography possible ?] A one-way function is a function that is easy to compute on every input, but hard to invert given the image of a ...
I started reading about timed automata lately. In the definition, they have locations instead of states as in automata theory. Can anyone explain why is this?
Bucket sort is a linear-time sort. Why do we use insertion sort in it? We know that insertion sort takes $O(n^2)$ time. Why can we not use any linear sort inside it? As we see, when in each bucket we use insertion sort $O(n^2)$. How is bucket sort's total complexity $O(n)$? Why do we not use a $O(n \log n)$ sort such...
A while ago, I was doing my laundry late at night. When I brought my laundry back to my dorm, I started to put it away. My wardrobe is set up as follows: My drawers are categorized by the type of clothing they hold, and I'm very particular about that; this means I can't put t-shirts in my pants drawer (otherwise I'll...
How could I express an AND gate using only XOR gates ?
I want to covert this DFA to RE: I converted and this is my result: 1*+1*2+21*, but I test it and give wrong result. This dfa describe "any strings(lambda) but not contain 22". Please help me about!
I'm wondering, is showing two different ways to derive the same word enough proof to show that a context-free grammar is ambiguous? For example: O = start symbol Non-terminal = {O} Terminal = {r, s} Productions = O -> r O -> Or O -> sOO O -> OOs O -> OsO There are two different derivations f...
After reading this blog about Deep Neural Networks learning about selfies I'm struck by how generic the network in question is. In short: I'm thinking of trying to write something vaguely similar for solving cryptic crosswords, but I can't fathom how to make the general algorithms it uses generic enough that it can dev...
Let $\mathbb{X} = \mathbb{N} \cap [0, 255]$. I am given three vectors in $\mathbb{X}^3$ which I will denote by $v_i = [x_i, y_i, z_i]^T$ for $i \in \{1, 2, 3\}$. Now we have a binary operator $\bigoplus$ defined by $w = u \bigoplus v = \lfloor0.9 \cdot u\rfloor + \lfloor0.1 \cdot v\rfloor$, where $u$ and $v$ are in $\m...
Let's define the following operations: $odd(string) = $ odd characters of $string$, $even(string) = $ even characters of $string$ Now say we have some language $L$, we will then define the following languages: $odd(L) = \{odd(w): w \in L\}$, $even(L) = \{even(w): w \in L\}$ Need to prove that there exists a non-regula...
A controlled not gate matrix looks like this: $$\begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \\ \end{bmatrix}$$ That works great when you only have two qubits and you want to use the first qubit as the control, and the second qubit as the input to be flipped (or not). Is there a meth...
So let's say I have an array of elements where each of the values can range from 0 to $n^2-1$. I'm trying to make an algorithm to sort this array in O(n) running time and I was thinking of using radix sort. The run time of radix sort is O(d(n+N)) or O(dn) if n is really large. So how can I modify radix sort so that it ...
I would like to know whether we could replace the second image with first image since the second image contains less transitions and states than first image even though everyone uses second image to show construction of (a*).
I use a software for pollutant propagation on rivers that takes as input a set of parameters (p1, p2, ...pn) and creates an output file which is basically a matrix where on each row there is represented the concentration of pollutant in various places along the river at a given timestamp. \begin{array} {|r|r|r|r|r...|...
Since, I don't have strong algorithmic background my question may sound a litlle odd. Please correct me, if so. I have quite a large bitmap (~100 Million bits) (e.g. 100100101001010001001...010010). The bitmap is just an example, it doesn't have to start with 1 or end with 0. Now, I need to choose randomly any 0-bit f...
Skip lists are taught as a standard of the undergrad CS curriculum at many major universities. However, from my reading* I can't find any practical situation where you would use a skip list over a treap. Also they have the same asymptotic performance for all the main operations. As a result this left me wondering: ...
I am looking for a better explanation (research level, papers) to answer: Why translating a program from one high-level programming language directly into another is difficult? Note: When I say difficult I don't mean "hard" - i.e. I am not taking about computational complexity here simply because I am unaware of such ...
I have the following question about giving a series of examples of range spaces for my Hitting Set problem that establish a lower bound for the integrality gap (IG). IG is the supremum of ratio of the optimum for natural integer linear programming (ILP) formulation of Hitting Set to the optimum for its (mean ILP) LP-r...
I was reading about Cellular Automata and I read in this question that Matthew Cook proved that rule 110 is universal, and that his proof relied upon showing how rule 110 can simulate a tag system. Is there another method or information that would still prove the universality of rule 110? In other words, is there ano...
I try to understand balance factors change after local rotations in AVL trees. Given the rotate_left operation: x y' / \ / \ a y => x' c / \ / \ b c a b and $b(x)$, $b(y)$ - balance factors for $x$ and $y$ nodes - I want to find $b(x')$ and $b(y')$. In my reasoning I will...
Say I have two systems that take the same drawing commands and starts drawing on their respective platforms (i.e. HTML Canvas). After this is done, I want to save and compare these two images to ensure that they are perceptually the same, even though the shapes and colors may be very slightly off (non-perceptible diffe...
I was reading "Parsing Techniques: A Practical Guide, Second Edition" by Grune and Jacobs, which details a bunch of different parsing algorithms. In the section on $LR(2)$ parsing, they mention that unlike $LR(1)$ items, which just have an item lookahead (the token that should appear after the completed $LR(1)$ item), ...
Let's assume the following definition of a red-black tree: It is a binary search tree. Each node is colored either red or black. The root is black. Two nodes connected by an edge cannot be red at the same time. Here should be a good definition of a NIL leaf, like on wiki. The NIL leaf is colored black. A path from the...
I am trying to get the a CFG for this. I got this: L1={uv | u ∈Σ∗,v∈ Σ∗1Σ∗ and |v| ≤ |u|} U -> A | B A -> 0A | E B -> 1B | E V -> 1T | 0T | T T -> G1 G -> I1 | I0 | E Is this correct? UAB does the u section then VTG get the v part. Or am I completely doing it wrong?
Lately graph theory has come into everyday practice with graph databases. So I wonder if any object can be written as a graph? I don't have the formal definition of an object, but say it is a C struct or a Java Object, isn't it so that we can express objects as graphs and that it is a more convenient and advantageous r...
We know that general palindromes cannot be decided by a DFA. Howeve if you restrict to case of even length palindromes, does a DFA need exactly $2^{2k}$ states where $2k$ is length of palindrome the language needs to accept? I get this as lower bound from Myhill Nerode aplication. From answers below, my lower bound is ...
I'm toying around with graph properties and I want to make some effort to check whether a given graph is Hamiltonian. I understand that the general problem is NP-complete, but I'm looking for simple checks that are easy to implement and computationally inexpensive to get some indication. So I've implemented Dirac's and...
I am thinking of the classical paper, https://www.cs.sfu.ca/~kabanets/Research/poly.html Can someome link to some papers/reviews that give a sampling of what are the recent thoughts in this direction? I am equally happy to know of what are the recent directions in the topic of pseudorandomness and derandomization.
Can you express evaluation order using big-step semantics? For example, in a simple language consisting of only if t then t else t and true and false, we can decide to only step a if then else to one of its branches if its branches are already values. Can big-step semantics express the same thing?
Does Schaefer's dichotomy theorem establish that a general 3-sat clause cannot be transformed into an equivalent set of 2-sat/Hornsat/affine clauses (using auxiliary variables) or just that this would be very unlikely in that it would imply P = NP? I ask because I know that there are some types of problems involving 3...
Context: After creating the minimum spanning tree, the next step in Christofides' TSP algorithm is to find all the N vertices with odd degree and find a minimum weight perfect matching for these odd vertices. N is even, so a bipartite matching is possible. When the N odd-degree vertices are found, there are $n \choose...
The following exercise is inspired by an old exam question (note that this is not the question): Let us define a single-letter alphabet $\Sigma = \{a\}$ and the language $L = \{ w \in \Sigma^*: |w| = 2^n, n \in \mathbb Z_+\}$. (In other words, $L = \{a^2, a^4, a^8, \ldots \}$.) What is an unrestricted grammar for $L$? ...
I'm struggling with a proof in the text for my logic course, and I'm wondering if someone could offer a hint or some help. The question is basically as follows. Show that if the decision problem for satisfiability is solvable iff the decision problem for implication is solvable. Then, show that the decision problem of...
I was thinking about the homework problem: Given $n$ vectors in 3D: $(\mathbf{v_1},\mathbf{v_2},\dots, \mathbf{v_n})$. Their coordinates are positive integers and less than $10^9$. We should split this set into $k$ groups in the way that each two vectors from one group are collinear and from different are not. S...
In computational theory, I came across both deterministic and non-deterministic finite state machines but I heard someone said there are no dead states in deterministic machines. I thought dead and empty states were the same. What I noticed is that empty states are represented by a special symbol called an empty set ∅....
Content: The Christofides algorithm finds a minimum spanning tree, then finds all the odd degree vertices, and adds extra edges using a minimum weight bipartite matching on those odd vertices to make all of them even, so that a Eulerian tour can be found (since all vertices are even now). My question arises from a simp...
I am thinking about the NP-completeness of two graph problems on different graph structures. For example: The Capacitated Minimum Spanning Tree for graph is NP-hard. However, is the problem still NP-hard for DAG or tree? For Price Collecting Steiner Tree, it's NP-hard for graph. What about for DAG and tree?
Intuitively, given: a graph a root node a reward mapping from node to real number a cost mapping from node to real number We want to find the tree that maximizes the reward while keeping a quadratic cost function under some threshold. Formally, given: a graph $G=(V, E, w, c)$ where $w: V \rightarrow \mathbb{R}$ and...
Which general machine-learning methods are there that try to "learn" or interpolate a smooth multivariate function and which get to actually choose the points at which the function is evaluated during the learning process (exploration)? The idea would be that each function evaluation is more or less costly and the algo...
As you know a set of edges whose removal leaves $k$ connected components is called a $k$-cut. The minimum $k$-cut problem asks for a minimum weight $k$-cut. For $k=2$ this problem is P. Vazirani in his book says for any fixed $k$ when $3 \le k$ it is NP-hard and When $k$ is specified as part of the input this problem ...
Suppose M is a CFL and N is aa RL. Then wouldn't the language generated by the intersection of M and N contain strings, some of which are accepted by both DFA and PDA? So if they are accepted by a DFA as well, then why is the generated language not an RL?
Consider the following variation on the vertex cover problem: given a tree on $n$ vertices, we are asked to calculate minimum size of a multiset $S$ such for each edge $(u,v)$ in the tree at least one of the following holds: $u\in S$, $v\in S$, there are at least two vertices in $S$, each of which is adjacent to $u$ o...
I am new here . Please forgive me if there is anything wrong in that I am going to write . So , my question is about one problem given in last round of codeforces , pretty easy to handle it , but I do not understand the other players` solutions . THE PROBLEM : We have a convex polygon and numbers it's vertices 1, 2, .....