instruction stringlengths 35 11.4k |
|---|
Please help me! I've been asked to make a circuit using only Logic Gates to implement an 8-bit 2's complement subtractor.
I was thinking of somehow modifying an 8-bit adder, but I figured it isn't 2's complement so it won't be of much use to me.
Any help is greatly appreciated, even if it's a pointer to the right appr... |
Koning's theorem states that the cardinality of the maximum matching in a bipartite graph is equal to the size of its minimum vertex cover.
Wikipedia states that there is an equivalent version of the theorem for weighted graphs as well. I tried searching in a lot of places but could not find this theorem.
To be more sp... |
Given is the regular grammar G = ({A,B}, {a,b}, P, A) with the rules
P : A → aB, a, ε (where ε is the empty word)
B → bA, b
For this regular grammar, create an equivalent NFA.
A regular grammar is a 4 tuple G = (N, Σ, P, S).
So our NFA is made up of 2 states, A and B. The initial state is A and it's also the end... |
How can we generate 3 or more binary Sources using BSC channel.
As we know, BSC can be easily used to generate 2 binary sources with some cross-over-probability(say p). Eg, length of codeword(say n) n = 1000; p = 0.2, then input and output binary codeword will be having Hamming distance of approx 200. In this way we ge... |
I’m trying to prove that the following problem has an integer optimal solution. This will hold if the corresponding linear program would have totally unimodular constraint matrix.
We have $m$ pieces of contiguous land parcels $\{1,...,m\}$ and $n$ agents with a simple valuation function that assigns $0$ to all the subs... |
Let's assume there is something happen in the world - Football world cup final. And team-1 beat team-2 with the score 3:2. So there is whole bunch of articles on every website about it, each contains slightly different wording, sometimes even on different language, but they all about the same event, and contains mostly... |
I am trying to understand Y combinators. Could you please explain why the following are equivalent
(Y (f ∘ g))
(f (Y (g ∘ f)))
(Y is a fixed point combination)
|
Quick sort algorithm can be divided into following steps
Identify pivot.
Partition the linked list based on pivot.
Divide the linked list recursively into 2 parts.
Now, if I always choose last element as pivot, then identifying the pivot element (1st step) takes $\mathcal O(n)$ time.
After identifying the pivot eleme... |
Find any kind of grammar for the language L = {w ∈ Σ* | in w there
are twice as many a's than b's} and reason its correctness.
Where w means word and Σ means alphabet, in this case obviously made up of a,b.
So I imagine I can build a NFA for the language and then "transform" that NFA into a regular grammar.
A NFA f... |
If I have two Turing machines A and B, and I want to use an output of A as an input to B, how is it going to work? Can I just run A, keep the input tape, and then run B (without affecting the number of states A and B? Or do I have to combine an halting state of machine and an initial state of the other machine?
|
Consider the following operation on language $L$:
$\mathrm{inv}(L) = \{ xy^Rz \mid x,y,z\in \Sigma^*, xyz\in L \}$
I understand that if $L$ is regular, then $\mathrm{inv}(L)$ is regular too, and proved it by guesing when $y^R$ starts and running it on the inverse DFA. However, if $L$ is a CFL, then $\mathrm{inv}(L)$ is... |
I've a large list A of elements. Given another list B of elements, I need B to be sorted by the number of occurences in A (that is, least common to most common in A). A precise count of A would require too much extra memory/disk and an approximate count if sufficient for my needs.
I couldn't find a common solution for ... |
I currently maintain a score of around 400 problems solved at Project Euler. It may be great or not so great, depending on whom you ask, but I believe it's safe to say I'm not a newb at CS and coding - and I never brute-force and always follow the under-one-minute-runtime rule!
And yet every time I solve one there and ... |
A juice machine has three buttons small, medium large. Each size adds an amount of juice in a range to the cup. Eg small might add from 10-20 mL, medium from 30-35 mL, large from 40-50 mL. The exact numbers are relatively small (0-1000), integral, and known ahead of time
Input: cup size (mL), amount to fill (mL)
Output... |
So I have this programming prompt which asks me to figure out how many permutations of a 32 coin toss sequence do not have three or more heads consecutively tossed. We are supposed to use Dynamic Programming to do this and I'm having a hell of a time identifying the recursive algorithm for this.
My first thought was a ... |
Consider the alphabet $Σ = \{1, +, =\}$ and the following language, $PLUS = \{ 1^m + 1^n = 1^{m+n} \mid m, n ∈ ℕ \}$. Prove with Myhill-Nerode that PLUS is not a regular language.
I know how I should use Myhill-Nerode here and how I should show that any two strings in the infinite set $S$ are distinguishable, but I ... |
Find the flaw in the following proof that P != NP:
"We are going to show that P != NP using the following steps:
Describe a problem.
Show that said problem is a NP problem.
Prove that the lower bound for any algorithm that solves the problem is exponential using an adversarial argument (similarly to showing lower bou... |
Note: This is almost certainly an elementary problem with a well known solution. Therefore pointers to existing references will be accepted as good answers.
Question: Given a cycle with exactly $n$ vertices, how many distinct chords are possible?
This question is motivated by the definition of chordal graph, which on... |
A problem may require memory space which is not polynomial with respect to the input size but may still have polynomial run time.
Is this true or false? and why? any idea?
|
If two minimum spanning trees on the same graph only have 2 edges in common, then those two edges must be the lowest costs edges in the graph.
True/false? and why?
Because according to me if there is a only edge which connects 2 subgraphs then that will be included in the MST whatever might be the value. So according... |
I've been stumped on this question for a while and can't find a solution. How can I find the max 3 colorability of a graph(optimization problem) with 3 colorability (decision problem) without brute force searching every combinations of edges?
|
Is the stable matching problem greedy or Dynamic ? Please anyone can give a strong explanation as i tried to find it on the net but it isn't available.
|
I know that for standard page tables each process would have its own page table and for inverted the OS would have it.
But other than this what are the main differences between a standard page table and an inverted one?
|
What is the biggest number of components in a graph that has 14 vertices and 44 edges?
Since total degree of all vertices in a graph equals to 2 * number of edges, I calculated that for 44 edges, 14 vertices together must have 88 degrees. 88 / 14 = 6, therefore each of them would have to be connected to other 6 vertice... |
I need a good data structure to store the following data:
The data are key,value pairs. However, more than one value maps to one key and the key is an n-tuple with n constant. Here's an example:
key | values
(k1, k2, k3, k4) | v1, v2, v3
(k5, k6, k7, k8) | v4, v5
A value is an object. The following ... |
Imagine a turn-based game where two robots are placed on opposite sides of a 16x16 board, facing each-other. Each robot, at each turn, can perform one of 2 moves: move (moves forward), turn (turns 90 degree; clockwise for the first robot, anti-clockwise for the second). They can also send messages to each-other, and be... |
Tried a bunch of resources to read about it, still don't really get it.
This is what Wikipedia says
A prefix code is a type of code system (typically a variable-length code) distinguished by its possession of the "prefix property", which requires that there is no whole code word in the system that is a prefix (initial... |
We know $UP\subseteq NP\subseteq PP$.
Is $UP^{\oplus P}\subseteq NP^{\oplus P}\subseteq PP^{\oplus P}$?
I think the first $UP^{\oplus P}\subseteq NP^{\oplus P}$ is straightforward since whatever queries an $UP$ machine can do we know an $NP$ machine can do.
How to show second $NP^{\oplus P}\subseteq PP^{\oplus P}$?
... |
I have a question regarding Turing machines.
Are these two tapes the same thing?
First one = _ _ _ _ * A A A B B B
Second one = * A A A B B B
_ denotes a blank tape cell.
|
I'm working on the following problem: let $G = (V, E)$ be a connected, planar graph. Our goal is to find a $d$-partition of $G$, $P = \{V_1, \ldots, V_d\}$, such that $G[V_i]$ is connected, and $\min_{V_i \in P} |V_i|$ is maximized. (That is, the partitions are as balanced in size as possible.) This is the balanced con... |
I have just started learning Automata Theory, so far I only know about regular languages, FSM (NFAs and DFAs) and regular grammars, but I come across a question like this:
"Given the next languages, design their respective DFAs"
$L := \{a^nb^m |\ n>m\ ∧ n-m = odd\}$
$L := \{a^nb^m |\ n>m\ ∧ n-m = even\}$
$L := \{a^kb^m... |
I have the following problem:
Given an array $A$, I need to construct an array $B$ such that $B[i]$ is the minimum $j>i$ such that $A[j]>A[i]$, or Null if no such $j$ exists.
For example, if $A = [23,45,13,10,33]$ then $B = [2,Null,5,5,Null]$.
The algorithm should run in time $\Theta(n)$.
|
I know that ETH states that 3-SAT is not solvable in $2^{o(n)}$ time, the best known bound for 3-SAT is around $O(2^{.38n})$. Whereas, SETH states that there is no universal $\delta$ such that for every positive integer $k$, a $k$-SAT problem is solvable in $O(2^{\delta n})$ time.
It is not clear to me that how does SE... |
Given: A list of $n$ integers $x_1,x_2,\dots,x_n$ and an integer $k$.
Determine: Is $\sqrt x_1 + \sqrt x_2 \cdots \sqrt x_n \le k$?
Question: Is there any polynomial time algorithm for the above problem? If yes, give an algorithm; otherwise prove it.
|
I am trying to prove they are not equivalent , a model which satisfies the fist one but not the second since I think EG EF p is stronger than E[GF p],any leads would be helpful. Thanks.
|
I created a context free grammar for the language which has words where twice as many a than b occur.
So as example, the language would accept the words baaaab and bbbaaaaaa, aab, etc.
The context free grammar is
G = ({X} {a,b}, P, X)
P: X -> XaXaXbX, XaXbXaX, XbXaXaX, epsilon (where epsilon is the empty word)
Now how... |
Given a context-free grammar G. Is it decidable, if the language $L(G)$, which is generated by G, contains a palindrome?
My suggestion is, that it is undecidable, but I do not have an idea for a formal prove. Any hints?
|
Deciding if the infinite union of a set of regular languages is regular is undecidable.
By closure property of regular languages, regular language is not closed under infinite union so is the above problem undecidable?
|
So I need to solve the knapsack problem, but I need to make sure that the end solution consists of an even number of items.
I found this on an already existing question:
You can keep two tables with $n$ rows and $C$ columns:
$DP_{even}$ that saves the best knapsack solution with an even number of itens.
$DP_{odd}$ th... |
I have 2 types of points in a 2D plane, type 'A' and type 'B'. How do I delete the minimum possible number of points so that remaining can be separated (on different sides) by a straight line.
I tried modeling this as a graph, where I have 2 types of nodes, and i delete nodes from it. But I can't formulate an algorithm... |
Given a string of size n consisting of 0s and/or 1s.you have to perform k queries and there are two types of queries possible.
"1"(without quotes): Print length of the longest substring with all '1'.
"2 X"(without quotes): where X is an Integer between 1 to n.In this query, you will change character at Xth position to... |
As regards the topic.
Here is an example of such a graph:
|
I heard about a technique today which is sometimes used in the classification of 2D images of handwritten glyphs. It goes like this:
Find the highest activated pixel of the image, the lowest activated pixel of the image, and average their heights. This creates a horizon at the "geographic" center of the image. You then... |
I have an expression in DRC $\{\langle a,b,c \rangle \mid \langle a,b \rangle \in r \land \langle a,b \rangle \in s\}$, where $r = (A,B)$ and $s = (A,C)$. I want to convert it onto relational algebra and got this:
$π_{A,B,C}(σ_{r.A = s.A \land r.B = s.C}(rxs))$ and I am not sure if it is correct...
Can someone explain... |
I'm following this paper titled "Coverings and colorings of hypergraphs" by Lovasz 1973, which is referenced in Garey and Johnson's Computers and Intractability, for the Set Splitting Problem. In this paper, the author tries to reduce graph chromatic number to hypergraph 2-colorability (same as set splitting).
You can... |
In the following 2 statements -
1. Anyone who eats any pumpkin is a nutrition fanatic.
&forall x ((&exist y (PUMPKIN(y) &and EAT(x,y))) &rarr FANATIC(x))
2. Anyone who buys any pumpkin either carves it or eats it.
&forall x &forall y (PUMPKIN(y) &and BUY(x,y) &rarr CARVE(x,y) &or EAT(x,y))
In the first case any pum... |
IRL as I understand is where the AI is given a policy from an "expert" and needs to solve for the reward function which best fits the policy.
And Apprenticeship Learning via IRL was explained as an expert demonstrating a skill and the reward function also has to be derived using the expert behavior.
I don't necessarily... |
The regex /^(abc)$/ matches abc but why not abcdabc, abcdabc also begins with abc and ends with abc.
I am not sure about the semantics of this regex. Any explanation is welcome.
|
Given a simple graph with $n$ vertices, show that you can remove all edges in $O(n\log n)$ rounds, where in each round you are allowed to remove all edges of any (single) path.
|
Given $T$, an MST of $G(V,E)$ connected and undirected.
Assume we add an edge $e'$ with weight $w(e')$.
Suggest an algorithm which takes $T$ as input, and outs $T'$ MST of $G'(V,E\cup\{e'\})$.So i thought about adding $e'$ to $T$ and removing the heaviest edge in the cycle that was formed. Can anyone suggest how to go ... |
A unit disk graph is an intersection graph $G = (V,E)$, such that given $n$ disks on the plane with identical radius. Each disk $d_u$ corresponds to a vertex $u \in V$, and there is an edge $uv \in E$ if, and only if $d_u$ and $d_v$ intersects.
In 1990, Clark, Colbourn, and Johnson showed that the problem can be solved... |
In my assignment I find these symbols:
$|w|$ where $w \in L \subset \Sigma^*$
I believe it means the lexikografic value of a word, but I am not 100% certain.
Let me phrase my question this way: could this notation have any other meaning ?
|
I am given a set of pairs of dates and would like to extract features I can put into an machine learning algorithm.
Thus far I have already written two different metrics, however I didn't find much literature on that topic. I know there is a lot of literature about on computing the distance or similarity of strings. ... |
Let's say we are working with a system that has 40 physical address bits. The total physical address space (assuming byte-addressable memory) is $2^{40}$ bytes, or 1 TiB. And if virtual addresses are 48 bits in length, that means there are more addresses available to virtual memory than there are locations in physical ... |
Robot in a grid: Imagine a robot sitting on the upper left corner of a grid with $r$ rows and $c$ columns. The robot can only move in two directions, right or down, but certain cells are off limits and the robot cannot step on them. Design an algorithm to find a path for the robot from the top left to the bottom right.... |
I have been asked to prove that:
Being C an infinite set. Prove that C is semidecidable if and only if exists a total computable function that is injective and whose image is C.
I've read the wikipedia articles of computable function and recursively enumerable set and I saw these properties are true. But I have no ide... |
I am trying to apply BFS to the following problem, but I'm not sure how to do it
Input: directed graph $G$ defined by the array of adjacency lists with n vertices and m edges, and a vertex $v$ in $G$
Output: $true$, if $v$ is a part of a cycle, $false$ otherwise
Can someone explain in pseudocode or in words how to do... |
Does anyone know how I should approach this algorithm? It needs to have $O(n^3)$ complexity and I can only come up with an algorithm that has $O(n^4)$ complexity (of doing a n^2 min path from each vertex to $n-1$ other vertexes, and since I need to do this n times, it will be $n^4$ or so I think...
Input: Array $A[1..... |
Let A = {(B,w) | B is an NFA that accepts w}. To prove that N is a decidable language,
M = "on input (B,w) where B is NFA and w is a string, simulate B on w. If B accepts w, accept. Otherwise, reject"
Is this a false proof? The proof from the textbook says that I have to convert NFA into equivalent DFA but I'm not sure... |
i have researched it on wikipedia and it produces me an unusual example and stories about Turing,so what i understand is if an program run in loop,an electronic device in cpu or in computer structure would stop that program,or an code will be processed by the input to decide if the program will be executed or will be h... |
In the introductory chapter of $\textbf{PCP}$ in Arora and Barak, I read the proof that why a $\textbf{PCP}(\log n, 1)$ of completeness 1 and soundness 1/2 for an $NPC$ language $L$ will imply that there exists a $\rho$ for which $\rho$-approximation algorithm for MAX-3-SAT does not exist unless $P = NP$. But in the pa... |
I got confused with deterministic and probabilistic algorithms. Am I right by assuming that algorithms are called probabilistic once they use some sort of randomness?
Initially, I thought only algorithms outputting random numbers are called probabilistic. They are obviously non-deterministic.
However, what about the f... |
The problem I wish to solve is the following:
Given a set $V \subset \mathbb{Z}^2$ find the set $S \subset V$ such that $|\sum_{v \in S} v|$ is maximal.
By simply enumerating subsets we can solve this problem in $O(2^n)$. This problem feels a lot like the euclidian traveling salesmen problem to me but I can't quite mak... |
I know how to find a regular expression when given a FA. But how do I find a regular expression given just a language and its rules?
For example, for the language $L \subset \{ a,b\}^* $ which accepts all words that contain exactly one $aa$. How do I find a regular expression in this case?
I know that I would be able t... |
I am trying to solve the following exercise:
Let $G = (V,E)$ be a graph. Show that the following two problems are NP-hard:
$G$ has a spanning tree where every node has at most $k$ neighbors, and $k$ is part of the input.
$G$ has a spanning tree where every node has at most 5 neighbors.
It's written that 1 is supp... |
I was looking through my notes on domain relational calculus, and noticed an interesting result in a question about finding the most expensive pizza(s), given a pizza table with schema $\text{pizza}(\underline{id}, size)$. The first idea that came to me was:
$$\{id1\ |\ \exists size1, \forall id2, \forall size2 \ (\te... |
Intersection of CFL and regular is always CFL. But according to Chomsky hierarchy diagram, regular languages lie completely inside CFL. So, as regular set is completely inside CFL set, their intersection should be regular right ?
Am I interpreting Chomsky diagram wrongly ?
|
This is a pretty naive question, but I would like to better understand the basics of information storage on a computer. I am not concerned with the detail of how any one operating system achieves this.
I know there are different ways to identify which bits in memory make up a given file (on a given machine at a given ... |
Hello all I am kinda confused on how to solve the above recurrence since the masters theorem would not work with the above equation. Could anyone please help me solving this and showing me the steps? Requirement is to find asymptotically tightest bound.
$$T(n) = 4T(\frac{n}{2})+n!$$
|
Let $n = -13, \ k = -24$
How do I find the 4-digit 5's complement of each number? What would be the result of $n + k$ in complement representation?
I understand how to calculate $n$-digit, 2's complement. I convert it to base 2, invert and add one.
Also, with positive numbers, let's say $n = 13, \ k = 24$, the 4-digit... |
Does an algorithm exist to check for the existence of a Real-Time Multiprocessor Schedule for aperiodic hard tasks(all of which have the same Release time)?
Assumptions:
The processors are Uniform parallel machines
Job preemption is permitted
Job migration is permitted
Job parallelism is forbidden
EDIT: Let there be ... |
Let $L_1,L_2$ be any $\Sigma$-Languages, with $l_1\in L_1, l_2\in L_2$
If I have a regular Language $L(l_1(l_2l_1)^*l_2)$ would the word $\omega=l_2$ be recognized? I'm confused because if $\epsilon \in L_1$ then $l_1$could be $\epsilon$, then $L(l_1(l_2l_1)^*l_2)$ would recognize the word with $(l_1 = \epsilon) *((l_2... |
I am trying to find all mother vertex in a directed graph.
A mother vertex in a directed graph G = (V,E) is a vertex v such that all other vertices in G can be reached by a path from v.
My Approach:
Do DFS on each vertex and check if all the vertex are reached on each start node.
Time complexity : O(V*(V+E)).
I am loo... |
Yes, this is a quiz question. It's from a self-paced course, but the answer just isn't correct to me no matter how I look at it. There isn't really an active community to consult.
My Regular Expression experience is profoundly in JavaScript and I'm concerned that it poisoned my thinking of Regular Expressions. For the... |
Our professor explained that all programs can be thought of as the set of natural numbers, while decision problems can be thought of as the set or rational numbers.
Our notes say a decision problem can be represented as a function which takes a natural number as input and maps it to either 0 or 1.
That the range is 0 ... |
I'm studying for my operating systems final, and one question that my professor asked that I can't seem to find the answer to is the following:
"Why does virtual memory use non-contiguous memory allocation?"
The textbook only talks about virtual memory in the context of non-contiguous memory allocation, but never expla... |
I have a graph and I'm trying to enumerate all paths that start at node $S$, end at node $E$, uses each edge, and minimizes the number of edges used (i.e. it can only re-use an edge if strictly necessary).
What I am wondering is that if I have a solution path, e.g. $SADBCABE$, can I find all other valid paths that use ... |
I am trying to understand how to work out time complexities given certain recurrence relation, however I know that in certain recurrence relation some numbers can be omitted since they make no difference when $n$ gets very large. The problem i'm having is being able to identify the numbers that can be omitted.
For exa... |
One statement of Rice's theorem is given on page 35 of "Computational Complexity: a Modern Approach" (Arora-Barak):
A partial function from $\{0,1\}^*$ to $\{0,1\}^*$ is a function that is not necessarily defined on all its inputs. We say that a TM $M$ computes a partial function $f$ if for every $x$ on which $f$ is de... |
There is a definition for kind of actions that only care for outcome.
Classic example for such an action is remove from collection:
When you try to remove an item that doesn't exist in collection, there are two possible outcomes: failure with item doesn't exist or success (because the outcome is that the item doesn't e... |
Is the set of all countably infinite strings over a finite alphabet that contains more than one letter countably infinite?
|
Can an ambiguous context-free grammar be converted into Chomsky normal form? I think the answer is yes.
|
I've been trying to solve the following question:
Show a polynomial algorithm for the following problem. Let $G = (V,
> E)$ a graph. The goal is to decide if there is $E' ⊆ E$ , such that
for every vertex $v ∈ V$, $v$ meets or exactly $k$ edges from $E'$.
(Namely, for $k = 1$ you get the perfect matching problem)... |
Let L1 be a language generated by a CFG.
Let L2 be a language generated by a regular grammar.
Is L1 = L2 ?
Is the above problem decidable or undecidable ?
If L1 = L2 then L1 $\cap$ L2' = $\phi$
So the above problem can be written as
CFL $\cap$ RL = $\phi$ or CFL = $\phi$ which is decidable.
So the answer should be... |
I'm interested in the maximum number of intersections that a line and a triangulation on $n$ points could have. More specifically, given $n$, we are interested in the worst-case (maximum) number of intersections that any line could have with any triangulation on any point set.
There is an upper bound of $2n-5$ on the n... |
I am reading dis, It reads:
The dis module supports the analysis of CPython bytecode by disassembling it. The CPython bytecode which this module takes as an input is defined in the file Include/opcode.h and used by the compiler and the interpreter.
In wikipedia
In computer science, an interpreter is a computer progr... |
The diameter of an undirected, unweighted graph can be found in $O(n^3)$ with e.g. the Floyd–Warshall algorithm. However, there is an idea how to improve the runtime:
Pick a vertex $v$
Find $u$ such that $d(v,u)$ is maximum
Find $w$ such that $d(u,w)$ is maximum
Return $d(u,w)$
This idea fails; for instance, when sta... |
I'm currently stuck at the following task:
Consider a point set $S = \{ p_1, p_2, ..., p_n \}$ in the plane in general position (i.e., no three points of $S$ are collinear). The points of $S$ have pairwise different $y$-coordinates and are sorted in increasing order of them, i.e., $y(p_i) < y(p_j) $ if and only if $i <... |
Disclaimer: This is a homework question.
I would like to reduce vertex cover problem to the following problem:
$$L = \{G \mid G\text{ has a vertex cover of size } |V(G)|/2\}\,.$$
I have divided the problem into three parts:
$k = n/2$: This case is trivial.
$k > n/2$: Yes in vertex cover problem does not necessarily me... |
(NOTE: This is not a homework question at at all. Rather, this was something that I thought that I understood (at least on the surface), but now appear to have no clue about, and am not currently finding any resources helpful. I know that we typically like to see what people have tried, but I am honestly discombobula... |
Say I am given a rectangle of width $W$ and length $L$. I now have to fit as many regular shapes of area $A$ into this rectangle as possible. For example, if the shape is a circle, I need to fit as many circles of area $A$ into the rectangle as possible. All the shapes trying to be packed in a given instance are identi... |
Suppose that we have numbers between $1$ and $1000$ in a binary search tree and want to search for the number $363$. Which of the following sequences could not be the sequences of nodes examined
a) 924,220,911,244,898,258,362,363$
b) 925,202,911,240,912,245,363
c) 2,399,387,219,266,382,381,278,363
d) 935,278,347,621... |
The general term for folds is a catamorphism. The general term for unfold is an Anamorphism. Is there an equivalent term for map? I know that a map is a type of fold however restriction is significant. Also it would be useful to have an alternative term to use when the word “map” is ambiguous.
|
Is "Given a CFL L and a regular language R, is intersection of L and R an empty set?" decidable? What if we replace L with the complement of L? One of them is decidable and the other is not. For the one that is decidable, give an algorithm. For the other, give an undecidability proof.
For the first part "Given a CFL L ... |
After coming across the assertion that given
$$
x^2 = y^2 \pmod n \\
x \neq \pm y \pmod n
$$
we can then conclude that n factors into
$$
n = \mathrm{gcd}(n, x-y) \mathrm{gcd}(n, x+y).
$$
in this article, I attempted my own example but it doesn't seem to work. I think there's a missing hypothesis, but more... |
My textbook states that CIRCUIT-SAT is in NP because you can guess an input and verify it in polynomial time.
My textbook also states that a problem is in NP if and only it has a polynomial-time verifier V(I, X) such that:
if I is a YES instance, then there exists an X s.t. V(I, X) = YES
if I is a NO instance, then fo... |
I've been studying the skiplist analysis from the open data structures book here:
Open Data Structures
I've understood the first 3 lemma's, (after looking at how they use indicator variables in the section 1.3.4 of the book).
However, Lemma 4.4 seems pretty vague. Especially, how is
$$\sum_{r=1}^{\lfloor\log n\rfloor}1... |
I am reading dragon book for compilers. I am not able to understand in which phase does syntax directed translation actually happen.
A CFG can have set of semantic rules attached to it which is evaluated. For example, we can have semantic rules attached to a CFG which adds the type of identifier in the symbol table. D... |
I have a data type that accepts and returns byte arrays. However, the input is from a network callback or loading a huge file in piecemeal and the output is CRLF-terminated lines. The internal storage isn’t groups of bytes, but a single packet of bytes where the partitions extracted don’t have to match the ones inserte... |
Let $L\subseteq \Sigma^*$ a Language
$R_L$ is the Myhill-Nerode-Relation of $L$
$\equiv_L$ is the Syntactic Congruence of $L$
$R_L$ and $\equiv_L$ are equivalence relations and are defined as follows :
$x\:R_L\:y \:\Leftrightarrow \: [\forall w\in\Sigma^* : xw\in L\Leftrightarrow yw\in L] $
$u\:\equiv_L\:v \:\Leftrigh... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.