instruction stringlengths 35 29.1k |
|---|
I have a swarm ofN robots to place on a plane area. Each robot would control a sub part of the area (navigating in it). What algorithm could I use to deploy my robots so that they all control a comparable part of the area.
I was looking at Voronoi diagrams but I cannot find how to determine the location of the points.... |
In lamport's paper[1], he define two concept The partial ordering and The totally ordering.
What does partial mean in partial ordering?
assumption: this ordering only handle two cases, one is to order events happening in single process, second is communication events between two process. It can't handle concurrent ev... |
Given a permutation of $n$ element and for each pair of position $i$ and $j$, a non-negative integer $c_{ij}$ which is cost of swapping $i$-th element and $j$-th element of permutation.
Is there any polynomial or pseudo-polynomial algorithm to sort the permutation with minimum cost?
|
In lamport's paper1, he define global local timestamp, which is composed of process id and local lamport timestamp.
This timestamp is used to order all the events in a distributed system.
The rule to compare two events is following.
My Question
Imagine we have two events, one happens in process 1 (P1), with local tim... |
Persistent (aka immutable) data structures in functional programming sidestep issues of shared memory mutual exclusion, and thus also issues such as data races that arise and which may be difficult to debug. But persistence requires more memory resources. On the other hand, wait-free versions of data structures guarant... |
Consider this language: $$L = \{w \in \{a,c\}^* \mid 3\nmid\#a(w)\land\#c(w)>0\}$$.
Here is an automaton for the first part of language, but I do not know how to devise and attach the second part of the condition $\#c(w) > 0$. Because $C$ can come in any state.
|
First, we state here a theorem that is well-known in computability theory:
$L=\{xx\mid x\in\Sigma^*\}\notin CFL$ for every fixed $|\Sigma|\geq2$
And, the standard proof is using pumping lemma. At first sight, we rarely face the language $L$ exactly as defined above in a broader theoretical research. Instead, what mig... |
Given an array $A$, sum the number of unique elements for each sub-array of $A$. If $A = \{1, 2, 1, 3\}$ the desired sum is $18$.
Subarrays:
{1} - 1 unique element
{2} - 1
{1} - 1
{3} - 1
{1, 2} - 2
{2, 1} - 2
{1, 3} - 2
{1, 2, 1} - 2
{2, 1, 3} - 3
{1, 2, 1, 3} - 3
I have a working solution which sums the unique elem... |
I am solving this problem from here.
The given relation is
$$T(n) = 2 T(\frac{n}{2}) + n^2, \, T(1) = 1$$
The solution via recurrence tree method is given as:
The zeroth level has a single node with cost $n^2$. The first level has two nodes, each with cost $(n/2)^2 = n^2/4$. The third level has
four nodes, with cos... |
I want to prove the NP-hardness of some problem P in scheduling theory. I was trying with Partition, 3-Partition and Subset product, But neither was successful.
Now, I can reduce a problem, say PRODUCT-2-PARTITION to P, but I am not sure whether such problem is $NP$-complete or not?
The problem PRODUCT-2-PARTITION is a... |
So, I was tasked with creating an app that generates the schedule of a doubles tennis tournament (i.e., teams of two) in a way that, by the end of it, everyone would have played against the rest of the players. The trick is every team should change in each round so that not only everyone played against everyone but the... |
Why is the $A_{ETM}$ for a variant of a Turing machine (an erasing Turing machine), where changing a tape symbol to a nonblank symbol is prohibited, decidable? Why does the following diagonalization argument not work:
Assume $A_{ETM}$ is decidable, and $R$ decides $A_{ETM}$. Then, $R$
accepts $\langle M, w \rangle$ ... |
Given an AVL tree,what are the possible inputs so that the same given tree is formed(please dont mention brute force technique)?
|
I have asked a similar question at stack-overflow, but then I found this question here, and figured it should go here instead..
So, my question is pretty much the same as the one in the question I linked:
I know that in a byte-addressable cache, a byte-offset (usually the LSB of the address) is used to determine which ... |
Is the complement of every semi-decidable language a semi-decidable language?
|
The grammar is $S \rightarrow AA|a$$A \rightarrow SA|ab$The actual question is to find an NPDA accepting the language generated by this grammar but for that i firstly need to convert it into Greibach form. I tried to substitute one rule in another but it didn't help. Any hints would be very helpful.
|
I've been looking at questions about the regular concatenation of two languages; one question said that the concatenation of $\{0^n1^n|n\geq 0\}$ and $\Sigma^*$ was regular (over the alphabet $\Sigma = \{0,1\}$). Another provided a counterexample by the concatenation of $\{a^{n^2}b|n\geq 0\}$ with $\Sigma^*$, which is ... |
Let $G=(V,E)$ be directed graph, where the weights of the edges are non-negative. The graph might have cycles, but without parallel edges.
Consider a $T \subset V$, and $u \notin V$.
I'm trying to develop algorithm for following optimization problem:
Adding minimal new edges (that have fixed costs that is greater th... |
I have an array ($|A|\leq 10^6$) of numbers ($A_i\leq10^6$) and a set of prime numbers. I have to find the count of the elements in the array that are divisible by at least one of the numbers in the given set.
For example:
Array: {3,5,7,15,21,143}
Set: {3,5,7}
Output : 5
The numbers are 3(3), 5(5), 7(7), 15(3,5), 21... |
Question:
Prove the following: Every set is Turing reducible to itself.
If anyone can provide a solution that would be great, I've just been introduced to computation theory so be as descriptive as you like for my sake if not strictly for the answer. Thanks!
|
I am trying to solve the following Recurrence relation using substitution method and I am stuck almost half way.
I know the answer is 2^n but I can't reach it.
At first, my question is:
Who decicdes the base cases? when do we take T(n)=1 for n=1 or T(n)=1 for n=0?
The work I have done till now is as follows:
T(n) = T(n... |
Question-
Prove: Every decidable set is Turing reducible to the empty set.
Can anyone help me with this please?
All reductions tutorials I've seen use practical examples of reduction such as sipser's introduction to computation theory:
"A reduction is a way of converting one problem to another problem in such a
way th... |
I'm writing a design document for a macro expansion language that is specifically intended for arithmetic operations on integers. I've already determined that not wrapping macros with parens can lead to unexpected behavior. Rather than expect users to practice impeccable code hygiene, implementing automatic parens will... |
Huffman coding is already doing a great job at compressing ascii bytes for data with a distribution like the following
byte freq freq%
---------------------
0 317116 26.1
, 151471 12.5
1 112952 9.3
F 60810 5
@ 60810 5
2 53642 4.4
8 49595 4.1
6 ... |
I have seen two different Peterson’s Solution to mutual exclusion, one is from Modern Operating Systems:
#define FALSE 0
#define TRUE 1
#define N 2
int turn;
int interested[N];
void enter_region(int process)
{
int other;
other = 1 - process;
intersted[process] = TRUE;
turn = process;
while(turn ==... |
I asked a question here about discrete event dynamic systems. They are systems whose state evolution depends on asynchronous events. It can be combined with flow to produce a hybrid system.
There must be an event-based model of computation, since it is so applicable to user interactions. Could someone point me in the r... |
During my preparation for an exam, I've come across an exercise that was focused on precision calculation with floating point numbers. It goes like this:
Consider the expression : $$\frac{1}{1-x}-\frac{1}{1+x}, x\neq \pm1$$
For what range of values $x$ is it difficult to compute the expression accurately in foating-... |
I have two lists say $A$ and $B$, each consisting of n positive integers. I make a list $C$ such that each element of $C$ i.e., $C_i=A_iB_i$ for each element $A_i \in A$ and $B_i \in B$.
Now I have to update the value of the maximum element of $C$ say $C_j$ by decreasing $B_j$ such that $B_j \geq 0$ and $C_j$'s updated... |
I know that the Set-cover problem with $n$ elements and a universe of size $N$ is NP complete.
Also, the problem is has parameterized complexity regarding the number of sets $k$ that should cover the whole universe:
There are only ${n \choose k}=\mathcal{O}(n^k)$ different combinations of $k$ subsets.
My specific pro... |
In this question, what exactly are they trying to ask? I.e. in the trivial case, just travel 200 miles regardless of how many miles posts there are. The penalty is always 0. What are my constraints? Am I missing something from this question that is giving me trouble about what the author means??
See 6.2.
|
If L has a regular grammar, is L always a regular language?
A regular grammar is a formal grammar that is right-regular or left-regular. Every regular grammar describes a regular language.
So would this answer be true?
|
Following this flow diagram for division hardware I made a program to "simulate" division on $N^+$.
# 4 bit version
def div(dividend, divisor)
quotient = 0
remainder = dividend
divisor <<= 4
for i in 1..5
remainder -= divisor
if remainder >= 0
quotient <<= 1
quotient |= 1
else
rem... |
I am hoping someone can break something down for me in a way I can digest.
I am trying to understand the running time for the median of three partitioning.
What is the goal of median of three partitioning? Is it to eliminate the possibility of selecting the largest / smallest element as the pivot, thus resulting in O(... |
At a conference, I heard a professor said that detecting error was only one aspect of testing (or purpose, I don't remember exactly). He said that testing is also used to:
Understanding the system
Refactoring
...
I didn't have time to ask for references. I wonder if there are books or papers discussing about purpose... |
Monochromatic problem is a classic NP-complete problem.
Does the complexity stay NP-complete if we use directed graph?
DIRECTED MONOCHROMATIC TRIANGLE problem:
Input: A digraph $G(V,A)$
Output: YES if there exists a triangle-free bipartition of $A$, otherwise NO.
A triangle-free bipartition of $A$ is a partition $A=A... |
I'm attempting ch23 in CLRS on MSTs, here's a question:
Given a graph G and a minimum spanning tree T , suppose that we decrease the weight of one of the edges not in T . Give an algorithm for finding the minimum spanning tree in the modified graph.
A solution I found was to add this new changed edge in T, then exact... |
I'm new to type theory, and recently read introductory materials where dependent type are discussed. One of my friend asked me, "Those dependent types are having recursors & 'inductors'(dependent eliminators), but how about those types that is co-inductive/co-recursive?"
Some related example is much appreciated.
|
I was considering the following two natural questions about the relationship between unambiguity and complementation for the class of context-free languages:
Is the complement of an unambiguous context-free language also a context-free language?
If a language is context-free, and its complement is context-free as well... |
In Compilers: Principles, Techniques, and Tools (2nd Edition) 2nd Edition
by Alfred V. Aho (Author), Monica S. Lam (Author), Ravi Sethi (Author), Jeffrey D. Ullman (Author) , Figure 1.5 gives a language processing system, and Figure 1.6 shows the phases of a compiler. In Figure 1.6, if I am correct, a compiler has a fr... |
I'm currently looking into Chapter 26 of Types and Programming Languages and am a bit confused by the "intuition" for Full F<: (p. 395):
A type T = ∀X<:T1.T2 describes a collection of functions from types to values, each mapping subtypes of T1 to instances of T2. If T1 is a subtype of S1, then the domain of T is small... |
Monad laws in Haskell
Left identity: return a >>= f ≡ f a
Right identity: m >>= return ≡ m
Associativity: (m >>= f) >>= g ≡ m >>= (\x -> f x >>= g)
is widely known, and I think the "Left identity" rule does not make sense.
In category theory, it is true that Monads corresponds to Monoid, but this "Left identity" is t... |
An optional exercise from Programming Language Foundations asks
Can you think of a relation on commands that is an equivalence but not
a congruence?
An equivalence here refers to an ordinary equivalence relation. A congruence refers to an equivalence relation where the equivalence of two subprograms implies the equ... |
The following is Exercise 22.3-6 from CLRS (Introduction to Algorithms, the 3rd edition; Page 611).
Show that in an undirected graph, classifying an edge $(u,v)$ as a tree edge or a back edge according to whether $(u,v)$ or $(v,u)$ is encountered first during the depth-first search is equivalent to classifying it acco... |
I can see that Integer factorization problem is in NP. I am looking for a simple intuition behind this. For example if we take the problem of sorting the complexity is $n\log n$ for merge/quick sort where $n$ is the number of objects to be sorted. Along that line if take $n$ as the number to be factorized, then factori... |
I think the following problem belong to class P, but I don't know how I can prove it, could somebody help me?
Inputs: two numbers $(a,b) \in \mathbb{N}$
Output: $a^b$
|
Using grammar:
$
S \to aABe \\
A \to bcA \mid c \\
B \to b
$
to bottom parse a string $abcccde$, the course of action would be:
$
\begin{array}{c|c|c|c}
\hline
Step & Stack & Input & Action \\ \hline
1 & \epsilon & abccde & Shift \\
2 & a & bccde & Shift ... |
I'm trying to solve this recurrence relation using the iterative method and i keep getting the different answer from using the master theorem.
$$\begin{aligned}
T(n) &= 5T(n/2) +n^2 \\
&= 5^2 T(n/4) + (5/4)n^2 + n^2 \\
&= 5^3 T(n/8) + (5/4)^2 n^2 + (5/4)n^2 + n^2 \\
&= 5^k T(n/(2^k)) + n^2 \sum_{i=0}^{k-1}(5/4... |
I'm having difficulties with an exercise in a theoretical CS class.
The problem is:
let $L_{2}$ be a language defined as follows: after every "a" come atleast two "b" or after every "b" comes atleast one "a".
What is the CFG that creates $L_{2}$?
I'm struggling since 2h... I've found out that for example "abba" is not... |
As per Wikipedia, Algorithm for In-order Traversal of Binary Tree
If the current node is empty/NULL/None return nothing.
Traverse the left subtree by recursively calling the in-order function.
Display the data part of the root (or current node).
Traverse the right subtree by recursively calling the in-order function.... |
I am interested in the problem of deciding if a cut-set of a given size $k$ (i.e. the number of edges crossing the partitions is $k$) exists in a given bipartite graph (both the graph and $k$ are part of the input). Note that this is different from the problems of MINCUT and MAXCUT which simply ask to find the minimum ... |
we have to run a song on a Walkman,for that we need 2 full batteries.Let s say we have a mixed set of 30 batteries (15 are emtpy and and 15 are full)
and then only way to test if the battery full or empty is to put them in the Walkman and try it out.we can not tell which one is empty or full (one we put inside one full... |
It is to show, using a transition system, that the two formulas $A[FG p]$ and $AFAG p$ are not equivalent.
For me, it seems strange that they are not equivalent.
As the first one says that any computation path eventually has $p$ always true.
And the second one says that any computation path contains a state such that a... |
We have to run a song on a Walkman, for that we need 2 full batteries. Let's say we have a mixed set of 30 batteries (15 are empty and and 15 are full) and then only way to test if the battery is full or empty is to put them in the Walkman and try it out. We cannot tell which one is empty or full if we put inside one f... |
today I had to deal with this exercise:
If $x \approx y$, we might expect some cancellation in computing $log(x)- log(y)$. On the other hand, $log(x) - log(y) = log(\frac{x}{y})$, and the latter involves no cancellation. Does this mean that computing $log(\frac{x}{y})$ is likely to give a better result? (Hint: For wha... |
Let's say we have given matrix of size $N \cdot M$, only with zeros and ones. For each element in the matrix, we want to count subrectangles that are covering this element and are made only of zeros. We actually want only the sum of those value, not separately for each of them.
For example:
010 -> 201
001 -> 320
The su... |
Problem : Two players have in front of them a single pile of objects, say a stack of 7 pennies. The first player divides the original stack into two stacks that must be unequal. Each player alternatively thereafter does the same to some single stack when it is his turn to play. The game proceeds until each stack has e... |
I am making early forays into the application of algorithms to best solve a problem and I am finding it difficult to choose the best application.
The problem is give the data below (two columns) find those ids where the linkedId matches entirely:
Input
id linkedId
1 103
2 107
1 107
2 103
4 64
6 120
7 10... |
I'm trying to convert some English statements to first order logic statements and I'm trying to use Prolog to verify the translations. My question is: how do I convert a first order logic statement (having $\forall$ and $\exists$ quantifiers) into Prolog rules?
For example, there's this English statement:
Every voter... |
Consider the language $L = \emptyset\emptyset^∗ + \emptyset$.
How many words does $L$ contain? Zero or one?
Note: $\emptyset^∗ =\{\epsilon\}$.
|
So this is a question within a bigger question for which I've reduced to this so far:
If I have a tree (phylogenetic) with known weights for leaves, how would I find the weights for all internal nodes such that the sum of the differences between the weights of two endpoints of edges is minimized?
I.e. Given a tree $T$... |
How do we show $$\lambda x . x (\lambda y .y) \equiv_{\alpha} \lambda y.y (\lambda x . x)$$?
I was going through the slides here and it asked to do the above but by page 16 of the slides we have not defined what lambda applications are suppose to be. Thus is remained complete unclear because I don't know what the synt... |
The answer is no to what i have learned but i am finding difficulties to absorb it reason being . We say for every language we have a grammar as language without grammar makes no sense even in general scenerio also. i have taken this argument as my base for the conclusion of my answer as i found this argument somewhere... |
I wanted to show:
$$ (\lambda x . (\lambda y.x))yx \equiv_{\beta} y $$
the definition of beta equivalence is on page 17 of these notes.
I did a few attempts but got different things like $x$. I think my main confusion is how to interpret:
$$ yx $$
at the end. Does that mean we are applying $x$ to $y$ or that we are app... |
There are $n \times m$ coins lying on an $n \times m$ grid. Each coin is either facing up or down initially. We can do the following operation repeatedly:
Flipping a row of coins;
Flipping a colomn of coins;
Flipping a diagonal line of coins;
Flipping a counter-diagonal line of coins.
The problem is to check whether... |
It seems to me that Turing could've just presented the following argument:
Theorem: Given a computational model $\mathcal{M}$ capable of conditional branching and indeterminate repetition the halting problem of $\mathcal{M}$ is undecidable from within $\mathcal{M}$.
Proof: Suppose $H$ solves the halting problem in $\ma... |
If we have $L \in p$ and $L' \neq \emptyset$ and , $L' \neq \Sigma^*$ . is $L \leq^p L' $ ?
I read this question Reduction between $\Sigma^*$ and $\emptyset$
Maybe this question is irrelevant to my question, but I'm little seconfused.
|
I was testing performance of NodeJS vs GoLang with a very simple script. Situation one is three nested for loops to do a Sin calculation and Situation two is just one for loop.
It turns out that for three for loops, NodeJS is much faster (about 3 times), but for one for loop Go is much faster (about 3 times as well). C... |
Can someone explain what is the reason for thread-pooling in Linux, even if the threads are light to create and destroy??
|
I have asked this question on Stack Overflow, I am asking it here in the hope to get more traction.
The relative rounding error for a floating point number x is defined as
$e_r = |\frac{(round(x) - x)}{x}| = |\frac{round(x)}{x} - 1|$ (1)
Assuming that the rounding to nearest mode is used for $round(x)$, the absolute ... |
I want to analyze complexity of traversing a BST. I directly thought that its complexity as $O(2^n)$ because there are two recursive cases. I mean $T(n) = constants + 2T(n-1)$. However, AFAI research it is $O(n)$. Can you show it how come and my wrong?
void printInorder(Node node)
{
if (node == null) ... |
The most common proof for Floyd-Warshall's algorithm is an induction proof on the outer-most loop, which says
$\delta^k(i,j)=\begin{cases}
\min\{\delta^{k-1}(i,j),\delta^{k-1}(i,k)+\delta^{k-1}(k,j)\} & \text{for}\,k\geq 1\\
w(i,j) & \text{for}\,k=0\,\text{(i.e., base case)},
\end{cases}$
where $d^k(i,j)$ is the short... |
I'm taking a computer theory class and my professor told us that a pushdown automaton cannot use data structures other than a stack (like a queue or multiple stacks). Why is that?
|
I am trying to solve the following problem:
Input is $2D$ array of integers, $M$, which corresponds to friendship relations. For example, if $M[1][2]=1$, $1$ and $2$ are friends (assuming symmetry it is also true that $M[2][1]=1$). If $M[2][3]=1$, then $\{1,2,3\}$ is a community. If all other entries are $0$, then $\{0... |
Can anyone help me construct a deterministic PDA for the following language:
$$L=\{w\in(a,b)^* \mid \#_a(w)\neq \#_b(w)\}$$
Or can anyone check if the following solution is correct?
|
Question 1: Is it possible to create an algorithm for deterministic Turing machine that will run not in P neither EXPTIME?
Question 2:
For me it seems that the answer for my question is it is impossible. If my reasoning is correct, it means that any function that describes complexity will have polynomial(x) or 2^polyno... |
In computational geometry, is there any algorithm to find all vertices that are inside of a shape?
All vertices of graph has $x$- and $y$-coordinates
Shape is a set of points with $x$- and $y$-coordinates (unicyclic graph)
I need a fast algorithm. I am trying to avoid iterating over all vertices
Example:
|
I was reading through the computer network fundamentals. I noticed that there are headers added at each layer in the OSI model. However, can we not have just one header above the App layer that defines the header details of every layer ?
I would think answer would be No. But any reasons why ?
Thanks
|
I've already asked this question on stack overflow, but guys have suggested me to ask my question here.
Let's consider classic big O notation definition (proof link):
The $O(f(n))$ is the set of all functions such that there exist positive constants $C$ and $n_0$ with $|g(n)| \leq C \cdot f(n)$ for all $n \leq n_0$
Ac... |
I'm working on a problem for a P2P network for games. The problem is the following:
Consider two opponents on a grid, each stores it's own position.
Player 1 wants to know if it sees player 2. In other words, if player 2 should send it's positional data to player 1 without revealing it’s position in the process.
The pr... |
I have $8008$ binary grids of size $6 \times 10$ (they are all grids with the property described below), which I want to distinguish between with at most $13$ queries. A query will determine if the cell $A_{i,j}$ of a grid is $0$ or $1$.
The grids all have a nice structure. If you find a $0$ in a cell, all cells above ... |
I’m working on a project that involves a robot and a very large number of reference points. The robot moves around, while the reference points are fixed in space. I would like the robot to be able to tell which reference points are within a fixed distance of it at any point in time. This must be done in an online fashi... |
There is a proof in Sipser showing that $NL = coNL$ (theorem 8.27 in the 3rd edition).
In the proof idea, the first sentence is: "We show that $\overline{PATH}$ is in $NL$, and thereby establish that every problem in $coNL$ is also in $NL$, because $PATH$ is $NL$-complete." I'm having trouble understanding this.
Sipser... |
I have been looking through the recursive formulation for the coin change problem here and am wondering if it is possible to define the function $ C(N, m) $ in one parameter as $C(N)$, therefore not depending on the set $ S_{m} $? What would this function look like in general? If a concrete example is needed what would... |
My question is that can we say that runtime of the binary search is $\Omega(\log n)$?
I know it is both $\Omega(1)$ and $O(1)$ for the best case, and $\Omega(\log n)$ and $O(\log n)$ for the worst case. And for this reason the time complexity of binary search is $\Theta(\log n)$.
However, I still cannot interpret if ... |
The generalized perceptron convergence theorem is for a defined threshold T.
When you do the maths it all comes to an upper bound and a lower bound.
The lower bound looks like this!
Therefore
$$ (x^{\ast})^T x(k) > k \delta. \qquad\qquad (4.67)$$
We can see if the threshold is equal to zero, this is still true.
But w... |
In a sliding window ARQ scheme, the transmitter's window size is N and the receiver's window size is M. The minimum number of distinct sequence numbers required to ensure correct operation of the ARQ scheme is
min(M,N)
max(M,N)
M+N
MN
Answer given is M+N but my understanding is
According to the given question the com... |
I'm currently studying a paper which uses extensively the term 'min-max theorems' in graph theory, and claims to present a tool allowing to generalize these theorems. (here is the link to the paper if needed)
Among those, we can find for example :
The max-flow-min cut theorem.
Edmond's disjoint arborescences theorem (... |
I am reading the introductory chapter in Parameterized Algorithms by Cygan et al. and I am having some problems with the distinction between complexity classes $\mathsf{W[1]}$ and $\mathsf{XP}$.
They explicitly define complexity class $\mathsf{XP}$ on p. 13 as the those problems that, given an instance $(x, k)$ of a p... |
I was going through the lecture of prof. Erik Demaine and he said that a problem X is NP-Hard if it is at-least as hard as every problem Y that belongs to NP class.
He further said that if we can prove that there exists a problem that belongs to NP but not to P, then we can absolutely be sure that NP hard problems don... |
First of all I did find similar questions here on Computer Science but nothing what would provide real answer for this problem.
I have a graph which i condense into SSC (strongly connected components) by Kosaraju's algorithm. Now what I need is to find connections between those SSCs. The best would be to somehow inject... |
For a constraint satisfaction problem, what does it mean for an assignment x to extend an assignment a?
Sorry if this is super trivial, I did not find an answer
e.g here: No Small Linear Program Approximates Vertex Cover Within a Factor 2 − $ \epsilon $ pg 16 x does not extend \alpha
|
This is the definition of simple grammar that I got from the book "Formal Languages and Automata" by Peter Linz.
There is a homework question that asks for a simple grammar for the language L(aaa*b + b).
This is the answer that I found.
I don't see how this could be right, or much less how there could be any answer to... |
Been trying to figure it out for an hour myself and another hour looking around, I cannot find anything with the $c^{mn}$ part.
$$L=\{a^mb^nc^{mn}\mid m>n\}$$
|
I lack the vocabulary to appropriately express the question succinctly, so I apologize if the title question is confusing.
Suppose you can define a binary infix operator that produces tuples, and you want this operator to be able to simultaneously:
Extend a tuple to arbitrary length by appending additional elements
Su... |
Problem statement:
Let $\Sigma = \{a, b, c\}$, and consider the task of multiplication encoded in the language $L = \{a^n b^k c^{nk} : n \geq 0, k \geq 0\}$.
Prove that L is not regular using the pumping lemma.
Relevant sources:
Sources (from three different people) arguing in favour of cases (where the links that are... |
I'm trying to find out how to determine the size of the matrices $n$ such that Strassen's algorithm for matrix multiplication is better than the regular algorithm. I know that Strassen's algorithm is $\Theta(n^{lg 7})$, and regular matrix multiplication is $\Theta(n^3)$.
My reasoning goes along the following lines:
W... |
Let $n$ be any positibe integer and set $N=\{1,\dots,n\}$. Now select two arbitrary but different subsets of $N$, say $S$ and $S'$. We are interested in finding a function $\pi(A)=\sum_{i\in A}a_i$ such that we always have $\pi(S) \ne \pi(S')$. For example, we can define $a_i = 2^i$. This function satisfies the propert... |
Here is a modification of the weighted interval scheduling problem.
Given $n$ intervals by their end points $s_i$ and $t_i$ for $1 ≤ i ≤ n$, I want to minimize number of intervals so that every interval has a nonempty intersection with one of the selected intervals. In other words, select $S ⊆ {1,..., n}$ such that for... |
As said the answer is pretty simple "no", but that is not what i encountered. Here is the summary : i took a regular language , produced two ways of accepting same language (the ways in my understanding produce same language -please correct me if i am wrong ),then formed the minimal DFA for both of them,used equivalenc... |
I apologize for the lack of an even better title. The main reason I couldn't find a better one is because I have a problem that I cannot find reference anywhere. I am pretty sure it has a name, but I'm afraid I simply don't know it.
I'm given an algorithm that starts with four numbers $a$, $b$, $c$ and $d$ which can be... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.