instruction stringlengths 35 11.4k |
|---|
My friend and I were studying NP-hard problems and NP-completeness. I don't think we have understood the concept very well so I thought I would come here to solve our doubt.
To show that a given problem is in NP, we have to verify a solution to a given instance of the problem can be solved in polynomial time. We get t... |
I have an array of the size N with K distinct elements.We don't know what the K is. I would like to sort this array in O(kn).
I have found this answer and I would like to understand what does exactly @Aidan Connelly was talking about(I'm unable to comment on this answer)
I'm getting the array lets say it's (-50, 23456... |
Forgive me if this is a stupid question - it's been a while since I thought at all about complexity theory and I want to make sure that I have covered all the possible angles with regards to the basics.
My question is, is it immediately true that class P is a subset of the class NP? That is, do we need to prove that th... |
What is the easiest and the most straightforward way to find whether a given language is decidable?
For example, how do we know if the following languages are decidable or not?
`Binary representation of all prime numbers`
`{ empty string(eps) }`
|
I am interested in counting the number of solutions of a particular type (say #) in HORN SAT. I have 2 questions concerning the same.
Suppose we have a HORN SAT -: $(x_1) \land (x_2 \implies x_1)$, then the solutions are $(1, 0)$ and $(1,1)$. For solutions of type #, I would like to eliminate $(1,1)$ as after negating... |
We have two $NP$ complete problems $\Pi_1$ and $\Pi_2$. Suppose $\Pi_1\rightarrow\Pi_2$ be a many one parsimonious reduction.
If $\Pi_1$ has an FPTAS then does $\Pi_2$ also have?
If $\Pi_2$ has an FPTAS then does $\Pi_1$ also have?
|
I'm reading this book about assembly however I got stuck on one part, I can't seem to comprehend how memory address is 'applied' to the address pins
This is the image from the book
What I know here is the data pin applies voltage on the memory cell's input or output pin. And for the select pin the book explained that ... |
If r and s are any two regular expressions, then (r ∪ s)* = r* ∪ s* ∪
(rs)*.
I think this is not true. And I believe this would always be true :
(r ∪ s)* = r* ∪ s*
I wanted to clarify this because of (rs)*. What do you think the right hand side would be if r* ∪ s* ∪ (rs)* ?
|
I believe this statement to be true. And here's my reasoning:
Based on regular languages properties, the concatenation of two regular languages is regular. And since L′ = L · L, it follows that L′ must also be regular.
Do you think my reasoning is valid?
|
I'm having some trouble interpreting the camera matrix $K = \begin{bmatrix} f_x & s & x_0 \\ 0 & f_y & y_0 \\ 0 & 0 & 1 \end{bmatrix}$ after it multiplies some 3D vector.
Assume that $f_x = f_y = f$ and $s = 1$
$\begin{bmatrix} f & 1 & x_0 \\ 0 & f & y_0 \\ 0 & 0 & 1 \end{bmatrix}\begin{bmatrix} X \\ Y \\ Z \end{bmatri... |
Prove that for every computable function $f \colon \mathbb N \to \mathbb N$, there exists a computable function $g \colon \mathbb N \to \mathbb N$ such that for every $n$ we have $f(n) ≤ g(n)$.
Can anyone please explain me, why my proof below is not correct?
Lets assume, for the sake of arriving at a contradiction,... |
I've looked at the feedback vertex set and thought about connecting the problem to finding vertex disjoint cycles.
My first thought was that if there are at most k vertex disjoint cycles in a graph, then k is a bound for the feedback vertex set problem and there is a subset of k vertices satisfying the requirement (i.e... |
I need to read the digits of images like the one below:
From what I understand, this will involve:
Registering and segmenting the image into each individual digit
Hand labeling a bunch of these individual digit images
Training a classifier based on that hand labeled data
Putting it all together
Am I on the right tra... |
This is part of a bigger proof I'm trying to solve, which eventually came down to one thing:
Let $G=(V,E)$ an un-directed, complete, metric graph (maintains the triangle inequality) with an even number of vertices. Let $PM$ denote a minimum-weight-perfect matching on $E$ and let $MST$ denote a minimum-spanning-tree of ... |
In this paper with the title of "NP-Complete Scheduling Problem" by J. D. Ullman, I am trying to understand the reduction from 3-SAT problem to a scheduling problem in order to prove the later is also np-complete. An instance of 3-SAT is given as below:
and this is the instance of the scheduling problem defined as: S... |
There is a problem.
Given string $text$ containing only letters and string $mask$ containing letters and asterisks (*), where asterisk means substitution of zero or more letters, find all substrings of $text$ that fit $mask$.
There is an example: let's $text=cabccbacbacab$, $mask=\textbf{ab}*\textbf{ba}*\textbf{c}$. Th... |
I am learning something about P/T petri nets from the book from Wolfgang-Reisig authors and on the seventh chapter's end there is an exercise I can not really work out.
It asks me to construct initial marking such that the following marked graph is live and safe. Note that yellow highlighted place is for the latter par... |
I am a little bit confused with the unbounded minimization ($\mu$ operator of the $\mu$ recursive functions).
The $\mu$ operator is $\mu(f)(x) = \min(n | f(x, n) > 0)$ and the operator is said safe if we only apply it to functions such that for every $x$, $f(x, n) > 0$ for some $n$. In that case, every recursive functi... |
Is there an efficient algorithm ("does not necessarily have to be a polynomial time algorithm") to compute all "minimal" solutions for a Dual Horn formula (conjunction of clauses where each clause contains at most one negated literal)? By "minimal" I mean, consider the following dual horn clause (formula)-: $x_1 \lor ... |
I am having a difficulty proving that the set splitting problem is NP-complete using SAT.
Suppose S = {1,2,3,4} and C is a collection of subsets of S, say C1 = {1,2}, C2 = {3,4}, C3 = {1,3,4}. Each number is given a color red or blue ... need to verify if none of the subsets have only one color.
How do I use SAT probl... |
Write a grammar for a language $$L=\{ba^{2^n}b | n\ge 1\}.$$ It's not even context-free as I think. I just can't produce it, although I've tried a lot.
Now my best attempt is:
\begin{aligned}
S &\to RLM \\
M &\to AM | A \\
LA &\to aa \\
aA &\to Aaa \\
RA &\to \varepsilon
\end{aligned}
But I've found example with deadl... |
In a process like
$$
R \stackrel{def}=((a.\bar{b}.0)\setminus\{b\})[a\to b]\mid(\bar{b}.b.0)+\bar{b}.c.0
$$
$b$ is restricted to perform on the inner process of RHS $(a.\bar{b}.0)\setminus\{b\}$, thereafter the $a$ is relabeled to $b$.
What I am confused is in drawing the LTS of it, the $a$ action occur at first proce... |
I'm very confused about the reasoning for these circuits being called 'full adders' and 'half adders'
I've read before that 'half adders' are called so, because two of them make up a 'full adder', and a 'full adder' is 'full' because you can get all the values $(0,0), (0,1), (1,0), (1,1)$.
But what irks me is that addi... |
Does composition of several linear transformation plus non-linear activation function in each layer and different layers (as they are in feedforward neural net) represent or approximate a multivariable polynomial? Here is what I am wondering about. Removing the affine linear transformation part of the neuron does chain... |
I'm asked to draw a simple connected graph, if possible, in which every vertex has degree 3 and has a cut vertex. I tried drawing a cycle graph, in which all the degrees are 2, and it seems there is no cut vertex there. I know, so far, that, by the handshaking theorem, the number of vertices have to be even and they ha... |
I need to build a TM with exactly 1 tape for the language L = {w| w is a word with same number of a's and b's in it, for example: abba, aababb}
The TM has to have ONLY 1 tape and it has to run in O(nlog(n)) time. I understand how to do it in O(n^2) but i have no idea how to make it nlog(n).
If i have the input w = "aaa... |
I detect a unmanned aerial vehicle(UAV) in a picture using template matching. The template library only contains targets with different scales, rotations and other differences.I want to simplify the template library using clustering. I learned the k-means and Gaussian mixture model(GMM)but they all need determine the v... |
I have implemented a genetic algorithm for an optimization problem and I'm now trying to improve it to see if I can find better solutions or faster convergence.
I am confused about the selection part of the algorithm and how it relates to selecting parents for cross-over. In my mind these things are not the same yet ma... |
Let assume that P=NP so we have both search and decision algorithms for 3SAT at polynomial time.
Can you help me to find an optimal algorithm for optimize 3SAT, i.e.: to find the maximum number of clauses in $\varphi$ that can be satisfied.
Thank you!
P.S.
You can assume that you have search and decision algorithms f... |
Please consider the following question:
Given an integer m by n matrix A and an integer m-vector b, the 0-1 integer programming problem asks whether there exists an integer n-vector x with elements in the set ${ 0, 1 }$ such that $Ax \leq b$. Prove that 0-1 integer programming is
NP-complete.
Am I correct that $Ax$ is ... |
$L=\{$$($$m$,$w$,$n$$)$| $m$ is an encoding of a non-deterministic Turing machine, $w$ is any word/string in the closure of alphabet, i.e. $w\in\Sigma^*$, $n$ is any positive integer, i.e. $n\in\Bbb{Z}$ and $n>0$, and $m$ accepts $w$ for a maximum of $n$ moves/steps/operations $\}$
Alphabet is $\Sigma=\{0,1\}$
If this ... |
When you use resolution variable elimination to preprocess/simplify a formula in cnf form the resulting formula is equisatisfiable.
What I wonder about is if I can use this technique to remove variables i don't care about while leaving the truth values of the variables I care about untouched in the final model I get f... |
How "meaningful" is Turing test?
Because even though it's sometimes presented as a "scientific" way of classifying the goodness of AI, I do view it as a sort of naive, left-handed way for defining or measuring computer intelligence.
Because there are many more aspects to computer intelligence than mere "whether it can ... |
Why is binary search time complexity for worst case log (n) + 1 instead of just being log(n)? the way I understand it, the number of times we divide the list till we find our desired element is log (n) times in the worst case scenario. Where does this extra 1 come from? (it's log (n) + 1 according to the power point of... |
$$T(n) = (\log n) \cdot T(n/\log n) + \Theta(n^i \cdot (\log n)^k)$$
and
$$T(n) = (n\log n) \cdot T(n/\log n) + \Theta(n^i \cdot (\log n)^k)$$
for any given $i$ and $k$.
I think it helps to know that for $0<j\leq 1$
\begin{equation}
\lim_{n\to\infty} \frac{n/n^j}{n/\log n} = 0.
\end{equation}
But what is a simple way t... |
Wouldn't this language be in P, since it is a context free language. And every context free language is a member of P? Or would it be otherwise?
|
The following graph has consistent heuristic.
An A* algorithm will alter its first guess ACD to the correct shortest path ABD... if it has consistent heuristic, doesnt it mean, that AB should be found before AC?
|
Within some shape, I want to find a set of points where the distance between each point is maximized. This seems similar to sphere packing to me except that part of the sphere can be outside the shape.
|
From Online Computation and Competitive Analysis
By Allan Borodin, Ran El-Yaniv, to prove that an online algorithm $\text{ALG}$ is $c$-competitive for a minimization problem (i.e., there exists a constant $\alpha$ such that $\text{ALG}(I)\leq c\cdot \text{OPT}(I) +\alpha,$), it is sufficient to find a potential functio... |
I've struggled in the closure properties of the general class of languages because I couldn't use any automata concept and grammars.
In specific, I'm interested in dependency of operations.
(The operation $A$ is dependent to other operations $\Sigma$ when every class of languages is closed under some operations $\Sigm... |
$$A_N = A_{N-1} - \frac{2A_{N-1}}{N} + 2\left(1- \frac{2A_{N-1}}{N}\right),\quad \text{for}\ N > 0, A_0 = 0.$$
Probability for 2-node to become 3-node is $\frac{2}{N}$ and for 3-node to become 2-node is $\frac{3}{N}$. 2-node contains 1 element, 3-node contains 2 elements.
I think that $A_{N}$ is the number of 2-nodes o... |
I’m having a hard time finding anything thorough. I have found some courses with titles like "parallel and concurrent programming in Java", but I'm looking to learn general techniques, not their use in {insert specific technology}.
|
Suppose for each positive integer $N$, we have a graph $G_N$ with $N$ vertices labelled $1$ to $N$ (so $\log N$ bits are required to specify a vertex). Suppose we have a PSPACE algorithm to determine whether two given vertices in $G_N$ are adjacent (ie the space used is $P(\log N)$ for some polynomial $P$). Consider th... |
Non-computer scientist here. Suppose you have a problem of the following general form:
There is a class of objects, and a restricted set of moves to pass between objects. It is known that all such objects are related by this set of moves. There's a problem of the form "Given two objects $X_1$ and $X_2$, can you mov... |
) Suppose G is a simple graph with n vertices. Prove that G has twice as many edges as vertices only if n ≥ 5. ?
Any one can help?
|
I'm not sure what algorithm to use in the kind of problem described below, any suggestion to put me on the right track, even at any way is desirable.
Thank you in advance.
You have some 2D field in a form of two dimensional array (full of 0 & 1 values).
There are certain rules, that describe how to get from previous a... |
In the paper "Tight bounds on the complexity of the Apostoliko-Giancarlo algorithm" by Crochemore and Lecroq authors prove that algorithm performs not more than $1.5n$ comparison of characters in the processing stage. If I understand their proof correctly than there is no dependency on the bad character rule. Is it tru... |
I understand that DFAs recognize regular languages, and PDAs context-free languages, but these are a little bit too theoretical. I am wondering if we can implement common functions or solve common problems with DFAs and PDAs instead of Turing machines (or in a Turing-complete language).
By "common", I mean either one o... |
Wondering if there are any documents, theories, or methodologies for dealing with mutable memory mathematically. Basically a formal algebraic model of how computers manipulate memory. Along the lines of, say I want to model an add operation at a low level, and it writes its output to a register. Then we can model the c... |
I once had this question https://math.stackexchange.com/questions/1083338/structural-design-meta-optimization-is-there-mathematical-theory-optimiza about the methods for finding optimal structures, designs and policies (as another kind of structures - set of rules), i.e. optimization of the structure of the models not ... |
I am studying this part for a merge sort implementation:
void mergeSort(int arr[], int l, int r) {
if (l < r)
{
// Same as (l+r)/2, but avoids overflow for
// large l and h
int m = l+(r-l)/2;
// Sort first and second halves
mergeSort(arr, l, m);
mergeSort(arr, m+1, r);
merge(arr, l, m, r);... |
Given an undirected graph $G$ with $n$ vertices and $m$ edges, we build a cut as following. Initially sets (of vertices) $A$ and $B$ are empty. For each vertex $v$ we flip a fair coin and according to outcome we put $v$ either in $A$ or $B$.
Let $X$ be a r.v. denoting the cut size, i.e. the number of edges between set... |
I was reading (wikipedia) about how the rope data structure might be suitable for a text editor. Within the article it mentions "If only nondestructive versions of operations are used, rope is a persistent data structure. For the text editing program example, this leads to an easy support for multiple undo levels." I... |
Given a directed graph and an integer $N$, is it possible to detect a simple negative-weight cycle whose edges sum to $N$ in polynomial time? I thought about modifying the Floyd-Warshall algorithm to check if the diagonals equal $N$ as they get set, but I realized this wouldn't work if a vertex appeared in multiple neg... |
I am trying to understand the Hungarian algorithm for the assignment problem.
I found this presentation which gives an excellent explanation about the algorithm. However, there is one step I do not understand.
Step 3 (pages 13, 16) says "Cover all the zeros of the matrix with the
minimum number of horizontal or verti... |
In the paper https://web.stanford.edu/~gavish/documents/sipser-pvsnp.pdf , it is mentioned under the Status section that boolean circuits have been used to try and solve P vs NP. Can anyone explain to me in simple terms how boolean circuits are used for solving P vs NP?
|
Is it possible to efficiently create a bloom filter with 10^12 buckets on a single machine with 32GB of RAM and a hard drive. We can assume that the keys are already on the disk and are small in size?
|
A common approach to decide whether two given graphs are isomorphic is to compute the so-called canonical label (alternatively, canonical graph) of each graph and to check whether those match or not.
Tools such as Nauty compute the canonical graph via search trees that are pruned using some clever ideas that rely, amo... |
Call two proper graph colorings equivalent if one can be obtained from the other by a permutation of the colors.
In other words, they are the "same" coloring.
I'm interested in finding proper non-equivalent colorings.
Of course, the decision problem of determining whether or not there is such a non-equivalent coloring ... |
If a graph has a unique MST, then its edge weights are distinct. True or false ? Justify your answer.
|
Let A be an array A[0..n-1].
The array has n items.
Each item is labeled with one of these letters: {R,V,B}.
For example, A[0].label=V, A[1].label=R, etc.
What is the best algorithm for sorting items of A in lexicographic order? What is its time complexity?
I don't know if I could apply counting sort, because each elem... |
Being able to represent a Boolean circuit is useful in a number of areas of Computer Science, such as Circuit Satisfiability, Zero-Knowledge Proofs and Garbled Circuits.
Are there any standards for how such a circuit should be represented in a text file?
By a standard I mean very specific instructions about how wires s... |
The function $f$ takes two integers and produces one integer
$f(a,b) \vdash 3*(b-a)$
The only instructions I can use are +1, -1, and go to loop
At a high level, I know how to write $z = 3*(a,b)$
|
Wikipedia defines the IP complexity class as follows:
A language $L$ belongs to IP if there exists $V,P$ such that for all
$Q$, $w$,
$$w\in L\Rightarrow Pr[V\leftrightarrow P\text{ accepts }w]\geq2/3$$
$$w\notin L\Rightarrow Pr[V\leftrightarrow Q\text{ accepts }w]\leq1/3$$
Note that this definition is asymmetri... |
We have given a multiset of $N$ integer, both positive or negative. Consider all $2^N$ subsets, sorted by their sum (the empty subset has sum 0). We want an algorithm that outputs only the first $K$ sums.
The problem is that $N$ can be very big number (up to 100000), so we cannot generate all subsets. How to optimize ... |
Currently, I am looking for an lossless compression algorithm that is suitable for a large amount of text, that will be further encrypt by AES and use as the payload in steganography.
Based on A Comparative Study Of Text Compression Algorithms, it seems that Arithmetic coding is preferable in Statistical compression te... |
My question is about how to prove the correctness of this algorithm, I know it is not a good algorithm, it is not efficient and can be improved. How could I prove it still returns the desired value? What are the loop invariant and variant? How to insert assertions between lines?
The algorithm goes like following,
Algor... |
Since languages with recursible first-class functions are Turing-complete, they should be able to express anything expressible in any other programming language. Therefore, it should be possible to model conditional expressions (i.e. if-statements) with first-class functions. Could someone illustrate how to do this?
|
I was asked the following problem in an interview:
Let M be a N X N matrix, such that:
M[i][j] >= 0; 1 <= i,j <= N and i != j
M[i][j] = 0; if i = j
M[i][j] = M[j][i]; 1 <= i,j <= N
We are allowed to increase any of the entry in M[i][j] by any positive number, that we can increase the value of any cell in M[i][j] as ... |
I am currently reading this paper on library operating systems, more specific on Graphene. I stumbled over the following sentence:
"Because multiprocess abstractions, such as signals or System V IPC, tend to be idiosyncratic, an essential problem is identifying a minimal, host-independent substrate upon which to implem... |
Can anyone find a map(injection) $h$ from the set of all possible strings $S^*$ to the natural numbers $\mathbb{N}$?
$$h : S^* \rightarrow \mathbb{N} $$
Assume $S$ is finite. I would prefer an efficient map.
There should be nice applications of this question for perfect hashing, right?
|
So here's the code:-
DECLARE number as INTEGER
PRINT "Enter a number"
INPUT number
DECLARE randomarray [1:number] AS INTEGER
Is this possible? i.e whilst declaring arrays, can we use variables?
Note:The question is strictly limited to pseudocode or general programming language
|
An open problem in complexity theory is whether NC equals P.
I'm somewhat confused because I would have thought that it's obvious that NC != P because of hash onions. A hash onion is when you start with some input $i$ and repeatedly hash $n$ times:
$$H(i), H(H(i)), ..., H^n(i)$$
Given an input $i$ the amount of work to... |
Knowing that $C$ is a context-free language and $R$ is a regular language, how to prove that
$C / R = \{w| \exists x \in R: wx \in C\}$
is also a context-free language?
|
I am a CS undergraduate. I understand how Turing came up with his abstract machine (modeling a person doing a computation), but it seems to me to be an awkward, inelegant abstraction. Why do we consider a "tape", and a machine head writing symbols, changing state, shifting the tape back and forth?
What is the underlyi... |
An indexed file contains at most $2^6$ records. The indexed file is stored in a memory with $2^{14}$ cells. What is the maximum size of the index in bits?
If I would like to find the maximum size of the memory in bits I can simply just:
$2^{14} \ast 8 \text{ bit } = 131072 \text{ bit}$
I found the solution but no e... |
I need an algorithm to calculate number of pair of vertices with at least 2 distinct paths between them in a undirected graph
- the graph is connected
- distinct paths = distinct edges
ex:
no. of vert = 3 and no. of edges = 3
and we have (1, 3) (1, 2) and (2, 3)
valid paths from 1 to 2 are 1-3-2 and 1-2
- count only p... |
I'm trying to prove that $$k\text{-Matching}\le_p k\text{-Disjoint-Triangles}$$
but I was told that the $k\text{-Matching}$ (decide whether a graph has a matching of size $k$ ) can be solve in polynomial time. Then I'm stuck here.
Could anyone help me out here?
|
Here is a question I encountered:-
Read this section of program code that inputs 10 positive numbers and then outputs the smallest number input. Identify three changes you would need to make to find the largest number input instead of the smallest number.
Small = 1000
Counter = 0
REPEAT
INPUT Num
I... |
My interest is strictly theoretical at this point, but ultimately applied.
Is there any problem, theoretically, with defining a byte with m bits, and flipping single bits to connote T/F for a given ordinal value/position?
Essentially I'm looking for the most compact method reading/writing ordinal values in an array t... |
Suppose we want to find the sum of the $k$ largest elements of $n$-sorted arrays. All arrays are containing $k$ elements.
All elements are between 0 and 1, and the the sum of all elements in array $i$ equals to $S_i$.
Instead of using a min-heap to find the $k$ largest elements (and thus, deriving the sum of the $k$ l... |
In our daily life we use both coding and programming for the same meaning. I want to know the difference between these terms (If any).
If they are used for different meanings than please anyone can aware us about it, So we can correct ourselves.
|
Is there a completeness property for query languages (like SQL, Cypher, Datalog, etc) that is analogous to Turing completeness in programming languages? I wondered if it is something like being able to describe any subset of the facts in the database.
|
I'm currently programming in an unnamed turing complete language which has support for pointers, primitive data types, structures, closures, and garbage collection, among other things.
I'm trying to use this language to implement an object oriented design pattern. So far, I have implemented the following algorithm:
mak... |
Why the number of (NIL) leaf nodes in n-element red-black trees is n+1?
|
Boyer-Moore's majority vote algorithms can be used to determine the majority element in a linear time and constant space.
The intuition behind finding the majority element is understandable as it has to be greater than the count of other elements in the input sequence if a majority element exists.
However, there is ... |
How can I design a Turing machine that accepts the language $\{1^{2^n} : n \geq 0\}$?
Here is my attempt:
[![enter image description here][1]][1]
|
I am wondering if studying the Theory of Computation/ Computational Complexity theory, specifically Sipser's 'Introduction to the Theory of Computation' will help me do machine learning/statistics/data science better. Are there any connections? I intend to study the book even if there aren't any connections.
|
I'm trying to understand the theory behind finding the optimal $h$ value for differentiation in this definition:
$$ \frac{f(x+h) - f(x)}{h}$$
as $h$ tends to 0.
Here is my understanding:
Truncation error comes from say approximating the value of $f(x+h)$ using the taylor series. In this case, it could be that:
$$ f(x... |
All numbers from $1$ to $n = 2^k-1$ are written in unknown way in a full binary tree of height $k$. We say that a number $t$ lies between $i$ and $j$ if after removing $t$ from the tree we obtain that $i$ and $j$ are in different connectivity components. Propose an algorithm for determining a number in the root of tre... |
I'm having troubles with this question.
If $L\in R$, there there is a turing machine $M$ that decides it.
My idea is to build a turing machine $M'$ that somehow goes over all the possible permutations of the input word, in a way that separates it to groups of smaller words for $M$ to test. If there is a permutation tha... |
I found out an exercise where you have to prove the correctness of the following CFG:
Let $L=\{ 0^i 1^j|2i \leq j \leq 3i \}\:$ and
$\: G: S\rightarrow 0S11 | 0S111| \epsilon$
claim: Every string $w \in L$ can be generated by $G$.
It says that it's not possible to prove the claim by induction on the length string, an... |
It is somewhat confusing to me when to use quantifiers in tuple relational calculus (TRC). I stumbled upon following problem and I am still scratching my head thinking why not TRC query can be constructed without using existential quantifier.
The given problem reads like this:
Relations:
student (rollNo, name, degre... |
Suppose I want to make a left derivation tree of an expression, but the expression includes operators that are right-to-left associative. Would I still expand the left-most variable first in my tree? For example, the expression a + b ** c ** d where ** is right-to-left associative, and + is left-to-right associative.
|
I'm learning BNF, and the text I'm using gives a simple grammar for integer expressions like this:
<expression> ::= <number> | <expression> <operation> <expression>
<operation> ::= + | - | x
<number> ::= <digit> | <digit> <number>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
This makes sense to me, but then it go... |
I am solving an optimization problem using SPEA2, my problem has three cases with decision variables 25, 50 and 100 in each case. I want to ask if there is some relationship between the number of variables and iterations of evolution process. I mean to say I run algorithm fewer times when decision variables are 25 than... |
Let L1 = L2 union L3
find values such that L1 is context free and L2 and L3 are not.
So far I have:
L1 = $a^nb^n$
L2 = $a^*b^*$
L3 = $a^+b^+$
Is this acceptable?? Since L2 covers everything including epsilon and L3 is the same but does not include epsilon?
I know L2 is regular so I guess that is also not a CFL.
Another... |
$H$ is a family of weakly universal hash functions if for two elements $x,y$:
$$ P(h(x) = h(y)) \le \frac1m, $$
where $m$ is the size of the domain, and $h$ is chosen at random from $H$.
Given a hash family, how could one prove that it is weakly universal. I understand how to prove it isn't (proof by counter-example)... |
I have the problem:
Show that there exists a real number for which no program exists
that runs infinitely long and writes that number's decimal
digits.
I suppose it can be solved by reducing it to the Halting problem, but I have no idea how to do so.
I would also appreciate links to similar problems for further p... |
Given a sequence of numbers $l_1, \ldots, l_n$, I want to find for each index $i$ the next possible number to the right of $l_i$ (if any) that is different from $l_i$. What is the best time and space optimal solution to do this?
The numbers may be repeating and are in no particular order.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.