instruction stringlengths 35 29.1k |
|---|
I am trying to understand what is a table walk. I have found when it occurs -
whenever there is a TLB miss. If no descriptor is found – TLB miss occurs and further behavior depends on the implementation of a paging unit. (TLB - Translation look aside buffer)
But i still do not understand what exactly happens during ta... |
I would like to draw an arc from a specific point to a goal point, during the process of drawing a larger path. I would like to do it using bezier curves, which aren't adequate for modeling circular arcs, but these equations found here seem to potentially estimate the arc pretty well (I can't tell if these equations co... |
Im having some difficulty understanding how the following two concepts could be related.
Equivalence between TMs as is commonly tought
According to this site answer, to prove a standard TM model to be equivalent to some non standard TM model (some variant) we need to do two things:
For any std TM $T$, find a non-std T... |
I am thinking some real examples of FSAs in order to help me know how to use the model of the FSA. As I know, the pseudo-random-sequence generator should be a kind of DFAs or FSTs . But I cannot describe a pseudor-andom-sequence generator (e.g. LFSRs) by using $(Q, \Sigma, \delta, q_{0}, F)$.
Specifically, the input of... |
Can I say that cache miss penalty includes latency to memory? My current understanding is that cache miss penalty is the time moving data from the layer closer to main memory to it. But I'm not sure about what's the meaning of latency to memory? If they're not the same what's the overlapping part?
|
What are the relative merits of the various graph representations, such as adjacency matrix, edge list, adjacency list, directly connected network etc. Given that this graph will be frequently updated, split, joined to other graphs?
Business Context: I am writing a molecule editor in C# and have currently used a direct... |
Let's say that Dijkstra’s algorithm with the priority queue using a d-ary heap. if adjusting d, we can try to achieve the best runtimes for the algorithm with d being $\sim |E|/|V|$.
Then for a fixed $|V|$, what is the largest possible ratio between this runtime and the runtime of Dijkstra using a Fibonacci heap? Wh... |
If I have some collection of bits, -- a byte, say -- of arbitrary value then I can transform it into some other value by means of exclusive-oring it with a subset of (in this case) eight fixed values, each affecting a single bit 0x80, 0x40, ... 0x01: every possible value is represented by some combination of operations... |
in the book "Introduction to the Theory of Computation" by Michael Sipser there is an example of undecidable languages in which there is a language REGULR_TM which is described as follows :
REGULAR_TM = { <M> | M is a Turing machine and L(M) is regular language }.
Well, Sipser says that this is an undecidable language... |
This is a purely terminological question.
The word algorithm, as I have learnt it refers to something like an "effective method, a sequence of steps, for doing something". There are alternative statements giving roughly the same idea.
But for some computer systems, such as neural networks, it is somewhat stretching it ... |
Does the Paxos algorithm use failure detectors? If not, how can it solve consensus, given the impossibility result?
|
I'm stuck on this question, a BST is slightly broken only if there is a node with value x in which :
there is at least one value less than x on its right branch or atleast one value greater than x on its left branch.
for example :
3
/ \
10 5
/\ /\
... |
I'm looking for efficient ways to perform local search to find maximal induced subgraphs that satisfy certain properties : a tree, a forest or a bipartite subgraph for example.
What I mean by local search is moving from solution to solution by applying local changes, until a solution deemed optimal is found or a time b... |
What is a genuine atomic multicast? What is the difference between a genuine and non-genuine atomic multicast?
|
Please tell me how I should apply minimax algorithm to the array
$$ 15, 12, 14, 16, 11, 13$$
and make a tree?(I understand how minimax algorithm works but I can't apply it to an array)
|
This question is not from homework, but rather as preparation for the test:
The calculation of place-in is a calculation in which the algorithm does not need space beyond the output size (beyond
beyond a fixed space complexity). Show how, given a graph (E, V = G), the transitive closure can be calculated
in-place in t... |
I was wondering once you have recovered the fundamental matrix F such that xFx' = 0. If you try to recover translation and rotation from F, I am told that this is possible only up to scale? Why so?
|
I don't know if this is the right place to ask this kind of questions, but I'm a little desperate and I can't find the answer to this Computer Networks exam question.
"A point to point 1000 km connection uses a Idle RQ frame protocol with a frame of 1 KByte. Calculate the bandwidth to use at its maximum the line. Is it... |
My apologies if question is not in correct format. I don't post here often. I don't know what tags would be appropriate for this question, or even if this is an appropriate question.
Looking for algorithm for closest available resource.
n people P1-Pn, n taxis T1-Tn, are in a 2 dimensional coordinate system eg x,y
Dete... |
For the following function:
$$
\sum_{n=1}^{2n}x+x^2
$$
It is easy to see the (tightest) Big-Oh is $O(n^3)$, but I am not so sure about the Big-Omega. Here is my attempt:
$$
\sum_{n=1}^{2n}x+x^2
$$
$$
\geq \sum_{n=1}^{2n}x^2
$$
But not sure how to continue. Also, does tightest Big-Ω always equal tightest Big-Oh?
EDIT: T... |
I came across a text recently which claims that if we perform a lossless decomposition of a relation R into smaller relations R1 and R2, and if R is in 3NF, both R1 and R2 are 3NF.
I felt a bit suspicious regarding this claim, but couldn't find anything to prove this statement wrong.
Am I correct in thinking that this... |
What is the difference between the stable marriage problem and an assignment problem? Both refer to a matching problem in general but what is their specific difference?
I can see clear differences in the implementation but do not see any related to the motivation. Both aim at assigning a man to a female - both approac... |
Question:
Given 22 nodes, how many times do I need to run Karger's algorithm in order to find A min-cut problem within an error range (say, <2 or between 0-1) ?
|
Givens. I understand Floyd's algorithm can determine the length $\lambda$ of the loop and the length $m$ of the tail. The hare will not necessarily catch the tortoise on the first cycle, but it is guaranteed to catch it after a number $k$ of cycles, where $k$ is a natural number.
Question. Given I know these facts, ... |
TL;DR: I would like to know how a programming language, the OS and drivers work together to perform a task.
I (and we all) have used various softwares/modules/packages on the top of our OS which provides us with a very simple API/GUI/CLI to perform tasks. But one question which keeps me disturbing is:
How does that sof... |
We know all computer computable problems can be solved using the infinite tape and finite control system of the turing machine. Now think something different, let the tape is finite but the control system is infinite. Now can we solve the same set of problems with this machines?
|
I have another question with dimensionality reduction.
I have a matrix $S \in R^{k \times d}$ and S is in {$- \frac{1}{\sqrt k}, \frac{1}{\sqrt k}$} and i have two vector $u,v \in R^d $.
I need to understand why $E[u'^T v' ]= u^Tv$ where $u'=Su$.
I just have a intution, that maybe i just prove the left(or right span ... |
given that L is regular, does the following make a context-free language?:
i) $\{0^x1^y \mid 0^{x+y} \in L\}$
ii) $\{0^x1^y \mid 0^{x-y} \in L\}$
since L is regular, i presumed that i) can be put into a pushdown automata, but i don't see how to do that for ii). if ii) cannot be put into a pushdown automata, it means it... |
Chapter 10 of Advanced Topics in Types and Programming Languages; gives a very comprehensive description of type inference by constraints solving.
They introduce the free program indentifiers of an environment $\Gamma$ with the pair of equations $fpi(\emptyset) = \emptyset$ and $fpi(\Gamma;x:\sigma) = fpi(\Gamma) \cup ... |
I am looking for a polynomial-time algorithm that takes as input a bipartite graph $(X\cup Y, E)$, and returns one of two options:
If a perfect matching exists, it returns the matching;
Otherwise, it returns a witness based on Hall's theorem, i.e., a set $S\subseteq X$ such that the number of neighbors of $S$ is small... |
Would appreciate if you could take a look at what I did and help me finish it.
Given a pushdown automaton that accepts a language $L$ by final state, construct a pushdown automaton that accepts $L^*$. Use a "double bottom" if need be.
My attempt:
Given $M = (Q,\Sigma,Γ,\delta,q_0,⊥,∅)$, we'll add a double bottom by ... |
Consider the following language:
$$L = \{a^nb^{n^2} \mid n≥1\}\,$$
When it comes to determining time and space complexity of a multi-tape TM, we can use two memory tapes, the first one to count $n$, and the second one to repeat $n$ times the count of $n$. Thus, because of the way we’re using the second tape, it should ... |
A question was posed to me as to the relevance of the ZeroSum game to Heuristic search algorithms.
I know that the zero sun game is a theory in which one persons gain is exactly balanced to another persons loss but I am unsure as to how this applies to Heuristics.
I think it may have something to do with how parts of t... |
Does reducing a graph (removing or replacing vertices or edges) without changing its chromatic number has a specific name?
Take this cactus graph as an example (although my question is about an arbitrary graph):
The edges with vertex of degree 1 could be removed without affecting the vertex chromatic number. I think s... |
Are there extensions of predicate logic which focus on resource models, possibly even in actor models?
And if so, would it be possible to reason on a meta-level on how many resources should be expended to find further proofs in the same or other systems?
|
Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then apply a 5% interest.
T1 start
T1 B old=1200 new=10000
T1 M old=0 new=2000
T1 commit
T2 start
T2 B old=10000 new=10500
T2 commit
Suppose the database system crashes ... |
Babai proved that there is a quasi-polynomial-time algorithm for graph isomorphism. Has anyone implemented this algorithm? I think the code will be easier to understand than his paper, because of the amount of abstract algebra one needs to master beforehand. Of course one may need to learn that after reading the code. ... |
Looking for information on choosing a heuristic for instances where the cost of traversing an edge can be less than one.
For example, say movement is allowed in the cardinal directions. Should all edge costs be at least one, then I would consider diagonal distance. However, if costs can be less than one, this could le... |
I am implementing a paper which need Dynamic Frequency Warping as a component. They have written very briefly about this algorithm and cite to
this paper: Voice transformation using PSOLA technique (page 9/13 of the PDF, section 3.3). I have read it but can't understand its mechanic. I've also made some search on Goog... |
Given an NxN array, drawing a line from the edge's midpoint to the opposite field how can the N buckets be found covering the majority of the line's path?
A visual aid:
Is there a better way to this than computing the linear equation and iteratively advancing in tiny steps to check which bucket we fall on? If not wha... |
How can I prove that $SEQ_{CFG} = \{⟨G,H⟩ \mid \text{$G,H$ are CFGs and $L(G) ⊆ L(H)$}\}$ is decidable ?
I know that $EQ_{CFG} = \{⟨G, H⟩ \mid \text{$G,H$ are CFGs and $L(G) = L(H)$}\}$ is not.
|
Let's say I receive a large sequence $s$ of numbers $n_0$, $n_1$, $n_2$, $\ldots$ Later I expect to receive the same sequence $s^*$ with the same numbers $n_0$, $n_1$, $n_2$, $\ldots$ but errors might occur. For instance $n_2$ gets altered. I'd like to detect errors as soon as possible with high probability.
solution... |
Where can i find a list of problems reducible to max flow and matching problems. I need such examples to learn and practice .
|
I have two splay trees, $A$ and $B$.
When every element in $A$ is smaller than every element in $B$, we can merge them in $O(\log N)$.
My question is; when all elements of $A$ are not necessarily smaller than all elements of $B$, how can we still merge $A$ and $B$ in $O(\log N)$?
What I have already tried:
Splay $A$'s ... |
I am trying to get better at solving recurrence relations, so I am making my own simple relations and try to solve them. I have made the following recurrence:
$$T(n) = 3T(n-1) + 2, \quad\quad T(1) = 1$$
My work at solving it:
$$\begin{align*}
T(n) &= 3^2T(n-2) + 3*2 + 2 \\
&= 3^3 T(n-3) + 3^2*2+ 3*2 + 2 \\
&... |
I'm interested in learning more about the history of automata theory and have tracked down many of the original papers on Turing machines, finite automata, and the like. However, I'm having trouble finding a source that first introduces pushdown automata. Who first developed them, and what was the context?
|
I'm not sure I understand the answer to this question:
Question 9.
What is the running time of Dijkstra's algorithm in a graph that is sufficently sparse - in particular, $E=o(V^2/\log V)$, where $V$ is the number of vertices and $E$ the number of edges. Assume that we are implementing the min-priority queue with a b... |
This is a basic example of how 2 circles would come together:
A more complex example would be an arbitrarily shaped polygon like a country on earth, merging with another one or a circle. All of the edges would have to somehow attach to the circle as you move the circle around, so it feels like it's adhering together l... |
Bachmair and Ganzinger (1991), 'Rewrite-Based Equational Theorem Proving With Selection and Simplification', section 5.2, 'Simplification and Deletion Techniques', page 17, 'Elimination of redundant atoms', discusses the question of when, having used one clause to derive another, you can throw away the first clause ins... |
This seems to be true for any function I can think of, but I'm not quite sure how to prove it. Is there a proof of this proposition for any such function or a counter-example?
|
For example, suppose $f(n) = \Theta(n^2)$, then does that mean for any sufficiently large $n$, $f(n) \le f(n+1)$? Is it a general case for all Big-Theta?
|
In the ARM architecture, what happens on executing a jump instruction whose jump target address is an MMIO address (or in paging mode, a virtual address that is mapped to an MMIO address)?
Would this such an instruction abort?
If it succeeds and sets the EIP accordingly, what happens next: Will the CPU actually fetch ... |
I know the best algorithm to solve a linear system in $\mathbb{R}$ with $n$ variables is Coppersmith-Winograd's algorithm, which has a complexity of
$$
O\left(n^{2.376}\right).
$$
How much easier is it to simply determine whether the same system has any solution?
More precisely, given a system of $m$ equations and $n$... |
The ARM STM instruction is described here in the ARM manual.
This instruction writes all or a subset of registers at memory locations starting from a base memory address.
The manual does not impose any restriction on the start address. So, can the start address be such that some/all of the writes end up in MMIO address... |
I am learning how to implement basic logic gates using NAND. I have learnt that you can use De Morgan's theorem as such:
$a+b = \bar{\bar a} + \bar{\bar b} = \overline{(\bar a *\bar b)}$
In other words, we would need two NOT gates (which are basically NAND gates), and another NAND gate.
However, I want to pract... |
When I run $x^2 - y^2$ with x=8.8888888888 and y=9.9999999999 in python, I get the following result:
>>> 8.8888888888**2 - 9.9999999999**2
-20.9876543205679
However, if I rearrange it to $(x-y)(x+y)$ with the same x and y values, I get:
>>> (8.8888888888 - 9.9999999999) * (8.8888888888 + 9.9999999999)
-20.987654320567... |
According to this slide, the following two formulations of the mincost flow problem are equivalent:
Given directed graph G = (V, E)
Let u denote capacities
Let c denote edge costs.
A flow of f(v,w) units on edge (v,w) contributes cost c(v,w)f(v,w) to the objective function.
...
Send x units of flow from s to t as... |
Background
Set Inclusion
GIVEN: set of cards, some with blue backs, and each with a positive, integer face value.
QUESTION: Are there any [blue-backed cards] with a [face value <= L]?
2 independent variables: [blue/white cards], [integer face values]
Function A: Select a blue-backed card
face value depends on which ... |
Here is a definition of reducible flow graphs :
A flow graph is reducible if every retreating edge in any DFST for
that flow graph is a back edge.
And the reasons why we care about retreating/back edges:
Proper ordering of nodes during iterative algorithm assures number of passes limited by the number of “nested”... |
I stumbled on this ambiguous grammar and I've been trying to make it unambiguous but it's still ambiguous.
Given the ambiguous CFG :
$S \to A\mid B$
$A \to aAb\mid ab$
$B \to abB\mid \epsilon$
My closet try was:
Given the ambiguous CFG :
$S \to A$
$A \to aAb\mid C$
$B \to b$
$C \to abC\mid\epsilon$
But the string "$a... |
Question: I am trying to solve question 6.10.1 from Elements of Programming Interviews. The task is as follows:
Given an array $<a_1, \ldots, a_n>$ of fixed-length ints, devise an algorithm which returns a new array $<b_1, \ldots, b_n>$ where each $b_i$ is the product of all $a_j$ with $j \neq i$. That is, each element... |
In an exam I took we were asked to provide a tailrecursive definition of a recursive function. I failed miserably and the provided solution makes absolutely no sense to me. If anyone could explain that would be very helpful for my resit. The provided solution is the following:
Given are the functions $f, g, h \in \mat... |
Let's say I have two identical jars and I want to find the height that the jars will breaks when dropped from various heights. I can drop the jars from height increments using steps on a staircase. I want to solve this problem sublinearly.
I decided to increment using square numbers (1, 4, 9, 16..etc) for a complexity ... |
I found the following question
Suppose A and B are recursively enumerable languages such that $A∪B=Σ^∗$. Further, suppose $(A∩\overline{B})∪(\overline{A}∩B)$ is decidable. Which of the following is true?
A- It is possible that either A or B is decidable but not both
B- None of them can be decidable
C- Both o... |
Let $t:\mathbb{N}\rightarrow\mathbb{N}$ be a time constructible function with $t(n)\geq n + 100$. Show that there is no TM $T$ that given the gödel number of another TM $M$, decides wether or not M is time bounded by $t$. Can someone help me with this? I have no clue
|
I'm trying to understand binary floating point and using just a 4-bit mantissa and a 4-bit exponent (both 2s compliment) to keep things simple.
As far as I can tell, the largest denary number I can represent is 112: 0111 0111
So why do I have trouble representing denary 11 (eleven) in this system? I get that the larges... |
I have graph creation problem.
Given a set of nodes of graph, and node constraints such as given every node's number of neighbors (degree). I am also provided with the total number of triangles in the graph. Given the above constraints ($n+1$), I have to generate a graph that satisfies all the constraints.
I know that ... |
I have a list of elements of different values, say 0 to 3. I want to split it into a certain number of sub lists, each accepting only certains elements. The sub lists may not always have the same length.
For example, I have a list of 12 elements: [0,0,0,1,1,1,2,2,2,3,3,3]. I want to split it into 3 sub lists:
One that... |
Why doesn't infinite run time violate Turing completeness? Shouldn't "completeness" include halting?
The halting problem:
The halting problem is a decision problem about properties of computer
programs on a fixed Turing-complete model of computation
...
The problem is to determine, given a program and an input to the... |
Recently I’ve studied QuickSort and understood its general idea.
Basically, we do the following:
Pick an element from the array (no matter which one and how in this context)
Rearrange elements in the array so that elements less than the pivot are placed prior to it (in the left part of the array), and ones that are g... |
I am reading the two articles below to try to figure out whether STRIPS are NP-complete or PSPACE-complete. Specifically, I am trying to figure out the complexity of finding optimal solutions using STRIPS.
Also, Bylander (1994) defines PLANMIN to find the shortest plan. This is tied to length directly where minimizing ... |
Using induction how do you prove that two algorithm implementations, one recursive and the other iterative, of the Towers of Hanoi perform identical move operations? The implementations are as follows.
Hanoi(n, src, dst, tmp):
if n > 0
hanoi(n-1, src, dst, tmp)
move disk n from src to dst
hanoi(n-1, tmp, ... |
Normally, when discussing amortisation and worst-case complexity, amortisation negates the worst-case scenarios, and the BigO describes the average for the operation (the way it's used in interviews nowadays).
For example, when an insertion of an element requires reallocation and copying of the array, increasing the si... |
I need some help with my proof, because I'm not sure if the following works. Tips and Tricks are welcome since this topic is completely new to me and very difficult.
Task:
Prove that $M = \left\{ a^ma^lcb^{m+l}\mid m,l \in N \right\} $ with $\sum =\left\{ a,b,c \right\}$ is not a regular language using the Pumping Lemm... |
I've seen some very useful posts about this, but none took into consideration both the tag and valid bits. This is a question I took from a notebook in my computer engineering course.
Consider a machine with a direct mapped cache, with 1 Byte blocks and 7 bits for
the tag. This machine has a RAM with 2 KB capacity. ... |
I was given the following problem during an interview:
Gives a string which contains some mixture of parens (not brackets or braces-- only parens) with other alphanumeric characters, identify all parens that have no matching paren.
For example, in the string ")(ab))", indices 0 and 5 contain parens that have no matchi... |
Given a graph consists of two-colored nodes(e.g. white and black) and a starting node, and every time you visit a node, its color is switched(from black to white, or, white to black), how to find the minimum path such that all nodes are converted to black (or white, since it is equivalent)?
|
I have been given this diagram of a circuit:
https://www.google.com/search?q=full+adder+logic+gate&rlz=1C1CHBF_enCA831CA831&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjCjZzc_PbfAhXCj4MKHahtCvcQ_AUIDigB&biw=1536&bih=792#imgrc=GFIqfN5OgCdtRM:
The second XOR gate looks like its output is being connected as inputs of 2 different... |
I'm trying to solve And-Or Graph, and I find AO* algorithm can handle it. Someone said it's already used in AI, but I can't find it in detail.
Have it implemented? Or it's just a pseudocode that can't realized? If it exists, where can I find it? Or any suggestions to help me to implement it? I'm really appreciate your ... |
Konig's theorem says that, in a bipartite graph, the size of the maximum matching equals the size of the minimum vertex cover. This theorem has several proofs; I would like to know if the following proof, based on primal-dual linear program, is valid. This is mainly an exercise in understanding this primal-dual concept... |
What can we say about the complexity of generating (negative) binomial and (negative) hypergeometric random variates? In particular, it is possible to generate (negative) binomial and (negative) hypergeometric variates in (expected) constant time (i.e. independent of the distribution parameters)?
There is quite a bunch... |
I have a problem to start my proof because I do not find a word $w$ where I can use the pumping lemma.
Task:
Be
$\sum { =\left\{ a,b,c \right\} } $ and $S=\left\{ bx{ c }^{ m }|x\in { \left\{ a,b \right\} }^{ * }\wedge m\in N\wedge { |bx| }_{ a }-{ |bx| }_{ b }>m \right\} $
Proof with the the pumping lemma, that S i... |
The multiplication of two integers of size $n$ can be done in time $O(n \cdot \log n \cdot \log\log n)$ using FFT method.
If the two integers have different sizes $n$ and $m$, does a smaller upper bound using $n$ and $m$ exists ?
|
I learned that the empty set is not an element of every set unless the empty set is explicitly included in the set like {∅}, so I believe it is false because it is not ∅ ∈ {∅}.
|
Most modern compilers and processors implement the IEEE 754 binary formats for floating point numbers. IEEE 754 guarantees that the addition, subtraction, multiplication, division, and square root operations on real floating point values are correctly rounded, meaning that the result of each operation is as if the oper... |
Wondering if there is a way technically to convert a Subdivision Curve into a Bezier Curve.
|
I'm autodidacting Pierce's Types and Programming Languages. On page 27 he states a definition for "terms, concretely" in constructing a language of terms, thus:
For each natural number $i$, define a set $S_i$ as follows:
\begin{align} S_0 & = \emptyset \\ S_{i+1} & = \;\;\;\{true, false,
> 0\} \\ & \;\;\;\cup \; \{su... |
I am trying to follow this tutorial where the Faster-RCNN-Inception-V2-COCO model from TensorFlow's model zoo is used to detect playing cards. I was wondering what is the practical limit to the number of object classes that I could use this to detect, specifically what I would want to do is to detect every letter in th... |
Consider this procedure for building a tree from $v_1, v_2, ..., v_n$:
insert $v_1$
insert $v_2$ and connect it to $v_1$ via a directional edge from $v_2$ to $v_1$
insert $v_3$ and with a uniform probabiliy connect it to $v_1$ or $v_2$
...
insert $v_n$ and with a uniform porability connect it to $v_1$ or $v_2$,... $v_... |
Problem: given a set of n coins of unique face values, and a value
change, find number of ways of making change for change.
Assuming we can use a denomination more than once, here's the pseudocode I came up with
1. NUM-WAYS(denom[], n, change)
2. dp = [change + 1][n + 1]
3. for i = 0 to n
4 dp[i][0] = 1
5.... |
According to Wikipedia and other sources, the question whether $L=P$ is an open problem, and of course everyone is familiar with the problem of whether $P=NP$. However, I found absolutely no information online regarding a possible equality between $L$ and $NP$.
Such an equality doesn't directly violate the space-hiera... |
According to my understanding, a grammar is ambiguous if it generate strings which can be interpreted in more than one ways ( that is , more than one parse tree), but when it comes to the language itself , is there any kind of relationship between the language itself and the ambiguous nature of a particular grammar tha... |
Maybe I am missing something very easy and obvious.
But, I don't understand why estimate cost of source vertex is subtracted from the overall estimate cost, if heuristic function $h$ is monotonic: $$d′(x,y)=d(x,y)+h(y)−h(x)$$
What I currently know:
A* algorithm can be used as an extension for Dijkstra's algorithm. At e... |
I'm trying to generate a grammar from this language:
L={a^i b^j c^k d^l : i+j=k+l}
to be clear its a in the power of i and b in the power of j... and so on, so that i+j will equal k+l,
I would love an explanation how to get to the solution as well, thank you!
|
Consider the following initialization step of loop invariant for merge procedure
Initialization: Prior to the first iteration of the loop, we have
$k=p$, so that the subarray $A[p .. k - 1]$ is empty. This empty subarray contains the k- p= 0 smallest elements of $L$ and $R$, and since
$i = j = 1$, both $L[i]$ and $R[... |
A problem is NP-hard iff every NP problem can be polynomially-time reduced to it.
Hardness is often intuitively explained as a lower bound. But it isn't, strictly speaking. For the sake of the argument, assume P=NP. Now the definition becomes:
A problem is P-hard iff every P problem can be polynomially-time reduced to... |
If, suppose, P doesn't equal NP. Implication of this statement is that there is no effective procedure to solve a hard problem; however there exists an acceptable solution S. I have following two explicit queries:
If an effective procedure cannot be given which yields a solution, in what sense is the S actually a solu... |
I'm currently writing an application for a trick-based card game, where agents are assigned points based on the accuracy of their predictions of how many hands they're going to win. The number of tricks predicted will display a level of confidence to the other agents as well as also potentially allowing the agent to ch... |
Let $G=(V,E)$ be a connected directed weighted graph with non-negative weights
on edges. Let $u,v,s,t$ be vertices in the graph $G$. I need to find an algorithm which in $O(|E|\log |V|)$ time checks if there is a vertex $w$ which lies in the shorthest path from $u$ to $v$ and $s$ to $t$.
My idea is to find a shortest... |
Given is an alphabet $\Sigma = \{ a, b, c \}$, and a language $A4 =\{ w \mid w \in \Sigma^* \wedge |w|_a \operatorname{mod} 2 \ge |w|_b \operatorname{mod} 2 \}$
whereas $|w|_a$ is the number $a$'s in the word $w$ and $|w|_b$ is the number of $b$'s in $w$.
We should give a grammar (of any type) for $A4$.
I know that t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.