instruction stringlengths 0 29.8k ⌀ |
|---|
null |
<h1>Equivalent context free grammar for pushdown automata</h1>
<hr>
So I'm kind of confused on this idea of pushdown automata and context free grammar being equivalent. For instance, in the language,
L = {a^(n)b^(n)c^(n) | n > 0},
we can design some pushdown automaton - we'll omit pushing and popping a ... |
Equivalent context free grammar for every pushdown automaton? |
|context-free|pushdown-automata| |
<h1>Equivalent context free grammar for pushdown automata</h1>
<hr>
So I'm kind of confused on this idea of pushdown automata and context free grammar being equivalent. For instance, in the language,
L = {a^(n)b^(n)c^(n) | n > 0},
we can design some pushdown automaton - we'll omit pushing and popping a ... |
If you put {int i = 0; i <= 4; i++} into this linked list, you should have:
head->1<->2<->3<->4<-tail
Now we can dequeue each element, in the case we use java and we use the .remove() function from the Linked List class, we'll take the head element every time - this essentially acts as a queue. The queue wil... |
If you put {int i = 0; i <= 4; i++} into this linked list, you should have:
head->1<->2<->3<->4<-tail
Now we can dequeue each element, in the case we use java and we use the .remove() function from the Linked List class, we'll take the head element every time - this essentially acts as a queue. The queue wil... |
If you put {int i = 0; i < 4; i++} into this linked list, you should have:
head->1<->2<->3<->4<-tail
Now we can dequeue each element, in the case we use java and we use the .remove() function from the Linked List class, we'll take the head element every time - this essentially acts as a queue. The queue will... |
If you put {int i = 1; i < 4; i++} into this linked list, you should have:
head->1<->2<->3<->4<-tail
Now we can dequeue each element, in the case we use java and we use the .remove() function from the Linked List class, we'll take the head element every time - this essentially acts as a queue. The queue will... |
Consider this program transformation, _in any direction_, written in ANF:
```
let f = λx.a in let f = λx.a in
let g = λx.a in <-> b[f/g]
b
```
In the above, `f` doesn't appear free in `a`, and both `f` and `g` appear free in `b` (so only `f` appears free in `b[f/g]`). Or co... |
Compiler optimization pass joining identical function definitions together (or specializing them) |
|reference-request|compilers|functional-programming| |
The result of the stack you observed is based on how the [`push()`operation of the LinkedList is implemented in Java](https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html#push-E-), which appears to be the language of your code. If you follow the link, you will see that the **top** is the **front/head** o... |
<h1>Equivalent context free grammar for pushdown automata</h1>
<hr>
[edit] This machine does not accept L = {a^(n)b^(n)c^(n) | n > 0}; also, as a side note please don't try to fix my machine - I want to do it. I have an idea.
So I'm kind of confused on this idea of pushdown automata and context free grammar bein... |
<h1>Equivalent context free grammar for pushdown automata</h1>
<hr>
[edit] This machine does not accept L = {a^(n)b^(n)c^(n) | n > 0} and instead accepts L = {a^(2n+1)b^(2n+1)c^(2n+1)}; also, as a side note please don't try to fix my machine - I want to do it. I have an idea.
So I'm kind of confused on this idea... |
null |
The claim is correct. Let there be two vertices such that $\text{dist}(u, w) = D$. Note that for every vertex $v$ we know $\text{dist}(u, v) + \text{dist}(v, w) \geq D$ due to the triangle inequality. If we will sum this over all vertices $v$ we get
$$ \sum_{v}{\text{dist}(u, v)} + \sum_v{\text{dist}(v, w)} \geq nD $$... |
The problem of Oracle-SAT is given below:
> Given oracle query access to some machine, $U$ that has $2^N$ inputs, determine if there is an input such that the machine accepts.
This is very similar to the regular SAT problem. The only alteration in SAT is that we are given the structure of the circuit; i.e. the CN... |
Does $\texttt{Oracle-SAT} \leq_T^P \texttt{SAT} \iff \texttt{P} \neq \texttt{NP}$, and is this possible? |
|turing-machines|p-vs-np|oracle-machines| |
<h1>Equivalent context free grammar for pushdown automata</h1>
<hr>
[edit] This machine does not accept L = {a^(n)b^(n)c^(n) | n > 0} and instead accepts L = {a^(2n+1)b^(2n+1)c^(2n+1)}; also, as a side note please don't try to fix my machine - I want to do it. I have an idea.
[edit 2] This doesn't work and I don... |
There's no reason why this can't be thought of as common subexpression elimination, except of course that it's made trickier by requiring some kind of $\alpha$-renaming.
Another way to think of this is as a *fold transformation*. This isn't "fold" like in Haskell, a specific iteration pattern over a list, but the op... |
With $M=3,N=2$, the expression expands to
$$\begin{align}T(u,v)=
&f(0,0)\,r(0,0,u,v)+f(0,1)\,r(0,1,u,v)+\\
&f(1,0)\,r(1,0,u,v)+f(1,1)\,r(0,1,u,v)+\\
&f(2,0)\,r(2,0,u,v)+f(2,1)\,r(0,1,u,v)\end{align}.$$
$f$ denotes an image (bidimensional array of pixel values), $T$ is the image transformed to another bidimensi... |
If I am right, a structel made of the gray shape minus the two $X$ pixels will do. Erosion yields a single pixel, where the structel covers only gray pixels, and dilation will recreate the structel. [Beware of the confusion with the dual.] |
Oracle-SAT is not $\leq_{\mathrm{T}}^P$-reducible to any formal language $L$. The reason is that any such reduction would only be able to query the oracle $U$ on a polynomial number of inputs, in addition to the queries made to $L$. If $U$ returns "no" for all the inputs it is asked about, the correct answer could stil... |
My name is Balchandar Reddy. I am a research scholar and am currently working on graph algorithms. I was just wondering about creating a 4-regular graph that does not have small cycles. For example, I want to generate a 4-regular graph of size $O(k^c)$ that does not have any cycles of size $k$ or less ($k$ and $c$ are ... |
4-regular graph without small cycles |
|algorithms|graphs| |
I have heard that finite model theory has connections to database theory. Is there an example of where this database theory could be used by programmers developing database applications? |
Practical applications of finite model theory to databases |
|database-theory|databases|software-engineering|finite-model-theory| |
Let $\mathbf{F}$ be a family of triplets $(A,b,c)$ such that $A$ is an integer matrix, $b$ an integer vector, and $c$ a positive integer vector.
For a triplet $(A,b,c) \in \mathbf{F}$, define:
- $OPT(A,b,c):=\min(c \cdot x)$ subject to $ A \cdot x \leq b$ and $x \geq 0$ and $x$ is an integer vector.
- $MAX... |
An upper bound on optimal solution |
|linear-programming|upper-bound| |
Consider the following integer linear program (where $A$ is an integer matrix, $b$ an integer vector, and $c$ a positive integer vector):
$$
\text{minimize}~~~ c\cdot x
\\
\text{subject to}~~~ A\cdot x \geq b, ~~~ x\geq 0, ~~~ x~\text{is an integer vector.}
$$
Denote its optimal value by $OPT(A,b,c)$. Computing ... |
Can we compute in polynomial time, an upper bound on an optimal solution of an integer linear program? |
|linear-programming|integer-programming|upper-bound| |
My name is Balchandar Reddy. I am a research scholar and am currently working on graph algorithms. I was just wondering about creating a 4-regular graph that does not have small cycles. For example, I want to generate a 4-regular graph of size $O(k^c)$ that does not have any cycles of size $k$ or less ($k$ and $c$ are ... |
Let $f(X)$ be a polynomial in $\mathbb{F}_p[X]$ for some prime $p$ (of size 256 bits) that is not necessarily FFT-friendly. Let $a_1,\cdots,a_n$, $b_1,\cdots, b_n$ be $\mathbb{F}_p$ elements.
What is the most efficient algorithm to compute the polynomial $h(X):= \sum\limits_{i=1}^n b_i\cdot \frac{f(X)-f(a_i)}{X-a_i... |
Algorithm to compute sum of quotient polynomials |
|algorithms|runtime-analysis|polynomials|fast-fourier-transform| |
{"Voters":[{"Id":151943,"DisplayName":"pierrovoltela"}],"DeleteType":1} |
I have the following algorithm which takes as an input a non negative integer n : <br/>
i = n <br/>
while i > 0 do : <br/>
$\,$ $\,$ $\,$ $\,$i = i - 1 <br/>
$\,$ $\,$ $\,$ $\,$j = 1 <br/>
$\,$ $\,$ $\,$ $\,$ $\,$ $\,$ $\,$ $\,$while j $\le$ n do <br/>
$\,$ $\,$ $\,$ $\,$ $\,$ $\,$ $\,$ $\,$ $\,$ $\,$ $\,$ ... |
Need help verifying the complexity of an algorithm |
|time-complexity|asymptotics|correctness-proof|big-o-notation|check-my-answer| |
I'm solving the [Erect the Fence][1] problem on leetcode. My approach is to use Graham's scan algorithm with the following steps:
1. Find the leftmost point p0
2. Sort the points according to their angle relative to p0
3. Iterate over the points:
- while the orientation of the current point and the two last on ... |
Graham's scan algorithm including all colinear points |
|convex-hull| |
{"Voters":[{"Id":755,"DisplayName":"D.W."}]} |
{"OriginalQuestionIds":[23593],"Voters":[{"Id":755,"DisplayName":"D.W."}]} |
Given an undirected graph, I want to find the largest path of non-repeating edges (can repeat vertices). I know such a path that uses all edges is known as Euler path, and can be found in O(E), where E is the number of edges. What if the graph doesn't have an Euler path, how can one find the largest path of this kind? |
Largest path of non-repeating edges in undirected graph |
|eulerian-paths| |
Problems which are easy to approximate, like the [Euclidean Traveling Salesman problem][1].
These are problems for which [polynomial-time approximation scheme (PTAS)][2] approximation algorithm do exist.
> A PTAS is an algorithm which takes an instance of an optimization
> problem and a parameter ε > 0 and pro... |
Let $A,B\subsetneq\Sigma^*$ be PSPACE-complete problems for some fixed $\Sigma$ such that $A\cup B\neq\Sigma^*$. Does it follow that $A\cup B$ is PSPACE-hard? |
Are unions of PSPACE-comlete problems PSPACE-hard? |
|complexity-theory|space-complexity|complexity-classes| |
Let $A,B\subsetneq\Sigma^*$ be PSPACE-complete problems for some fixed $\Sigma$ such that $A\cup B\neq\Sigma^*$ and $A\cup B\in\mathrm{PSPACE}$. Does it follow that $A\cup B$ is PSPACE-complete?
---
In general, is there a sufficient condition for the union of PSPACE-hard (or complete) problems to be PSPACE-hard (... |
Unions of PSPACE-comlete problems that are PSPACE-complete? |
> Let $A,B\subsetneq\Sigma^*$ be $\text{PSPACE}$-complete problems for some fixed $\Sigma$ such that $A\cup B\neq\Sigma^*$ and $A\cup B\in\text{PSPACE}$. Does it follow that $A\cup B$ is $\text{PSPACE}$-complete?
The condition "$A\cup B\in\text{PSPACE}$" is redundant since it is always true given that $A,B$ are $\te... |
null |
I would like to ask if anyone happens to know an algorithm or idea how to implement a way to calculate the bundle diameter given a multiple wires with different sizes. Something similar to graphical solution below
[![enter image description here][1]][1]
[1]: https://i.stack.imgur.com/leBBi.png |
Bundle diameter calculation algorithm with different wire sizes? |
|algorithms| |
My name is Balchandar Reddy. I am a research scholar and am currently working on graph algorithms. I was just wondering about creating a 4-regular graph that does not have small cycles. For example, I want to generate a 4-regular graph of size $O(k^c)$ that does not have any cycles of size $k$ or less ($k$ and $c$ are ... |
My name is Balchandar Reddy. I am a research scholar and am currently working on graph algorithms. I am looking to find a 4-regular graph that does not have small cycles. For example, I want to generate a 4-regular graph of size $O(k^c)$ that does not have any cycles of size $k$ or less ($k$ and $c$ are some positive i... |
If you add a sufficiently-large constant to every edge of your graph, large enough to make all the edges positive, would the algorithm perform any different on the original graph than it would on this increased-weight version? |
I'm trying to write a gradient ascent approach to divide all points on a polygon into two sets via a continuous line (something like the below, where our polygon is a circle and we partition such that all points above the secant line in the circle are in $S_1$ and all points below the secant line within the circle are ... |
Your problem is studied under the terminology of "circle packing." Specifically, packing unequal circles in a circle.
Beware that many resources that study 'circle packing' in a circle often considers just the problem of uniform-sized circles (as this problem is hard enough!) rather than your more general framework ... |
Your problem is studied under the terminology of "**circle packing**." Specifically, packing unequal circles in a circle.
Beware that many resources that study 'circle packing' in a circle often consider just the problem of uniform-sized circles (as this problem is hard enough!) rather than your more general framewo... |
When you say you want a graph without cycles of size $k$ (or less), you are asking for a graph with **girth** $k+1$. When restricting your interest to 4-regular graphs, since you are asking for an upper bound on the size of your graph, you would be interested in an $(r,g)$-cage, which is a $r$-regular graph of girth $g... |
When you say you want a graph without cycles of size $k$ (or less), you are asking for a graph with **girth** $k+1$. When restricting your interest to 4-regular graphs, since you are asking for an upper bound on the size of your graph, you would be interested in an $(r,g)$-cage, which is a $r$-regular graph of girth $g... |
null |
When you say you want a graph without cycles of size $k$ (or less), you are asking for a graph with **girth** $k+1$. When restricting your interest to 4-regular graphs, since you are asking for an upper bound on the size of your graph, you would be interested in an $(r,g)$-cage, which is a $r$-regular graph of girth $g... |
My name is Balchandar Reddy. I am a research scholar and am currently working on graph algorithms. I am looking to find a 4-regular graph that does not have small cycles. For example, I want to generate a 4-regular graph of size $O(k^c)$ that does not have any cycles of size $k$ or less ($k$ and $c$ are some positive i... |
null |
null |
I am rethinking of context free grammar, I wonder that if all LL(k) can be reconizate by LR(1)? |
Is all LL(k) grammar can be recognited by LR(1)? |
|compilers|parsers| |
Let $\mathcal{G}$ be a graph class. For any class $\mathcal{H}$, we know that the minimal number of vertices that has to be removed from $G\in \mathcal{H}$ such that we get a graph from $\mathcal{G}$ is at most twice the number of edges that has to be removed from $G$ in order to obtain a graph from $\mathcal{G}$.
E... |
vertex-deletion and edge-deletion parameters |
|complexity-theory|classification|parameterized-complexity|upper-bound| |
It is well known that an algorithm to solve the Hidden Subgroup Problem (HSP) with the symmetric group can solve the Graph isomorphism problem.
But is this true in reverse? Will an algorithm for graph isomorphism be useful in solving the HSP with the symmetric group?
The HSP is only really useful for connecting a... |
Is the HSP with the symmetric group equivalent to the Graph Isomorphism problem? |
|complexity-theory|quantum-computing|group-theory| |
Is the HSP with the symmetric group exactly equivalent to the Graph Isomorphism problem? |
Yes. See https://cs.stackexchange.com/q/43/755.
See also https://cs.stackexchange.com/q/60763/755. Make sure to distinguish between a grammar vs the language accepted by the grammar. |
null |
null |
TL-DR; 10
Yes, you need to have possibility to ask up to 10 questions to (comparison) sort an array of 6 elements.
However, it is possible to create an optimal algorithm that will require no more than 10 questions in worst case, but in average **only `9.57777`** questions (in 416 cases 10 comparisons, in 304 case... |
TL-DR; $10$
Yes, you need to have possibility to ask up to $10$ questions to (comparison) sort an array of $6$ elements.
However, it is possible to create an optimal algorithm that will require no more than 10 questions in worst case, but in average **only** $9.57777$ questions (in $416$ cases $10$ comparisons, i... |
```
CREATE TABLE issue (
ID varchar(36) not null,
title varchar(255),
issue_num varchar(255),
release_year year,
comic_language_code varchar(3),
edition varchar(255),
PRIMARY KEY (ID)
);
```
From the example SQL code above, I understand that it is break the BCNF if the ID is a surrogate key that ca... |
Surrogate key often break BCNF? |
|database-theory| |
```
CREATE TABLE issue (
ID varchar(36) not null,
title varchar(255),
issue_num varchar(255),
release_year year,
comic_language_code varchar(3),
edition varchar(255),
PRIMARY KEY (ID)
);
```
From the example SQL code above, it breaks BCNF if the ID is a surrogate key that can uniquely identify all ... |
null |
The question I'm working on is as follows:
[![Question][1]][1]
I'm still kind of working on how direct-mapped caches work in my computer organization class.
I sort of understand that you need the least significant 2 bits to address which byte to use in a word (4 bytes), but that's about as far as I can get with ... |
How do you determine the amount of bits for the tag, index, and offset in a MIPS byte-addressed direct-mapped cache when given only a list of address? |
|cpu|cpu-cache|mips|cache| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.