instruction stringlengths 35 29.1k |
|---|
Could somebody please confirm if a regular expression of language:
$$ L := \{b(ab)^n a^m \mid n, m \geq 0\} $$
is
$$\{b, (ab)^* a^*\}? $$
And if not, could somebody please tell me why?
|
I am having trouble solving the following question.
I am given a following problem X: Given a graph G, we want to know whether there is an edge e in G such that G − e is 3-colorable.
I want to show that $X \leq_p 3Col$
My attempt is to look at the complement of G, and say that the complement of G shows us that the grap... |
The bin packing problem can be formulated as:
\begin{align}
& \underset{x,y}{\min}
& & B = \sum_{i=1}^n y_i\\
& \text{subject to}
& & B \geq 1,\\
& & & \sum_{j=1}^n a_j x_{ij} \leq V y_i,\forall i \in \{1,\ldots,n\}\\
& & & \sum_{i=1}^n x_{ij} = 1,\forall j \in \{1,\ldots,n\}\\
& & & y_i \in \{0,1\},\fora... |
I am trying to find the complement of the language $L = \{ a^n b^n c^n \mid n \ge 0\}$.
I know that one of the things I gotta do is take out $n \ge 0$ so $\{a^n b^n c^n \mid n > 0\}$ but I feel there is not enough.Is making it so $a^i b^j c^k$ so that $i \neq j \neq k$ enough and make it so that $i,j,k > 0$?
Or am I ... |
Suppose there are three threads A, B, C and thread A has acquired a mutex lock and it is processing. If threads B and C try to acquire the same mutex, they will be blocked according to the mutex lock concept. But once thread A completes, which of the threads will be unblocked? Is there any scheduling policy?
|
Recently while reading a book (Skienna) I came across the following statement:
Mergesort works by dividing nodes in half at each level until the number of nodes becomes 1 hence total number of times we would need to do this would be $\lceil\log_{2}{n}\rceil$ and for each level we perform $O(n)$ work hence total time t... |
I am having trouble with this problem:
Let N3SAT denote the non-satisfiability problem for 3CNF’s. Show that $N3SAT\leq_p
UNQ$ where in UNQ, given a CNF φ we want to know whether there is a unique satisfying assignment for φ.
I am given a hint that for every 3CNF ψ, I should construct a CNF φ (in polytime) such that ... |
Are division and Hailstone primitive recursion function?
$$\text{Div}(x,y) = \begin{cases}
x/y, & \text{if $y$ divides $x$ } \\
0, & \text{otherwise}
\end{cases}$$
$$\text{Hailstone}(n) =\begin{cases}
3n + 1, & \text{if $n$ is odd } \\
n/2, & \text{if $n$ is even}
\end{cases}$$
I tried to solve division in this way... |
I get stuck with the following two criteria both about the uniqueness of plane embeddings of a given planar graph. The first one says that a planar graph admits unique plane embedding iff it is a subdivision of 3-connected planar graph (e.g. from the book "Planar Graphs: Theory and Algorithms"). The second one (is from... |
I'm thinking about gradient descent, but I don't get it.
I understand that it can overshoot the minimum when the learning rate is too large. But I can't understand why it would diverge.
Let's say we have
$$J(\theta_0, \theta_1) = \frac{1}{2m}\sum_{i=1}^m (h_\theta(x^i)-y^i)^2$$
$$\theta_1 := \theta_1-\alpha\frac{\part... |
I'm following
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/lecture-videos/MIT6_006F11_lec04.pdf
Last 3 lines of heapify pseudocode are:
if largest =! i
then exchange A[i] and A[largest]
Max_Heapify(A, largest)
What is the aim of the last lin... |
I need a queue $[x_0, ..., x_n]$ that supports the following operations:
$\operatorname{enqueue}([x_0, ..., x_n], x) = [x_0, ..., x_n, x]$
$\operatorname{dequeue}([x_0, ..., x_n]) = [x_1, ..., x_n]$
$\operatorname{lookup}([x_0, ..., x_n], i) = x_i$
$\operatorname{update}([x_0, ..., x_n], i, y) = [x_0, ..., x_{i - 1}, ... |
Let $G = (W, E)$ be an undirected graph, where $W = \{(v_i,v_j) \in V \times V : v_i > v_j\}$ and $E$ is a set of $2$-element subsets of $W$ such that, given two edges $e_1 = (w_1, w_2)$ and $e_2 = (w_1, w_3)$, $(w_2, w_3) \in E$ necessarily if there exists some $v$ belonging to $w_1$, $w_2$ and $w_3$. (For example, if... |
I'm surprised that people keep adding new types in type theories but no one seems to mention a minimal theory (or I can't find it). I thought mathaticians love minimal stuff, don't they?
If I understand correctly, in a type theory with a impredicative Prop, λ-abstraction and Π-types suffice. By saying suffice I mean it... |
Consider the following computation: 2^N (TWO TO THE POWER OF ‘N’, for Int. N>0),
being executed on a processor with 32 bit internal, user and ALU registers.
The registers rightmost bit is bit 0 and the leftmost bit(the sign) is bit 31.
WHAT is the SMALLEST value of ‘N’ that will cause the Overflow Status Flag (V) to be... |
I wrote pseudocode for Selection Sort, but I'm not sure what is the running time of my algorithm, can you help me with that?
My Pseudocode: Selection Sort(int a[], int n)
Input: array of length $n$
Output: sorted array
for r=1 to n
min=a[r]
for i=r to n
if (a[i]<min)
min=a[i]
... |
Assume an ordered set $M = \{\tau_1, \tau_2, ..., \tau_n\}$ and a subset $S = \{\tau_k,\tau_l,...,\tau_m\}\subset M$ where $1\leq k,l,m \leq n$. All the items of $S$ are randomly ordered.
The task is to transform the set $M$ to set $S$ using the least amount of data.
The naive approach is to use a set of indexes $I=\{k... |
I am curious of knowing of an efficient algorithm for the problem:
Given two vertices s,t in a directed graph, is there a vertex x such that xs and xtare paths?
I can of course do a BFS from each node of the graph resulting in a quadratic time algorithm.
Or I can reverse all the edges of the graph, do a BFS from s sto... |
About the following algorithm:
reach(Vertex s, Vertex t):
if s = t return TRUE
else
for v in Adj(s) do
if reach(v,t) return TRUE
return FALSE
Why can we say that its runtime on a directed acyclic graph is $O(n!)$?
I can see why there are $n!$ different paths in the graph, is it beca... |
A graph is dense when |E| (edges) is closest to $|V|^2$.
A graph is sparse when |E| is closer to $|V|$.
What does it mean to take the magnitude of the vertices? Secondly, I am having a hard time conceptualizing why the above two rules are true.
Also can someone elaborate on why if a graph is sparse, it should be rep... |
I'm confused about what it means to be Turing reducible. I thought I understood what it meant, but apparently not.
$A \leq B $ Means that A is Turing reducible to B. This means that given an oracle for Machine B, A can be solved.
I'm confused in the case of SUPERHALT which decides whether a Turing machine with access t... |
I'm trying to understanding using the pumping lemma to prove that a language is not regular. I sort of understand how it works when the language describes strings with a particular form, like in this example, but what do you set w to if there isn't a particular form.
The particular problem I'm trying to prove isn't reg... |
I'm trying to design a pushdown automata where there are two symbols in the alphabet and the accept state is when there is >= 60% of symbol A.
I'm trying to think in terms of what to save on the stack. The problem of telling when there are 50% or more is trivial. You can just pop and push As and Bs on the stack to trac... |
I am considering the following problem.
We are given a Directed Acyclic Graph. In general, there would be some number of subgraphs that, contracted into one node, would make it a tree. For example, in this graph:
If I contract the nodes $b$ and $c$ into a single node, I obtain a tree (quite a trivial one in this case)... |
The optimization problem we are generally concerned with looks like the following,
\begin{eqnarray*}
&\inf \{ p(x) \vert x \in K\} \\
&K = \{ x \in \mathbb{R}^n \vert q_i(x) \geq 0, i = 1,..,m \}
\end{eqnarray*}
where $p(x)$ is some polynomial objective function and $q_i(x)$ are polynomial constraints.
One can look a... |
A $k$-sorted array is one in which every element is at most distance $k$ from its position when the array is sorted. The complexity of sorting such array is $O(n\log k)$. But if $k=1$, then $\log k=0$ so what happens? What is the complexity of sorting an array where each element is at most one place away from its sort... |
I'm reading Tanenbaum's and Wheterall's book on Computer Networks.
I'm trying out some examples of situations that can occur in the one bit sliding window protocol for a datalink layer.
The code for the protocol can be found here on page 214.
The situation I was investigating was the following:
Let's say client A succ... |
It seems like an RNN has to have the ht-1 needs to be the same size as the input vector since they're being added to one another, but if you're doing something like modeling to another language or classification, how would you handle this? I'd imagine you'd just have a fully connected layer that would predict the outp... |
What i want to do is to compute the first $n$ values of Euler's totient function effectively. As far as i know the best way to do it is to run a sieving algorithm and for each prime encountered to update current totient-value for all its multiples. My realization in Python is given below. I use two facts about totient ... |
Here is the linear search algorithm provided in class:
bool LinearSearch(int [] a, int l, int u, int e) {
for(int i:=l; i ≤ u ; i := i + 1) {
if (a[i] = e) return true;
}
return false;
}
If the intention of this function was to linear search through the function why allow a parameter of l ... |
So I have come across an issue where it would be very nice to solve systems of linear equations over semirings but I have no clue how to do that. Over a field I would use Gaussian elimination but I'm at a loss of how to find solution spaces to even rings much less semirings. In fact I'm not 100% sure this is decidable.... |
Is the language $L = \{ w \mid w $ is $ 3^n - 1 $ in some given representation $, n > 0 \}$ regular? I know that it is regular. If each element in $L$ is represented as decimal numbers, $L = \{ 2, 8, 26, 80, 242, \ldots \}$. If in binary, $L = \{ 10, 1000, 11010, 1010000, 11110010, \ldots \}$. However, if in ternary, $... |
I have been looking for quantum computer simulators and came across QCAD (http://qcad.osdn.jp/). It is stated on their website that "Measurement gates on QCAD are different from real measurements."
I wonder if other simulators, like those listed on Quantiki (https://quantiki.org/wiki/list-qc-simulators), might have th... |
Taken from Wikipedeia:
A simple voting game, taken from Game Theory and Strategy by Phillip D. Straffin:
[6; 4, 3, 2, 1]
The numbers in the brackets mean a measure requires 6 votes to pass, and voter A can cast four votes, B three votes, C two, and D one. The winning groups, with bolded swing voters, are as follows:
A... |
I'm trying to find the running time of this pseodocose:
int x=0,i,j
for (i=1;i<=n;i++)
for(j=1;j<=n+r;j=j+i)
x=x+j;
What I did: First I checked what happened on the first iteration of the external for:
$i=1:$ the internal for will run $n+r$ times, so $j\in\{1,2,3,4,\dots,n+r\}$ so $\color{blue}{a_n=n}$
$i... |
Is there a polynomial time algorithm for an $n \times \log n$ tiling problem?
For instance: Suppose $A$ is a finite alphabet. A tile is a $2 \times 2$ matrix of elements from $A$. A tiling is a matrix of tiles in which any adjacent symbols (including diagonally) in neighboring tiles are equal.
The Tiling Problem is as ... |
I am collecting material for a MOOC about speech technology. My aim is that students also have examples to try rather than just watching the lecture and some complimentary youtube videos. So the idea was that they could call up some spoken dialogue systems or something like that. I have quite a few phone numbers of spo... |
I have a problem which has several solution but one is the optimal .
my questions are:
1- It is required to write an objective function. I don't know what "Objective Function" mean . I need the definition of this function regard my problem.
2-Another requirement is writing a Neighborhood function of a local search alg... |
Are there any results generalizing XOR Linked Lists to other types of data structures?
For example, just like an XOR Linked List requires two pointers and can iterate a 1 dimensional list, I can imagine a two dimensional linked list where nodes are arranged on a plane and connected to eachother vertically and horizonta... |
I'm looking at this tutorial on neural networks. The data that is given from the UCI study includes various attributes, such as "mean x of on pixels", "total # on pixels" etc, which are taken as input to the neural network. However, it seems to me that this choice of input parameters is somewhat arbitrary, and, in this... |
I'm currently reading Sipser's Introduction to the Theory of Computation, and I'm reading up about linear bounded automata, now we know from Rice's Theorem that whether a TM can accept all strings in a given alphabet is undecidable, I was wondering if the same could apply to linear bounded automata, if not, how would o... |
It's a theorem that, although the Kolmogorov complexity of a string is relative to the Turing machine you're working with, it differs by at most a constant (basically the amount of space it takes to write an interpreter for Turing machine A inside of Turing machine B).
My question is: how does this theorem deal with th... |
In A Discipline of Programming, Dijkstra wrote:
Two circumstances have changed the scene since then.* The one is the insight that, even in the case of fully deterministic machines, program testing is hardly helpful. As I have now said many times and written in many places: program testing can be quite effective for sh... |
I have the following problem in mind. Suppose we have an $n$-dimensional point cloud with $m$ points. Each point in the cloud is associated with a value $X_i,1\leq i\leq m$. I would like to use a hyperplane to partition this point cloud into two parts, $S$ and $S^c$, in order to maximize $\sum_{i\in S} X_i$. Are there ... |
I'm currently reviewing my Automata and Languages Theory course and I stumbled upon the following exercise exams.
Link
In "Exercises for ACS 1, Fall 2004, sheet 1", exercise 1 item C, the question is,
How many languages exist over the symbol sets from (a)?
Question (a) describes the alphabets $S=\{a,b\}$ and $S=\{1\}... |
All values are from a finite field $Z_t$.
I want to write a function greater than like this
$GT(x,y) = \begin{cases}
1, & \text{if } x > y, \\
0, & \text{otherwise}.
\end{cases}$
using only additions, multiplications, subtractions and preferably not divisions.
The equality function
$EQU(x,y) = \begin{cases}
1, &... |
I have a question about the Mano base computer. The state diagram, shown below, implies that the output device will set the FGO flag to "1" after the job is done to continue the output activity from the PC (and to zero when device is busy).
But in most cases we don't have anything to do with the output and the flag sta... |
Assume that we have a $BPP$ algorithm $A$ for a problem $\Pi$. Given input $x$ we run $A$ on $\Pi$ polynomially many times and take majority output.
However if the problem $\Pi$ is also in $NP$ instead of running $A$ so many times why cant we after every run verify the certificate that $A$ produces is correct? If corre... |
An Euclidean graph, by definition is
A weighted graph in which the weights are equal to the Euclidean
lengths of the edges in a specified embedding
and a graph is called planar if
it can be drawn in a plane without graph edges crossing
lastly, a planar straight-line graph (PSLG) is
embedding of a planar graph i... |
I have created an algorithm to sort an array of size $n$ with at most 2 inversions with exactly $n$ comparisons in the worst case.
I have no idea how to prove that it is optimal in terms of the number of comparisons. The only argument which came up to my mind is that we of course have to read the whole array, but I don... |
We are given a number $n \geq 3$ and we know that the Hamming bound is satisfied. Does this imply that there is a Hamming code with length $\frac{q^r-1}{q-1}$, dimension $\frac{q^r-1}{q-1}-r$ and Hamming-distance $3$ or do we have to construct such a code, given that the bound is satisfied?
|
I have a difficult problem to solve which as mentioned in the title is related to modal logic axiom S4.
So, here is some background knowledge that can be useful:
S4 axiom is a class of transitive and reflexive frames
S4 satisfiability problem is PSpace-Complete
lastly solver for S4 does not terminate without a trick w... |
I understand that the MCTS algorithm expands its tree after it has selected the best route to take. However, how does it decide when to end selection and then expand the tree? It cannot just traverse down the whole graph... then it would always produce child nodes at the same place (right?) So, how does the MCTS decide... |
The usual bin packing problem can be formulated as:
\begin{align}
& \underset{x,y}{\min}
& & B = \sum_{i=1}^n y_i\\
& \text{subject to}
& & B \geq 1,\\
& & & \sum_{j=1}^n a_j x_{ij} \leq V y_i,\forall i \in \{1,\ldots,n\}\\
& & & \sum_{i=1}^n x_{ij} = 1,\forall j \in \{1,\ldots,n\}\\
& & & y_i \in \{0,1\}... |
Wiki in https://en.wikipedia.org/wiki/PP_(complexity) says "a PP algorithm is permitted to do something like the following:
On a YES instance, output YES with probability $1/2 + 1/2^n$, where n is the length of the input.
On a NO instance, output YES with probability $1/2 - 1/2^n$."
Can we replace $2^n$ by something la... |
I am working on a problem in which I must find a graph with edge weights on n vertices, for which Kruskal's algorithm achieves worst-case running time. I am using a UNION-FIND data structure, but with no optimisations (path compression or weight/height union rules).
The version of Kruskal's which I am using is as foll... |
I want to know how Maths Co-Processors are made and how they work. I do understand that these are based upon electrical (yet chemical) switches, but how do they calculate things ?
I don't understand how switching something on and off not only make something tick but also make it do much more.
I get it that it can tur... |
What is the difference between graph-partitioning and graph-coarsening with respect to scale-free networks? I am trying to analyze graphs generated using the data from social networks. Do both the terms mean the same or are they different?
|
What is the difference between graph-partitioning and graph-clustering in graph theory?
|
i'm reading an old exam and one question was:
Which property of the Bakery algorithm is violated with the following change?
- mutual exclusion
- deadlock freedom
- starvation freedom
Algorithm: (i is the number of a thread)
choosing: array[0..n-1] of boolean (init false);
number: array[0..n-1]
loop forever:
1: choos... |
Good day,
I have heard about the Montgomery modular multiplication, and the Barrett_reduction; (or any other) But in practice I don't understand how could I implement a multiplication algorithm in a Ring modulo n.
I am looking for such algorithm in an JavaScript environment using an accumulator.
Edit: I found what I wa... |
Suppose that i need to compute product $~\phi(1) \dots \phi(n)~$ modulo prime $500009$ as fast as possible. Memory limitations are rather tough: $64$ mb so i can't just keep all the values of totient function. $n$ can be as large as $10^9$ and time given is $2$ s.
My main idea is to somehow estimate the prime factors a... |
When reading up on the UCT1 algorithm (I'm writing a Monte Carlo tree search), I'm having trouble with the formula.
$$\frac{w_i}{n_i} + \sqrt{\frac{\ln t}{n_i}}$$
Wikipedia, this guy, and this guy all say that $t$, or whatever else they use for that variable, equals the "total number of simulations". What does this mea... |
I have $n$-digit integer $N=a^2b$, $b$ is square-free. In other words, $a$ is maximal square which divides $N$.
What is fastest known algorithm to find $a$? I can write algorithm of $O(n^2\sqrt{N})$ simply trying all squares that are smaller than $N$ and checking for divisibility.
Is this problem as hard as factoring i... |
If I have this pseudocode:
for i=0 to n/2 do
for j=0 to n/2 do
... do anything ....
The number of iterations is $n^2/4$.
What is the complexity of this program?
Is it $O(n^2)$?
What is the intuition formal/informal for which is that complexity?
Next, if i have this other pseudocode :
for i=0 to n do
for... |
I have a string with length N. I would like to know how many segmentations are possible to it.
Consider the example abcdc the number of N = 5
All possible segmentations are
['abcdc']
['abcd', 'c']
['abc', 'dc']
['abc', 'd', 'c']
['ab', 'cdc']
['ab', 'cd', 'c']
['ab', 'c', 'dc']
['ab', 'c', 'd', 'c']
['a', 'bcdc']
['a... |
$L = \{ a^i b^i c^i | i \ge 0 \}$
I understand that it's everything not in $L$, so every string where $\#a's = \#b's = \#c's$ is not in $L$ complement. However, I wasn't sure if strings such as $ba$ or $cba$ would be in the complement.
|
How would one prove that the following scheme definition is an ordered stream of integers
(define integers (cons-stream 1 (add-streams ones integers)))
|
Lately, I have been reading about operating systems design. The idea that all user space programs utilize Kernel services via a "System Call Interface" have got me thinking further into this.
Is system call implemented in specific language like C/C++ on each operating system or it is some sort of assembly language or ... |
I hope this is not too broad. I need to evaluate about 8 different ISA targets for about 12 specs. The only metric I'm intersted in is size of the output bytecode. Moreover, I'm only interested in relationship between code size for different targets, so I don't particualarly care about optimizing the code. My backgroun... |
X→Y →(X+Y)×Y
I'm confused about how to get the type (X + Y).
If I assume m: (X + Y), n: X, k: Y
then I can get $${m:X+Y \vdash \lambda n:X.\lambda k:Y.<m, k>}$$
which get the right type. But I can't reduce the context m: X + Y.
So, could anyone tell me how to make it? Thanks a lot.
|
How do I compute the Jacobi symbol $(N|A)$ efficiently?
In particular, for every odd $N, A$, define the Jacobi symbol $(A|N)$ as $\prod_i Q_{p_i}(A)$ where $p_1, \dots , p_k$ are all the (not necessarily distinct) prime factors of $N$ (i.e., $N =\prod_i p_i$), and where $Q_p(A)$ is defined as below (i.e., $Q_p(A)$ is t... |
I have been taught that QuickSort has the following recurrence equation in the best case:
$T(n) = \begin{cases} c & \text{if } n=1 \\ 2\ T(\frac{n}{2}) + c \cdot n & \text{if } n>1 \end{cases}$
where $c \in \Theta(1)$ and $c \cdot n \in \Theta(n)$. As well for the general case:
$T(n) = \begin{cases} c & \text{if } n=1 ... |
So I have been given the following problem and since I have no experience at all in this field, I would really appreciate some advice/guidance.
These are the requirements:
So three times per second a certain amount (fixed per session) of 32-bit values come in. These values have to be stored into a file with a timestamp... |
What can be a good convention to represent positive and negative integers in unary notation on a Turing machine? I want to design a Turing machine which acts as a subtractor.So should I partition the integer range to represent positive and negative integers in unary notation or is there some other way?
|
I want to know 'What Computer Scientists Actually Do'. It is kind of a very vague thing to me. I don't know anything about it, actually.
I have many people in my family who chose and plan on choosing CS but I do not understand what they do after being done with their Academic Classes and perhaps after their placement t... |
In the Circular Wait condition for Deadlock Prevention section of this, it is described as follows:
One
way to ensure that this condition never holds is to impose a total ordering of
all resource types and to require that each process requests resources in an
increasing order of enumeration.
To illustrate, we ... |
I understand that Byte/ IL Codes are interpreted/executed by their corresponding run times. Do those run time converts the Byte/IL codes directly to machine code which processor can execute or the intermediary codes are converted to C/C++ calls? Similarly, for privileged actions like File IO, do the run time translat... |
I have read that NodeJs is able to support hundreds and thousand of concurrent calls because the worker threads do not wait on the IO calls to complete. They use event driven IO. Similarly in .NET we have Async keyword which allows the worker thread to be returned to perform other tasks while the "IO" call is executin... |
I want to test the applicability of homomorphic encryption in the financial domain, as suggested in Can homomorphic encryption be practical ?.
Now, I want to know what algorithms are used for financial cloud solutions, and if these methods can be improved by adding confidentiality of data. Namely, somebody wants both t... |
Suppose that you have a large dictionary with spellings and pronounciations of foreign words, and you want to find a set of pronunciation rules. They should have the simplest form: a sequence of letters to a sequence of sounds.
For example, in French, c [k], i [i] and ci [si].
The rules may be long: tion [sjɔ̃] (inste... |
I have a positive integer $n$ and two disjoint sets of nodes $V=\{v_1,\ldots,v_n\}$ and $W=\{w_1,\ldots,w_n\}$. I also have a weight function $f:V\times W\to\mathbb{R}_{>0}$ and a positive number $\alpha$. The function $f$ is represented by the matrix $\mathbf{F}=\left[f_{vw}\right]$ as:
$$\mathbf{F}=\begin{bmatrix}
f_... |
I'm having trouble in comparing these two memory consistency models.
Essentially for sequential consistency I think of real code like this:
int x, y;
void ThreadA()
{
x = 20; //Write
int a = y; //Read
}
void ThreadB()
{
y = 20;
int b = x;
}
In a sequential consistency environment it's impossible for ... |
I have studied about both of these on many places like this, this and this, but still it is not that much clear that what the actual difference is between these two.
The Wikipedia links (first and second links mentioned above) say about deadlock prevention that:
The hold and wait or resource holding conditions may be ... |
What is the best algorithm to compute p-dominating set?
The p-dominating set problem is a parameterized version of minimum dominating set in which the problem takes a parameter $k$ also as an input, and the problem is now whether there exist a dominating set of cardinality at most $k$.
I know the problem is W[2]-hard s... |
I am doing an exercise from Models Of Computation - Ch - 5, Q-1(r).
Design a grammar that generates this context-free language
$\{ x\space\$\space y^R \,|\, x, y \in\{0, 1\}^* \text{ and } x \ne y\}$
Any hint will be nice.
(My try: I can't seem to come up with a grammar. The pushdown automaton that can accept this lan... |
Let us start with the optimization question,
\begin{eqnarray*}
min \{ c \vert c - f \in SOS_d \}
\end{eqnarray*}
for some function $f : \{0,1\}^n \rightarrow \mathbb{R}$ and $SOS_d $ being the cone of all polynomials on $\mathbb{R}^n$ which can be written as a sum of squares of polynomials each of degree at most $\fra... |
so im trying to create a DFA for a language that has an infinite number of possible strings over the alphabet {a,b}.
can i not just have one state (initial and final state) that loops a,b to itself?
thanks
|
Can I just make a nameserver and claim away? Are there implemented measures to stop this from happening?
|
I would like to know how they obtained the expression $2n-1$ as said from the excerpt of article (p.3):
The key advantage is that in Chomsky Normal Form, every derivation of a string of n letters has exactly 2n−1 steps.
I could get how $2n$ comes since there are only 2 variables on the R.H.S of each production but co... |
Today at lunch, I brought up this issue with my colleagues, and to my surprise, Jeff E.'s argument that the problem is decidable did not convince them (here's a closely related post on mathoverflow). A problem statement that is easier to explain ("is P = NP?") is also decidable: either yes or no, and so one of the two ... |
Given is an initial set of n keys. Each key k is of the form (p, q). Note that both p and q are positive.
At any given point, there are two possible actions:
1) Query-Delete: Given a value s as query, find all such keys in the set that have have the (globally) minimum p and satisfy (q >= s), and delete these keys.
2) I... |
Came across the following tile problem :
Given a “2 x n” board and tiles of size “2 x 1″, count the number of ways to tile the given board using the 2 x 1 tiles. A tile can either be placed horizontally i.e., as a 1 x 2 tile or vertically i.e., as 2 x 1 tile.
Recurrence formula is as mentioned below :
count(n) = n if ... |
I am trying to prove the theorem that ZPP = RP $\; \cap \; co-RP$. If $L \in \; \subseteq RP \; \cap \; co-RP$ then I can see that it belongs to $ZPP$. But I am unable to prove the reverse direction, as definitions of $RP$ and $co-RP$ don't include Turing machines whose expected running time is polynomial, but $ZPP$'s ... |
Consider the following algorithm for computing integer powers:
Procedure power(integer x, integer n)
power := 1
for i := 1 to n
power := power * x
return power
Can we say that the loop invariant is $power \leq x^n$ ?
Before the loop $power$ is initialized to $1$ so its equal to $1 \leq x^n$.
... |
I am trying to implement a Gauss-Newton algorithm for non-linear optimisation. Unfortunately despite searching through the library and the internet I can't figure out quite how to use it in my case. As such I am hoping that I have come to the right place to ask for some assistance? Thank you to anyone willing to help m... |
In the bin packing with fragile objects (BPFO) problem one is given a set of objects $\{1,\ldots,n\}$ where each object $i$ has a weight $w_i$ and a fragility $f_i$ for all $i$ in the set $\{1,\ldots,n\}$. (We assum that $w_i\le f_i$.) Also, we have a set of bins of infinite capacity (each) in which we want to place th... |
Say that a class $C_1$ is superior to a class $C_2$ if there is a machine $M_1$ in class $C_1$ such that for every machine $M_2$ in class $C_2$ and every large enough $n$, there is an input of size between $n$ and $n^2$ on which $M_1$ and $M_2$ answer differently.
Is DTIME($n^{1.1}$) superior to DTIME($n$)?
Is NTIME... |
Consider the language $L \subseteq \{a,b,c\}^*$, where $w \in L$ if and only if the ratio of the number of $a$'s in $w$ to the number of $b$'s in $w$ is an integer. I've been unable to find a counterexample string in $L$ which I can use to disprove (via a contradiction proof using the pumping lemma for CFLs) that $L$ i... |
Using continuation passing style, many common language constructs can be written in a simple language with recursion, including loops (using trampolining), exceptions, generators and even function returns. I have found numerous examples of other language constructs, but all examples I have seen use if-statements direct... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.