instruction
stringlengths
35
29.1k
What does superscript + mean in relational algebra? Suppose $A$ is a subset of attributes of all attributes in a relation $R$. What does $A^+$ mean?
Is there already a worst case time complexity proof for the sum of all elements in a power set? I would assume, naively, you have to just add everything, which would run in about 2^n, where n is the size of the set. For example: A = {1,2,3} Powerset(A) = {{}, {1}, {2}, {1, 2}, {3}, {1, 3}, {2, 3}, {1, 2, 3} } Sum(Power...
I implemented dependently typed lambda calculus in the spirit of this article: http://www.andres-loeh.de/LambdaPi/LambdaPi.pdf The calculus, works and I experimented with it and like it. However, I want to add inductive types to do more complex stuff. What are the options for doing this? I am thinking about two ways of...
Let's say we have a directed graph $G = (V, E)$ for which $(v, w) \in E$ and/or $(w,v) \in E$ holds true for all $v, w \in V$. My feeling is that this graph most definitely is Hamiltonian, and I want to find a Hamiltonian path in it (from any vertex to any other vertex, I don't care where to start or stop). I wanted to...
Does anybody know any toy database / relations that are particularly good and also complete to demonstrate and test relational algebra concepts? I'm hoping some database researchers should have already made that and improved over long time from pedagogical practices.
I'm curious to know if this problem is NP-Hard / NP-Complete, which I believe would mean I'm unlikely to find a polynomial-time algorithm to solve it. I have written a program which randomly generates a tournament fixture, and I call it many times to try to pack the matches into the smallest number of rounds. When it c...
In a given cellular automaton, such as Conway's Game of Life, is there anything known about how many Garden of Eden patterns there are by pattern size? Say, pattern size is n x n, what's the likelihood that a random pattern is a GoE as n increases? Also, by the Garden of Eden-theorem, only cellular automata which are ...
How would about proving this is not regular with the pumping lemma. Please include all steps and explain all steps. I am really new with this. $1^{2x}0^y$ and $y>= x$ Does it matter which side you pump? How do you pick which side to pump? This is what I was thinking: $$u = 1^{2x}$$ $$v = 0^y$$ $$w = 1^{2x}0^y$$...
I am trying to prove this expression but don't have an exact idea about what to do: If $E$ is any alphabet and $L$ is any language $L \subseteq E^*$. Prove that $L^*L^* = L^*$.
I have a variant of bidding problem at hand. There are N bidders(~20) who bid for items from a pool of many items(~10K). Each bidder can bid many items. I want to maximize the number of bidders who are satisfied. A bidder is satisfied if he gets all the items that he bid for in the first place. For eg- Bidders = A,B,C ...
$ALL_{REGEX}$ is the computational problem of determining for regular expression x if $L(x) = \Sigma^*$. In a proof for $ALL_{REGEX} \in PSPACE$, the following non-deterministic turing machine $M(R)$ on regular expression $R$ is given Convert R to an NFA $N = (Q,\Sigma,\delta,S,F)$; $K = S$; While $K \cap F \neq \...
I am trying to solve a given problem: Find an algorithm to determine if a graph has a clique of size 3 in $O(n^{2.81})$ steps. The hint given is that $2.81 > \log 7$. In order to solve this I came up with a conjecture: if $m > n^{\log 7}$ then the graph has $K_3$ as a subgraph. This will easily solve the problem if the...
For a proof I need to use the fact that every word in the language of an enumerator occur on the output paper in finite time. Is it true? For example, the language of the natural numbers in decimal representation. Can the enumerator print the odd numbers first and then the even numbers? (if yes, I am wrong) $1, 3, 5, 7...
Basically, I believe that if you have something like a .dmg file the OS opens it with a certain program which takes the code behind it and does things to it. So why couldn't you then take the program that runs the .dmg file on Mac and put it on window to run the program? I know I'm probably missing some key component h...
(This is based on my earlier MSE question that has been stagnant for just over a week, since the best answer only addresses the case of two mines and does not even completely resolve that.) What is the computational complexity of playing 1-dimensional Minesweeper in a way that maximizes the probability of winning, wh...
Can a Turing Machine decide whether an arbitrary real number is computable or not? Does this even follow from the solution of the Halting problem? If not, who proved it?
I'm an undergraduate just beginning to read about reversible computing. I know that, because of Landauer's principle, irreversible computations dissipate heat (and reversible ones do not). I brought it up with my professor, who had never heard of reversible computing before, and he was having difficulty understanding w...
In the plot squared length of Fourier coefficients vs frequency, the peak gives the strongest frequency. does it give the accurate value of period?? Is it like a single frequency in frequency domain corresponds to a range of periods??
I am trying to work out centrality in a network using Freeman's network centrality. I have an in degree of 83 and an out degree of 110. I want to work out the network centrality using my out degree using the following formula: $$ \frac{\sum_{i=1}^{g}[{C}^d ({n*})-C^{d}]} {[(N-1)(N-2)]} $$ This is where $$ {n} $$ is ...
Suppose one wanted to build a tree at random. Let the first insertion at step $i = 1$ be the root node. From here, nodes are inserted into the tree at random one at a time. How would one go about calculating the expected number of nodes $E(d)$ at depth $d$ after $i$ insertions? For example, At $i = 1$, it's just the...
Can there be any relations regarding the number of nodes available in a digraph so that to qualify it as NP-Complete problem. If we consider this problem for instance: Input: A digraph $G=(V,E)$ and two nodes $u,v \in V$ Question: Is there a path in $G$ from $u$ to $v$? Can we say this problem is NP-Complete problem...
I've always wondered why processors stopped at 32 registers. It's by far the fastest piece of the machine, why not just make bigger processors with more registers? Wouldn't that mean less going to the RAM?
What will happen if sequence number is not used in an ARQ protocol (e.g, Go-back-N, selective repeat)?
Hi I am trying to solve a LL(1) form question for first n follow rule The question is A::=BC|C B::=Bd|ef C::=gh|j What I have done to eliminate left recursion A::=CA’ A’::=CB’ A’::=ϵ B::=efB’ B::=dB’ B’::=ϵ C::=gh C::= j Is it correct? Thanks guys, it has been solved.
This is a problem from 'Concrete Abstractions' which is available free on the web[1]. It's a book similar to SICP. The problem: Exercise 2.16 Consider the following procedure foo: (define foo (lambda (x n) (if (= n 0) 1 (+ (expt x n) (foo x (- n 1)))))) Use induction to prove that (foo x ...
Hello everyone just like the title says I want to prove that $H(x) = \mu y T(x,x,y)$ has no total computable extension such that if we had a function $BIG(x)$ that is both total and agrees with $H(x)$ whenever $H(x)$ is defined, then $BIG(x)$ is not computable. This is a homework question so I don't want a full solutio...
I meant that that the game programmer can just add its own code to the game to manipulate its own low level function as the operating system does provide in a common executables,and load it into the boot mode using its own bootstrap
I am reading the paper: "Maximum Weight Independent Set Of Circular-Arc Graphs and It's Applications" (http://link.springer.com/article/10.1007%2FBF02832044). And I had a question regarding the proof of Lemma 3 in the paper. It is stated as follows. If $X$ is the maximum weight independent set of the circular-arc graph...
As we all know, Matrix Factorization is an effective method to do rating prediction jobs in recommender systems. Thanks to the work of Yahuda Koren. My question is why MF can do this job? What's the physical meaning behind it?
I'm looking for examples of loops that have running time $O(nm)$, $O(n+m)$ and $O(n\log m)$ to help me understand these concepts. Could anybody give some examples and explain why they have the given running time?
I made a method that appends a sequence to another sequence. So: (append [1,2,3] [4,5,6]) = [1,2,3,4,5,6] CODE In C# IEnumerable<int> Append(IEnumerable<int> xs,IEnumerable<int> ys) { using(var iteratorX = xs.GetEnumerator()) using(var iteratorY = ys.GetEnumerator()) { bool isTrueForX = false; ...
Union-By-Rank and Path Compression is supposed to improve the performance of a tree implementation of a disjoint set. However, in looking at the UNION(x, y) operation, I noticed that if x and y are actually the roots of the 2 trees being merged, no path compression actually takes place. The resulting tree would simp...
Bloom filters are a variant of hash tables except it is much more space efficient at the cost of a low probability of false positives . How it works : Assume there are 10000 bits , 3 hash functions and an object Foo is to be inserted into the Bloom Filter . Insertions : Foo will be hashed by the 1st hash function and t...
I am reading the proof of PCP theorem in Proof Verication and Hardness of Approximation Problems. The following paragraph appears in section 3 (page 4), "Outline of the Proof of the Main Theorem". The results of these sections show that $NP \subset OPT (poly(n), 1)$ (Theorem 5) and $NP \subset OPT (\log n, poly \log n...
When using 2's complement with 4 bits, the largest positive int I can represent is 0111. The smallest negative one is 1000. The smallest int should intuitively be the negative of 0111 - 1 = 0110 since we can represent one more positive than negative int. If we invert the bits of 0110 and then add 1, however, we get 101...
We all know how to use “Big O” notation to show how CPU instructions run increase as the size of the dataset increases. E.g. a quick sort is O(n log n). However for the last few years, instructions that don’t access any data outside of the level 1 cache have been close to free compared to instructions that hit main ...
Garbage collections have to visit all objects that are alive, so as to find the memory that can be reclaimed. (Having many generations’ just delays this a bit) All things being equal, it is clearly better to first visit the object that are already paged into RAM, before paging other block in and therefore paging out...
To prevent collisions in Hash table , seperate chaining with linked list is used . Hash table works by hashing the key and storing the value in the bucket. Assuming 4 keys hash to the same bucket , and the bucket has a linked list which has 4 nodes , how would we know which value belong to the key when we try to searc...
I need an efficient data structure for maintaining a set of values. Here, $n_1$ is the number of insertions per unit time; $n_2$ is the number of deletions per unit time; $k$ is the number of searches per unit time. I have 4 possible use cases: $k \gg n_1,n_2$ with limited memory $n_1 \gg k,n_2$ with limited memory $...
I am trying to wrap my head around recursion and divide and conquer algorithms. Can someone provide a proof and explanation of how many times a list of n elements can be divided in 1/2 on both sides.. In other words the total number of half divisions in a recursive divide procedure on a list of size n.
I have a problem with an exercise asking me to solve the following recurrence: $$f(n+1)=f(n)^2, \quad f(0)=2$$ Can someone explain how to solve this? I tried but couldn't.
I have been learning about Big O, Big Omega, and Big Theta. I have been reading many SO questions and answers to get a better understanding of the notations. From my understanding, it seems that Big O is the upper bound running time/space of the algorithm, Big Omega is the lower bound running time/space of the algorith...
I start to suspect this problem is very hard now that I cannot find a single relevant literature on the subject, but it's too late to change the class project topics now, so I hope any pointers to a solution. Please pardon the somewhat artificial scenerio of this question, but here goes: Technical version: Let $\Sigma...
I need to use discrete differential evolutionary algorithm for assigning discrete values from set size $L$ to vectors of size $D$ where $L$ could be smaller, equal or larger than $D$. Elements of vector $X$ could take the same values of other elements. My question is if we have a population of size $NP$ with each vect...
![enter image description here][1] I have a problem to solve this recurrence. I tried by myself but it doesn't look understandable. Solve the following recurrence
We know that every non-regular language can be recognized with $ \Omega (\log\log n) $ space complexity. I'm looking for an example of a language which is $ \Theta (\log\log n) $ space complexity (if such exists).
At the needs of my HW at uni I need to transform some Horn clauses to Prolog but I cannot figure out how to do it. I found out some guides but they describe how to do it with only one fact. So can you give me a brief example on how to do it? Eg John is beautiful and rich we can transform it at: not (Beautiful(John)) ^...
In the Wikipedia article on Rogers' theorem, it is stated that all total computable functions have a fixed point. The notation is a little hard for me to understand; a symbol is used that is used to denote "semantic equivalence." I do not know what semantic equivalence is; I would appreciate it if someone could shed ...
The is the running time of an algorithm : $0.5 X^2 + 3X$ , Q1) i dont understand why my lecturer says that the Big O is $O(X^3)$, shouldnt it be $O(X^2)$ as it is bounded by the quadratic power of $X$. Who is correct , me or my teacher ??? Q2) Why is the Theta of the equation : $X^2$, i cant understand why
I have a few small questions about section 2.4 ("Rule induction") in Practical Foundations for Programming Languages (p. 19). (1) In the rule induction principles for nat, To show P(a nat) whenever a nat, it is enough to show: (1) P(zero nat). (2) for every a, if (a nat and) P(a nat), then P(succ(a) nat). why is ...
Let me clarify: Given a scatterplot of some given number of points n, if I want to find the closest point to any point in the plot mentally, I can immediately ignore most points in the graph, narrowing my choices down to some small, constant number of points nearby. Yet, in programming, given a set of points n, in orde...
My teacher pointed out to us during lectures that we could use Graph Search to help us solve Sudoku puzzles which has left me puzzled . I dont see how this is possible as Graph Search is mostly about getting from Node A to Node B. He mentioned about how its a directed graph where the nodes correspond to partially comp...
I would like to know whether there is a method to find similar questions for a given question, just like this stackexchange.com does. Is there any paper or tools? I tried keywords such as "deduplication" and "linking" but it was not successful.
I know these relations : \begin{gather} \mathrm{NC}^1 \subseteq \mathrm{NC}^2 \subseteq \dots \subseteq \mathrm{NC}^i \subseteq \dots \subseteq \mathrm{NC} \\ \mathrm{NC}^i \subseteq \mathrm{AC}^i \subseteq \mathrm{NC}^{i+1} \\ \mathrm{NC}^1 \subseteq \mathrm{L} \subseteq \mathrm{NL} \subseteq \mathrm{AC}^1 \subseteq...
My lecturer told me that when I use an arithmetic I-Type command (ADDI,SUBI etc.) , the IMM field gets sign extended, and when I use a logic I-Type command (ORI,ANDI etc.) , the IMM field is just bits. He also said that if the IMM field contains a negative number, it is represented in 2's complement. Let's say I have a...
I’m trying to find an algorithm that can give me an approximate solution for a wiring problem that I have been asked to look at. I believe this is closely related to finding a node weighted Steiner tree – e.g. http://www.cs.umd.edu/~samir/grant/gk98b.ps. I have a number of connectors which have a fixed location in spa...
Say I plugged in a hardware true-random number generator (TRNG) to my computer, then wrote programs with output that depends on the TRNG's output. Can it do anything non-trivial that a Turing machine with a psuedo-random number generator can't do? (a trivial thing it can do would be generating truly random numbers)
Suppose that I have a set of $N$ points in $k$-dimensional space ($k>1$), such as in this question, and that I need to find all pairs with a distance¹ smaller than a certain threshold $t$. The brute-force method would require $N(N-1)$ distance calculations, which is not acceptable. I attack the problem by first sorti...
I've a set of grammar rules like this: $$ \begin{align*} &S \to AbB \\ &A \to aA|\epsilon \\ &B \to aB|bB|\epsilon \end{align*} $$ The grammar generates the following words: $$ \begin{gather*} AbB \to a^2AB \to a^3AB \to \cdots \to a^nAB \to a^nB \to \\ \to a^nB \to a^nbB \to a^nb^2B \to \cdots \to a^nb^mB \to a^nb^m, ...
Let $T = (V, E)$ be a tree with a designated root $r \in V$. The fact that the tree is rooted allows us to speak of "subtrees of $T$ rooted at some node $x \in V$". Let's say we have a (not necessarily injective) function $c: V \rightarrow \mathbb{N}$ that assigns a color to every node. We want to find for every node ...
I have the languages $L_1$ and $L_2$ such that $L_1 = \{a^nba^n :n \in N\}$ and $L_2 =\{a,b\}^*\setminus L_1$. I want to prove that $L_2$ is not a regular language. I know that to prove that $L_2$ is not a regular language I can use the pumping lemma but I'm unsure about the details. I also want to prove that $L_2$ is ...
I have a language where each string in the language has even amount of $0$'s as $1$'s (e.g., $0101$, $1010$, $1100$, $0011$, $10$ are all in the language). I was hoping to define a context-free grammar that describes this language. After defining a context-free grammar I want to formally prove that this context-free gr...
I am studying for my algorithms final and came across the following problem: Find three languages $L_1 \subset L_2 \subset L_3$ over the same alphabet such that $L_2 \in P$ and $L_1,L_3$ are undecidable. I am having trouble coming up with an example of three such languages. My first thought was to use a form of the hal...
I am reading the paper Color Coding by Alon, Yuster, and Zwick. They state a theorem (6.3) that says if $H$ is a graph on $k$ vertices with treewidth $t$ and $G = (V, E)$, then a subgraph of $G$ isomorphic to $H$ can be found in $2^{O(k)}V^{t+1}$ expected time. They do not include a proof, but do state that the proof i...
I am working through Sipser, and I am trying to understand some of the algorithms described in Space Complexity, but I am having a hard time understanding the presentation of the material (especially Savitch's theorem). I have a very strong intuition for time complexity, but I don't understand how space complexity fits...
Is there any limit to what we can define as a language? Is any set of symbols a language? For example, given the alphabet $\Sigma$, do we say that the language $L = \Sigma$ has alphabet $\Sigma$? Also, what is the intuitive modern equivalent to languages (as defined WRT complexity classes)? I always hear languages desc...
In "Introduction to the Theory of Computation" by Sipser, Savitch's theorem is explained as an improvement to a naive storage scheme for simulating non-deterministic Turing machines (NTM). I am going to quote the text verbatim, because quite frankly I don't fully understand it (which is why I was unable to really ask m...
I've been doing nand2tetris exercises and I'm quite interested in how compilation actually works. In nand2tetris when creating the VM language I had to create a "bootstrap" which called the main method of the program. In other languages such as C, Java or even interpreted languages like PHP, does the OS/interpreter/VM ...
We know that all graphs with odd cycles (odd number of vertices) are not 2-colorable. Is there a similar characterisation for 3-colorability? I am looking for undirected graphs that are not 3-colorable depending on a single graph property e.g. vertices/edges parity or anything else that can be generalised.
If I have a DCFG G for some language over {0,1}* and a DCFG H for its complement, with disjoint non-terminals, and a (perhaps partially reduced) string, can they both have a handle for the string? So the right hand sides of these rules would consist of only terminals and one would be a (maybe proper) prefix of the othe...
I've just read in a discussion about dynamic typing Reflective towers is an open problem for statically typed languages. What are reflective towers? I think it might be related to reflection, but I'm not sure. If you create an example, I would prefer Java.
Let $G$ be a graph whose Shannon Capacity is $\Theta(G)$. Is there any graph product for which the Shannon Capacity is $\Theta(G)^k$ where $k$ is the number of times the product is taken?
What is a known strategy to approach a situation where short bursts of data are being sent very often over a high bandwidth, high latency cable? I am aware of cubic but even that does not utilize a 10GBps cable in a short burst scenario. Lets say I have a distributed network where a single computer is sending tasks to ...
I have a set of points $C$, and I have the distance between each point $D(P_i,P_j)$. These distances are euclidean but the points are actually in a feature space. From the $C$ points I want to choose a subset of $n$ points. Call this subset $s$. I want to choose this subset so as to maximize the minimum distance betwee...
If $P = NP$ would this imply that polynomial time reduction from an $NP$- to a $P$-problem would be possible? And if $P\neq NP$ does it imply that a polynomial time reduction from an $NP$- to a $P$-problem would be impossible?
If two regular languages $L_1$ and $L_2$ are both not context free languages then is $L_1 \cup L_2$ also not a context free? I am aware that if $L_1$ and $L_2$ are context free languages then the language $L_1 \cap L_2$ is also context free but cannot quite connect the dots. If someone could help out that would be grea...
I have to solve this problem: We have weighted $n$-node undirected graph $G = (V,E)$ and a positive integer $k$. We can reach all vertices from vertex 1 (the root). We need to find the weight of minimal spanning tree in which the degree of vertex 1 is at most $k$ (we don't care about other vertices' degrees). We can as...
Wikipedia says A list comprehension is a syntactic construct available in some programming languages for creating a list based on existing lists. It follows the form of the mathematical set-builder notation (set comprehension) as distinct from the use of map and filter functions. A list comprehension has the sam...
I have two shapes in a 2D space, not necessarily convex, and I'd like to compare how similar they are. How can I define a robust distance metric to measure their similarity, and how can I compute it? I am looking for a method which provides a short distance in case of: scaling; rotation; perhaps local scaling or rota...
I'm trying to solve this problem: Given a collection of cities and the number of commuters between cities, design a network of roads for minimal cost where cost includes the cost of building the roads, and traveling of commuters. (So if more commuters use one edge, that edge will have a modified cost since the commute...
I've recently learned about the Big Oh notation and heard that the following aren't true: $f(n)\in O(f(n)^2)$. Either $f(n)\in O(g(n))$ or $f(n)\in\Omega(g(n))$ or both. $f(n)\in\omega(g(n))$ implies $\log(f(n)) = \omega(\log(g(n))$. I'm trying to find a good counter-example for each but it's proving to be a bit chal...
I need to verify the type for the lambda expression: $\lambda f.\lambda x.f (f x)$ My method gives me: $(a\rightarrow c)\rightarrow b\rightarrow c$ Im trying to define it in Haskell (on Hugs) like this: h= \f x -> f (f x) When i call the :type comamnd it gives me: (a -> a) -> a -> a Is mi function correctly defined ...
the P vs NP problem attracts a lot of attention, not all of it desirable, for a wide variety of reasons. there are many P=NP claims eg on this widely cited list maintained by mathematician Woegeorgi, P vs NP page. also, intermittently there are hot questions on SE sites related to P vs NP (eg recently [2],[3]) below, &...
The definition of the both architecture looks pretty same. They are parallel computing architecture with different type of cores. What distinguish their definition, actually?
I'm stuck on a theory/set proof question: $S$ is the set of all total functions $f : \{0, 1\} \to \mathbb{N}$ (natural numbers), prove that S is countable. I have found a sample solution already but I do not understand what is going on. Quoting from here: To show this, we define a mapping $g$ from $S$ to $N × N$ an...
For a binary tree we define horizontal distance as follows: Horizontal distance(hd) of root = 0 If you go left then hd = hd(of its parent)-1, and if you go right then hd = hd(of its parent)+1. The bottom view of a tree then consists of all the nodes of the tree, where there is no node with the same hd and...
(The question is an extension of this unanswered question on stackoverflow) If we have a set of strings, we can efficiently represent them with tries. Common branches can also be merged, resulting in a DAG instead of a tree that is even more compact. However, if we have a set of sets (i.e. the order does not matter), t...
I've searched online for this but I only seem to find answers for a similar equation: T(n) = T(n/3) + T(2n/3) + cn But the one I'm trying to solve is: T(n) = T(n/3) + T(2n/3) Base case: We can assume T(a) = Theta(1) for any constant a. I've succeeded in proving (by induction) that T(n) = O(n*log(n)). I thought the a...
Given some unrecognizable language $L$, is it possible for its complement $\overline{L}$ to also be unrecognizable? If some other language $S$ and its complement $\overline{S}$ are both recognizable, then $S$ and $\overline{S}$ are decidable. If $\overline{S}$ is unrecognizable, then then $S$ is undecidable but still r...
I am reading Prim's MST for the first time and wanted to implement the fast version of it . $m$ - The number of edges in the graph $n$ - The number of vertices in the graph Here's the algorithm : 1) Create a Min Heap of size $V$ where $V$ is the number of vertices in the given graph. Every node of min heap contains ...
For example, on x86, we have a set of general registers, each named to the function it carries out. We have an Accumulator, which is a storage for a results of different fixed point operations, we have a Base register, which is used for addressing elements in the array, a Cycle register, which holds a incremented or d...
Consider the following code segment : for (int i = 1; i <= n; i++ ) { for (int j = 1; j <= n; j = j + i ) { printf("Hi"); } } Here, the outer loop will execute $ n $ times, but the execution of inner loop depends upon the value of $ i $. When $ i = 1 $ inner loop will execute $ n $ times. When $ i...
I want to show that $CO-2Col \le_L USTCON$ (Log-Space reduction) $USTCON$ The $s-t$ connectivity problem for undirected graphs is called $USTCON$. [Input]: An undirected graph $G=(V,E)$, $s,t \in V$. [Output]: 1 iff $s$ is connected to $t$ in $G$. $CO-2Col$ A graph is $2$-colorable if there is a way to color the ...
I have been starting to learn about CFGs and PDAs and have gotten familiar with the simple stuff. I have been able to construct CFGs for simple languages but this question is more specific: $\lbrace 0^a1^b2^c3^d4^e5^f |a,b,c,d,e,f \geq 0$ and $a+b=d+e\rbrace$. My thought process has only gone so far. I see that if you ...
This is a theoretical computer science question, regarding the proof of whether or not context-free languages are closed under an operation. This means basically that any context-free language which undergoes this operation would still be context-free. For a language $A$ which is a subset $\Sigma^*$, define the langu...
Given that Let S = {a | |a| is odd}. I know that since S is decidable, but does there exist a subset within S that is undecidable?
I am working out with the rooks problem. If there are m rooks on an nxn chessboard,i have to give describe a polynomial (in m and n) time algorithm that finds a maximum-sized subset of the rooks such that if we leave this subset on the chessboard and remove all other rooks, then no two rooks attack one another. (Two roo...
This is a puzzle type question which asks to create a context-free grammar to match this language: { x#w | x,w are in {a,b}*, and w contains the reversal of x as a substring } So some example strings to try: #, a#a, b#b, ab#ba, ab#aaabbba Does anyone have any advice on how to get better at these types of problems?...
Suppose an algorithm goes through a list of n integers and for every iteration of the loop it is needs to check if the current evaluated element of the list is even. If it is even, return the index of the integer that is evaluated as even. How come the algorithm would have 2n+1 comparison? I thought linear search would...
I was wondering if this language is context-free: $L = \{ x \in \{ 0, 1 \}^* : |x| = 2^n $ for some natural number n $\}$ I know that this language is not regular because it fails the pumping lemma for regular languages but that does not necessarily mean it is not context-free. I'm not sure whether to use the pumping ...