instruction
stringlengths
35
29.1k
Is there a way to show that for all finite sets $S$ of context free grammars, there exists a Turing Machine $M$ such that for all grammars $G_1, G_2 \in S$, we have that $M(G1,G2)$ terminates and answer yes if and only if $L(G_1)=L(G_2)$? Is that even true? I know that this problem is in general undecidable, but I also...
Is there a way to figure out what the following CFG accepts? $\qquad\begin{align} S &\to S \vee T \mid T \\ T &\to T \wedge F \mid F \\ F &\to p \mid\; \thicksim p \end{align}$ I'm confused by the boolean algebra symbols. I know the first is S or T, the second is T and F and the third is not p but I'm not sure h...
I am having hard time solving the following problem. Are there any languages for which $$ \overline{L^*} = (\overline{L})^* $$ Assuming $\emptyset^* = \emptyset$, if I consider $\Sigma = \{a\}$ and L = $\Sigma^*$, I get that $L^* = L$ and that $\overline{L^*} = \emptyset$. For the right side I get $\overline{L} = \...
I would like to find a algorithm that will do the following: Given two sets $A, B \subseteq \mathbb{R}$, where $|B| > |A|$, find the largest subset $C \subseteq B$, such that: $\qquad |\operatorname{mean}(A) - \operatorname{mean}(C) |< \delta$ and $\qquad |\operatorname{std}(A) - \operatorname{std}(C) | < \epsilon$ I...
I am an undergraduate computer science student at Cal Poly (SLO) and I have some flexibility in which math courses I can take, but I don't know which math courses would be most beneficial. I have already taken a statistics/probability course and Calculus 3. My options are pretty flexible for a Mathematics/Statistics el...
I thought this would be the best place for a question like this. Anyway, I was wondering what minor would go well with a Computer Science degree. I was considering a minor in math but I am not entirely sure if that could help out or not. I am currently a second semester freshman and I suppose that this is the best/late...
I am somewhat confused with the running time analysis of a program here which has recursive calls which depend on a RNG. (Randomly Generated Number) Let's begin with the pseudo-code, and then I will go into what I have thought about so far related to this one. Func1(A, i, j) /* A is an array of at least j inte...
I'm reading the Dragon Book. The following is from the start of Section 3.1.3. When more than one lexeme can match a pattern, the lexical analyzer must provide the subsequent compiler phases additional information about the particular lexeme that matched. For example, the pattern for token number matches both 0 and 1,...
While reading the research paper Polylogarithmic Concurrent Data Structures from Monotone Circuits [@JACM'2012] by James Aspnes, Hagit Attiya, and Keren Censor-Hillel, I am not sure about some points and need some verification and explanation. In the first three sections of the paper, the authors presents constructio...
Let $C\subseteq 2^X$ be a concept class over $X$ and let $\bar{C}:=\{X\setminus c\mid c\in C\}$ be the complement. Show that $VCdim(C)=VCdim(\bar{C})$. Proof: Let $d:=VC_{dim}(C)$, then there exists $S\subseteq X$, $|S|=d$, s.t. $S$ is shattered by $C$. Let $d':=VC_{dim}(\bar{C})$, then there exists $S'\subseteq X$, $|...
This is a follow-up question regarding Knuth's one formulation of the concept of an algorithm here. I am asking it here because I do not have enough reputation to post a comment to that question. To make my question self-contained, here it goes. Knuth introduces the following formulation which "restrict the notion of a...
I know that this is a known theorem but I can't find its proof. The theorem is: The write-contention of any $n$-process wait-free consensus algorithm (implemented from any read-modify-write operations) is $n$. Can someone link me to a proof or an explanation?
I'm trying to figure out which is better asymptotic complexity, $O(\log{\frac{n}{p}})$ or $O\left(\frac{\log{n}}{\log{p}}\right)$. $p$ is the amount of parallelism (i.e. number of cores), and $n$ is the problem size. When I plot them in Grapher.app with any constant value for $p$, the first looks better: But when I tr...
This is a follow-up question to this. Consider the 2-paths problem: Given a directed graph $D=(V,A)$ and pairs of vertices $(s_1,t_1)$ and $(s_2,t_2)$, are there paths $P_1 = (s_1,\dots, t_1)$ and $P_2=(s_2,\dots,t_2)$ such that $P_1$ and $P_2$ are vertex-disjoint? This problem has been shown to be NP-complete (refer...
If $f(x) = \Omega(n)$ and $g(x)= O(n)$, what would be the order of growth of $f(x) \cdot g(x)$ ? First I figured it should $\Theta(n)$ , as two extremes would cancel each other and the order of growth will be same as $n$ But, where I came across this question, the answer given was $\Omega(n)$, and no proof was mention...
I have two algorithms which I would like to implement: First, given a (very long) list $\{\mathbf{r}_{i}\}_{i=1}^{n}\subset \mathbb{R}^{3}$, a point $p \in \mathbb{R}^{3}$, and a distance $d>0$, find all $i$ such that $|\mathbf{r}_{i} - \mathbf{p}| < d$. Currently, I sort the list over the $x$-coordinate, so that if $x...
I'm a CS undergrad so my math/CS knowledge is not that deep so please correct me if my premise is flawed or I have made some incorrect assumptions. So I was thinking, much in the way that some primality testers are probabilistic(they give you yes or no but have a chance to be wrong). Would it be possible to build a pro...
I'm curious if there is a name for this way of ordering finite sets of natural numbers (shown here for the case 3 elements, but can be extended to any number of them): {0, 1, 2} < {0, 1, 3} < {0, 2, 3} < {1, 2, 3} < {0, 1, 4} < {0, 2, 4} < {1, 2, 4} < {0, 3, 4...
I believe the following question in summary is: How to approximate Euclidean distance in a digital plane? When a pebble falls on a calm surface of water a circular wave propagates. I want to color the pixels with time to show this effect. So I discretize the time and in each time step, starting from the center, I col...
I am trying to construct NFA for all languages ending in 00. I got this and this First one I could convert to DFA by subset construction and I got the correct DFA. For the second one I got the DFA by subset construction, but it is not the correct one since it couldn't accept strings like 100. Is this beacuse, there ...
We know VC dimension of 1-NN classifier is infinite for continuous metric space. Is there any proof of VC dimension of 1-NN classifier if the metric space is discrete?
$1+3+5+...+(2n+3)=n^2+4n$ For this series using induction proof. Base case 1,2,3,.. not working. But induction step works well. Base case is not given in question.
I read a book which says that in Predicate Calculus, syntactic theorem proving is identical (complete and sound) with semantic entailment and this is very useful because it is easier to prove positive witnesses in natural deduction whereas when you seem to fail you better switch to semantic account to demonstrate a cou...
In case of branch Instructions such as beq, bne, we use PC-relative addressing. But I am not clear why it is said in most of the books that MIPS address(while calculating branch target) is actually relative to the address of following(or sequentially next) instruction (PC+4) as opposed to the current instruction (PC)? ...
I've been reading text books about distributed algorithms. They usually present a large collection of algorithms under various hypothesis and guarantees, with their proof of correctness. But they often fail to mention the practical application of those algorithms, and their relative usefulness and importance. For insta...
given a turing machine M over the input alphabet $\Sigma $ , any state q of M and a word w $\epsilon\Sigma $* , does the computation of M on w visit the state q ? Is this problem decidable ?
If any problem P is NP complete then if there is a polynomial time reduction of P to another problem R then what can we say about R.Is it NP-hard or NP complete ? From Theory of computation of Hopcroft,Ullman theorem 10.4 it says it would be NP complete but there some times when i see that it is NP-Hard in some other r...
I am currently writing lists with lazy semantics in the pure lambda-calculus with call-by-value reduction strategy. I tried to construct pleasant to use and relatively efficient "lazy" functions on lists. As in the Church encoding I identify list with its right fold function, but with some differences. Here is nil and...
This question is prompted by Undecidable unary languages (also known as Tally languages) How does the countability of a language imply (un)decidability?
I read several times that it is not possible to flip the answer of a NDTM efficiently. However, I don’t understand why. For instance, given a NDTM $M$ that runs in $O(n)$, this text (section 3.3) states that it is unclear how another NDTM $T$ can determine in $O(n^{100})$ time how to flip $M$’s answer. My Problem is as...
Let $G=(V,E)$ a directed graph. We define $v \in V$ to be "nearly root" of there's a path from $v$ to at least $|V|/2$ vertices. How do you find the set of all "nearly roots" in linear time? What we've tried is to build the strongly connected graph $G_{scc}$ obtained from $G$ and then to do a topological sort. Now we w...
It seems to me to be incorrect to say that lexicographic DFS is P-complete, since it isn't a decision problem. There is a corresponding decision problem, first DFS ordering, which is known to be P-complete. However, I want to talk about complexity of DFS, not it's decision problem. What complexity class should I say DF...
I'm currently trying to find an efficient algorithm to solve a discrete optimization problem that arises when constructing decision trees. The problem is as follows: Say we are given $N$ ordered data points on the real line: $x_1,\ldots,x_N \in \mathbb{R}$ such that $x_1 < x_2 < \ldots < x_N$. Each of the points $x_i$...
First of all, I would like to apologize if this question is in the wrong section. For all I know, it could be placed in Super User, Reverse Engineering, or Stack Overflow. Now lets get back the experiment I tried: What I did was took an executable file and changed its file type to a text document type. Then I opened th...
I have the following context-free language: S -> ASa | b A -> aA | a I don't understand why this is not regular. I first said that it's generated by the regular expression a+ba+. The following is regular however S -> ASa | b A -> aA | e e stands for the empty string. I don't understand their differences.
My textbook says: "We define the function $f\colon \mathbb{N}\to\mathbb{N}$ as follows: $f(1)=2$ and $f(i+1)=2^{f(i)^{1.2}}$. Note that given $n$, we can easily find in $O(n^{1.5})$ time the number $i$ such that $n$ is sandwiched between $f(i)$ and $f(i+1)$." How can I convince myself that we can in fact easily find $i...
a spin lock solution to the critical path problem is shown below . my question is will this or will this not result in starvation ? Thread A Thread B leave note A; leave note B; while (note B) {\\X if (noNote A) {\\Y do nothing; if (noMilk) { } ...
In most (all I have seen) work on cellular automata, the state of a cell is from a finite set. Such as a cell can take value from a binary set, or from among few colors. Can we define the state to be something more complicated such as a function of the coordinates of the neighbor cells? (assuming there is a initial coo...
the standard List type in Coq can be expressed as: Inductive List (A:Set) : Set := nil : List A | cons : A -> List A -> List A. as I understand, W-type express a well-founded tree of elements of this type. so, what if nil is not qualified by A? i.e. we have: for all A: Set nil : List A instead of for all A: Set ...
I am asked to find two functions that are not big-oh of each other. Is it correct if I pick say $f(n)=2\sin (n)$ and $g(n)=1$? That way, $f$ will never always be greater than $g$.
What is the correct way? Hamilton path, Hamilton's path or Hamiltonian path? To be clear, I am referring to the correct way to name a graph such that there exists a single path (without repeated vertices) through all the vertices. In Wikipedia it says "Hamiltonian path", whereas in an article I found "Hamilton path".
I have Java function as input and want to get it's order for example O( n ) I search in the internet very hard but didn't find any thing can help me, is there any algorithms or package may help me.
A popcount order of a two bit vector {1,1}=3 can be given by: {{1, 1}, {1, 0, 1}, {1, 1, 0}, {1, 0, 0, 1}, {1, 0, 1, 0}, {1, 1, 0, 0}, {1, 
 0, 0, 0, 1}, {1, 0, 0, 1, 0}, {1, 0, 1, 0, 0}} and as a sequence of integers: {1, 2, 4, 8, 16, 32, 64, 128, 256} We are basically just shifting bits... A Mathematica code for it ...
As we all know the million dollar question in Computer Science P=NP or not. I was trying to understand it and got some doubts please tell me whether I'm right or wrong N=NP in two cases Case 1: We have found an algorithm which can solve a NP-Complete problem in P-Time. This implies that P=NP=NP-Complete. But still we...
I know that each regular language can be generated by a CFG. This makes, in one sense at least: context-free languages more general than regular languages. Are there known results about the 'complexity' of regular languages in the CFG context? For example, is it true that every regular language can be generated by an u...
I'm trying to find a solution for this exercise: Give the pseudocode of an algorithm which takes two positive integers n and k and prints all the non-decreasing sequences of length k (1,2,...,n). For example n=4, k=3: 111 112 113 114 122 123 124 133 134 144 222 223 224 233 234 244 333 334 344 444 the complexity ...
I have been faced with a problem where three concurrent processes X, Y ,Z execute three different code segments that access and update certain shared variables. Before entering the respective code segments : Process X executes the P operation on semaphores a,b and c; Process Y executes the P operation on semaphores b,...
I am trying to find a good resource for learning on how to design and create a new programming language. It seems like a search for books in amazon raises some difficulties, because the vast majority of results are about programming languages, not on how to design them.
I know that: If $f(n) = O(g(n))$ , then there are constants $M$ and $x_0$ , such that $f(n) <= M*g(n), \forall n > n_0$ The other, plain English way of defining it is, If $f(n)=O(g(n))$ then for large $n$ , $f(n)$ would grow as fast as $g(n)$. I got confused when comparing $2^n$ with $2^{2n}$. Here , $f(n) = 2^n$ and ...
Looking at this solution on page 3 but having trouble understanding the evaluation function specifically. For non terminal positions, we use a linear evaluation function defined as Eval (s) = 3[X2(s)]+X1(s)−(3[O2(s)]+O1(s)) We define X n ( s ) as the number of rows, columns, and diagonals in state s with exactl...
Earlier this week a paper was released describing an algorithm for building optimal alphabetic ternary trees. The alphabetic property as described on Wikipedia as Alphabetic trees are Huffman trees with the additional constraint on order, or, equivalently, search trees with the modification that all elements are ...
In case of branch Instructions such as beq, bne, we use PC-relative addressing. But I am really not clear why it is said in most of the books that MIPS address(while calculating branch target) is actually relative to the address of following instruction PC+4 as opposed to the current instruction PC? Anybody please exp...
Many people say that TAOCP is not supposed to be read as a book (actually a volume of books), but if I decide to go that way, which math/computer science books/topics do I need to study to help me follow it? There is a related question on stackoverflow but I would like to read the suggestions of cs.se users.
The Cheriton-Tarjan MST algorithm finds MSTs in time O(m log log n) in arbitrary graphs by using a cleverly-modified version of a leftist heap data structure to store edges. It was developed in 1976. The algorithm relies on the fact that leftist heaps can be merged in time O(log n), but also uses the fact that leftist ...
Say I have 2 carts on an infinite railroad, each cart is initially under a lamp. There are only 2 lamps, and they are at a fixed location, hence they don't change their location. The distance between them is D, but its not known. Each cart has a processing unit, both will execute a copy of the same program once the who...
I am looking at the answer in solution manual which asked , all the words that don't have both substring bba and abb. and the answer was a*(baa*)*b+b*(a*ab)*a* and I'm like wait a minute is that right ? but that can't make abb, which is in the language. So it's gotta wrong. so I came up with my own , would this be all ...
Suppose I wanted to find all valid nets of a polyhedron. Is this kind of problem NP-Hard? My guess is that it is. If you were to increase the "complexity" of the polyhedron (maybe this is the number of faces?), there is no "shortcut" to discovering all the nets; you would have to enumerate all combinations. This sort o...
The below is from an article titled: Minimax: Recursive Implementation To be a recursive function, you need to call yourself. What part of this pseudo code is calling itself? How does depth-first effect the recursion process? There seems to be a return in every line of minimax-value, shouldn't the return be only o...
I am a high school student computationally studying the 3-dimensional structure of chromosomes by 40 kilobase loci. In a nutshell, loci that are close in space tend to express their genes at the same time ― loci are different stops on a 3D-winding DNA chain. The best way to understand the 3D structure is by gathering w...
A homework problem in my current CS class asks us to produce a comparison-based procedure for taking (essentially—there are some poorly-specified rules about duplicates) the set intersection of $k$ unsorted arrays of at most $n$ elements each. For full credit, we are supposed to do this in $O((k-1)n)$ comparisons. (Spe...
I need help constructing a Left Linear grammar for the language $L = \{ a^n b^m c^p \mid n\geq 2, m\geq 3, p\geq 4 \}$ Here is what I have so far, I know : $N = \{S\}$ $T = \{ a, b, c \}$ $P = \{$ $S \rightarrow Pcccc$ $P \rightarrow Pc$ $P \rightarrow M$ $M \rightarrow Mbbb$ $M \rightarrow Mb$ $M \rightarrow N$ $N \ri...
The following was asked as part of a homework assignment and I am not asking for the solution to these but rather tips or resources on how to solve this and similar questions, Let $f(n)$ and $g(n)$ be two functions from $\mathbb{N}^+$ to $\mathbb{R}^+$. Prove or disprove the following assertions. To disprove, you only...
I'm currently reading a book (and a lot of wikipedia) about quantum physics and I've yet to understand how a quantum computer can be faster than the computers we have today. How can a quantum computer solve a problem in sub-exponential time that a classic computer can only solve in exponential time?
Could somebody explain the difference between dependent types and refinement types? As I understand it, a refinement type contains all values of a type fulfilling a predicate. Is there a feature of dependent types which distinguishes them? If it helps, I came across Refined types via the Liquid Haskell project, and de...
Why can't arbitrary base conversion be as fast as converting from base $b$ to base $b^k$ ? Seems to be a big time complexity difference! I am also interested in reading material about it. Old. Original detailed question Conversion between power-2-radix can be done faster than between non-power-of-2 radix, they can b...
I read in this article that the amount of bits that can be emulated by a certain number of qubits is 2^(number of qubits). This is because each qubit can be in one of 2 states after it collapses, and so before all the quantum... whatevers collapse, that is the function that gets that result. At least, that was generall...
This is a problem involving the theory of regular languages. I am stuck on this problem and do not know how to solve this type of problem. Prove that the language $B_n = \{ a^k \mid k \text{ is a multiple of } n \}$ is a regular language for any $n \ge 1$. Let me describe my thoughts thus far: It is easy to show ...
I was trying to rule out whether this was LL(1) by checking for left-recursion in the following grammar: $\qquad A \to 0 A 1 \mid 0 1$ Which produces: $\qquad 0 A 1 \Rightarrow 0 0 A 1 1 \Rightarrow \dots$ But I am unsure what type of recursion this is called, since it sorta stays in the middle. If this is not left-re...
I've been reading about the No Free Lunch Theorem, but I can't quite understand what it is about. I've heard this theorem described elsewhere as the claim that "no general purpose universal optimiser exists". On the other hand, the Wikipedia article talks about 'candidate solutions" that are "evaluated one by one" - i...
Linearizability is a well-known correctness condition for concurrent objects. It provides the illusion that each operation applied by concurrent processes takes effect instantaneously at some point between its invocation and its response. To prove linearizability of an implementation, it is necessary and sufficient to...
Let $L = \{a^n \mid n \ge 0\}$, where $a^0 = \epsilon$ and $a^n = a^{n-1}a$ for all $n \ge 1$. Thus $L$ consists of sequences of $a$ of all lengths, including a sequence of length $0$. Let $L_2$ be any infinite subset of $L$. I need to show there always exists a DFA to recognize $L_2^*$. If $L_2$ is a finite subset it...
Suppose we had 2 arrays of the same size with positive numbers and we wanted to pair up the elements of each array such that the total difference between the pairs is minimized. The first thought would be to choose pairs with the minimum difference and so on. But it turns out the correct algorithm is to sort them and t...
Suppose in a given plain there are fixed number of lines. A point P lies on one of the line. How to find which line intersects the point P ? I am giving an example In the above graph point P is on the line CE. We can determine it visually.But my problem is how to make the computer understand it. Is there any algorith...
Here is a context-free grammar with a single nonterminal symbol S and three terminal symbols +, *, and s: S -> + S S | * S S| s My purpose is to build the LR state machine for this grammar. My attempt: [State 0] -> [State 1] -> [State 2] S -> . + S S (+) S -> + . S S (*) S -> * . S S ...
I'm trying to write some little code (POC for the selection/mutation operators) that uses a genetic algorithm to solve a global maximum for a function. f(x_1...x_n) = M - (x_1 - a_1)^2 - (x_2 - a_2)^2 - ... - (x_n - a_n)^2 M a_i are constants. I have to find x_i such that f(x_i) = max(f) = M My selection method is tru...
I'm trying to understand the Huffman compression algorithm. Lets assume the word : YESSSS According to Huffman tree we will get : S : 4 times -> Code : 0 Y : once -> Code : 01 E : once -> Code : 00 at the end YESSSS will become : 01 00 0 0 0 0 So far everything is clear. Now my problem is in the space between t...
How can we prove a binary search tree with $n$ internal vertices has height $h = \lceil \log(n+1) \rceil$?
I was convinced that my idea for a solution to sort $k$ sorted lists into one list would work with a 'variation' on MergeSort. I was told this would not work and had to use Heapsort, but didn't get any explanation or intuition behind it. (I believe the assumption is that each of the $k$ lists had size $\frac{n}{k}$) Es...
The Triangle Cover Graph problem is this: Given a graph $G = (V,E)$ and an integer $k$, does there exist a set of at most $k$ vertices of $G$ such that every triangle contained in $G$ also contains a vertex of the set? This problem is obviously in $NP$ as its verifier is just the set which you can easily check. Howe...
I have a question regarding a graph algorithm which is as follows: Given a graph $G = (V,E)$ whose vertices are uniquely labeled $\{1, 2,\dots ,n\}$ we want to determine the smallest integer $k$ such that deleting vertices $1$ through $k$ results in a graph whose largest connected component has at most $n/2$ vertices (...
Suppose we were using a priority queue (PQ) to implement Prim's algorithm. My understanding is that initially the weight of all vertices is set to $\infty$. The weight of the starting vertex is then set to $0$. All of the vertices are then inserted into the PQ. Does that mean that we can insert the vertices in any or...
While studying automata theory a typical problem that I face is of the following type: Constructing a DFA with minimum number of states for all strings over $\{a,b\}$ which have number of $a$’s divisible by $X$ and number of $b$’s divisible by $Y$ (where $X$ and $Y$ are some positive integer values). Is there som...
Let $G=(L,R,E)$ be a bipartite graph, are there conditions on the degree of the vertices under which the condition of Hall's theorem is surely satisfied? (meaning a perfect matching exists in the graph). Konig's theorem proves that every $k$-regular bipratite graph has exactly $k$ edge disjoint perfect matchings, so th...
When analyzing an algorithm, the following recurrence relation popped up: $T(n,d)=2T(n/2,d)+T(n,d-1)+O(dn)$ where $T(n,1)=O(n \log{n})$ and $T(1,d)=O(d)$. By applying the Master Theorem inductively, for any particular $d$, it holds that $T(n,d)=O(n (\log{n})^d)$. However, it does not necessarily hold that $T(n,d)=O(n (...
Let $G=(V,E)$ be a directed graph. The connectivity of a graph is the defined as the cardinality of a smallest separator of $G$. A separator of $G$ is a subset $U$ of $V$, such that $G-U$ is not strongly connected. Why does the following algorithm compute the connectivity of a graph correctly? \begin{equation} \begin{s...
It makes me wonder that despite of (CFL) being a subset of Turing Decidable languages, Turing Decidable is closed under intersection while CFL is not. Does not Turing Decidable engulf all CFLs?
I am taking a programming languages course, and we have had to use the Inversion Lemma many times in our proofs of preservation. We have been given the Inversion Lemma in each of these examples, but is there a general statement of the inversion lemma that can be applied to any proof of preservation? Can someone write t...
Describe a regular language that cannot be accepted by any DFA that has only three states. I'm not really sure where to start on this and was wondering if someone could give me some tips or advice. I understand that the pumping lemma can be used to prove a language is not regular, but in this case, it should be a reg...
How can I find the cost of pseudocode with a nested loop and a nested if statement? On the left hand side is an example from a textbook I am following. On the right hand side is pseudo code that I found. I took a guess, but I don't know what the time would be for the inner code fragments. I am especially unsure what t...
I know that depth-first search can be used to produce a depth-first spanning tree, which classifies all edges as tree edges, forward edges, backward edges or cross edges. Are there any algorithms that make use of the depth-first spanning tree?
I am considering strategies to compare the performance of routers with buffers vs. their lower latency counterparts in a simple network setting (N clients communicating with each other randomly through a router). I know that buffered routers should ideally perform better when there are traffic bursts. My question is re...
I have an undirected graph where each node is labelled with an integer key and I'm asked to detect every simple 4-cycle, which can be seen as an empty square (i.e. the two opposite nodes of the cycle have not to be connected). I know the labels of a generic square in the graph can be permuted in $4! = 24$ ways, but on ...
Background: In section 4.2 of the paper Linearizable Implementations Do Not Suffice for Randomized Distributed Computation@STOC'2011, the authors mentioned two typical proof strategies for linearizability of implementations. In the following, Let $O$ be the implemented object and let $H$ be a history over $O$. In one ...
Given a linear grammar G, is it possible to determine if L(G) contains a palindrome?
Context-free grammars, as well as other types of grammars, can naturally associate structure with the strings of the defined language, for example tree structures in the case of context-free language. What kind of structural features can be thus described by regular grammars, and associated with the strings of the lang...
this optimization problem, I am working on, is kind of making me crazy. ;) Given is a list o of sets (with finite cardinality) of strictly positive integer values (Z>0), e.g.: o_without_sizes = [ {1, 2, 3, 4} , {5, 6} , {2, 3, 4, 5} , {5, 6, 7} , {7, 8} . {9} ] Every set has a name n (also in Z>0, but only for identif...
I have thought about the most useful way of checking an array for 2 elements that sum to X. The trivial solution is to check the sum of every element with every element, and the complexity of this solution is $O(n^2)$. My solution is: Say the array is A. It's length is N. Elements are from A[0] to A[N-1] Pseudo-Code is...
I am struggling with this question for a very long time and just can't find the flaw. So I am given a false Theorem: The language $\{awwa \mid w \in \{a,b\}^* \}$ is regular. Well, that part is obvious, we can prove that the language is not regular using the pumping lemma. The question I am asked is to find the flaw ...
I've seen a lot of text concerning the first NP-Complete problem, Boolean Satisfiability. I guess I'm confused concerning the language. It sounds to me as though the problem could be difficult to compute (hence the NP-complete), however it still might be satisfiable. As in, there exists a satisfying mapping of literal...
I hope I named this CNF Boolean sentence the correct way. The way I see it, a 2P2N is where each literal appears twice (or at most twice, but we can say twice without loss of generality). I am trying to prove it is Satisfiable. How do I do this? Do I need to try to reduce it to 3-SAT (might need some help doing that a...