instruction
stringlengths
35
29.1k
Creating a context-free grammar for the language $L_1 = \{ 0^{n} 1 ^{m} \mid m,n \in \mathbb{N} \wedge m \equiv n \mod 3\}$ is quite easy. A grammar is $$ S \rightarrow \epsilon \mid 0A $$ $$ A \rightarrow 1 \mid 0B $$ $$ B \rightarrow 11 \mid 0S $$ But I am now trying to create a context-free grammar for $L_2 ...
Let's say our alphabet is 0 and 1. How would you approach writing a regex to generate a language of words that do NOT contain 101. The only regex operators allowed are concatenation , star * and OR |. I am stuck now and I want to know if anybody has an idea.
I was looking for non-recursive implementation of DFS algorithm. I found the following pseudocode on this page. 1 procedure DFS-iterative(G,v): 2 let S be a stack 3 S.push(v) 4 while S is not empty 5 v = S.pop() 6 if v is not labeled as discovered: 7 label v as discovered ...
Let's say we want to write a regular expression that matches a string that ends with the same pattern that it begins with. Let's say that we have an alphabet composed of the binary symbols: {0,1} We should make a regular expression to create a language that is composed of words (W) with the following pattern: W=w1w2w1 ...
The iOS emoji keyboard has a Frequently Used section. Notably, this is different from a Recently Used implementation - the data structure behind it is not an array of emoji where once you use an emoji it is inserted in the array (after first removing it if it already exists). But neither does it appear to be implemente...
Given an undirected graph $G$ of $N$ nodes and a starting node $s$, I want to build, with dynamic programming, a table whose $(k, n)$-th entry is $1$ if node $n$ is reachable with exactly $k$ steps from node $s$. Specifically, for the first row of the table, I set $(1, n)$ to 1 if node $n$ is connected to node $s$. The...
say you want to make a Pushdown Automaton to recognize this language. What exactly does the +1 mean? I see in the example it just pushes an a to the stack before arriving at an acceptance state but I don't quite get why.
So in regular algebra we have some basic operations defined such as multiplication, addition, subtraction and division. For these operations/operators, we have some properties like commutativity, associativity and distributivity. Is there an analogue set of properties for the operations/operators on that we do with Reg...
So if we have a complex equation in regular algebra we can use properties like distrbuivity, associativity and commutativity to make an equation simper or more compact. Can we use some sort of techniques on regular expressions to make them more simpler? For example what is the relation between concatenation and kleene ...
A (non-deterministic) finite state automaton for "all strings that contain substring $w$" is very simple. Just make the path for $w$ and add looped transitions for all letters at the first initial state and the last final state. When asked to make a deterministic automaton in general we might expect that the automaton ...
Knowing D={p|p is a polynomial evaluating to 0 for some assignment of integers to its variables} is not decidable, how can I prove that E={p|p is a polynomial evaluating to a prime for some assignment of integers to its variables} is not decidable? Proving that D is mapping reducible or Turing reducible to E would be...
I have an NP-hard problem P where we are trying to minimize some objective function subject to some constraints. Problem P is very hard in the sense that even finding a feasible solution is NP-hard! (i.e., finding a solution that satisfies the constraints is NP-hard). Let OPT denotes the optimal algorithm for P. That i...
How is the valid/invalid bit in paged memory useful? I am not able to understand the significance. Is it also somehow used to share the processes among different users.
What are advantages and disadvantages of weight balanced binary tree over the height balanced binary tree?
I am trying to solve this branch and bound problem but I could not come up with any approximate cost function which is better than the cost. Let's say $G$ is a graph of $n$ nodes $\{1, 2, 3, \ldots , n\}$. For a permutation $f$ of the nodes of $G$, the weight of each edge $(x,y)$ will be $|f(x)-f(y)|$. The total we...
Let $G = (S, T, E)$ be a bipartite graph without isolated vertices. For each edge $e ∈ E$, $e = st$ (where $s ∈ S$, $t ∈ T$), the inequality $d_G (s) ≥ d_G (t)$ holds. Prove that there is a matching in $G$ saturating all of $S$'s vertices.
A CFG is in strong GNF when all rewrite rules are in the following form: $A \rightarrow aA_1...A_n$ where $n \leq 2$.
When we parallelize tasks and measure the perforamnce,two common measures of parallel scaling are Strong Scaling: Time for fixed problem size as number of processor is increased Weak Scaling: Time for fixed computational work per processor as problem size is increased Some documents mention that the weak scaling is eas...
I'm trying to follow the center star algorithm error analysis - section 6.5.3. They claim that for the center string $S_1$ the distance induced by the algorithm $d(1, j)$ is always equal the optimal alignment $D(S_1, S_j)$ since $\delta(-,-) = 0$. I don't understand this argument. For each j, the algorithm aligns a to...
A literal is a piece of data which gets its value at compile time. Means: Becomes set at compile time and afterward the value is fixed incorporated into the machine code as a code consisting out of 0s and 1s. What are literals in interpreted languages like for example JavaScript? As far as I know the code within JavaS...
Propose a reasonably efficient algorithm to decide, given a DFA $A$ and a CFG $G$, whether $L(G) ⊆ L(A)$. I think that I have to prove it by computing the intersection of both (DFA,CFG), and then look if the language generated by the intersection is the same as that generated by the CFG. But I'm not sure if it works....
How can I prove that the language $L=\left\{\langle M\rangle\mid L(M)=\left\{\langle M\rangle\right\}\right\}$ is not decidable? When trying to use a diagonal argument, I cannot conclude from $L(M)\ne\left\{\langle M\rangle\right\}$ that $\langle M\rangle\not\in L(M)$. Also, it seems that I cannot apply Rice's theorem ...
I'm studying for my computing languages and I have some problem on getting the production rules from a push down automata. The automaton accepts all strings over alphabet $\{e,k,q,y\}$ of the form $w\,kyyk\,w'$ such that $|w|=|w'|$. There are the productions rules I get. S -> QkyykK Q -> qQ Q -> yQ Q -> eQ Q -> kQ Q ->...
https://en.wikipedia.org/wiki/P_versus_NP_problem states: If graph isomorphism is NP-complete, the polynomial time hierarchy collapses to its second level. They further state that this may be unlikely, but at least it's a possibility. However, https://en.wikipedia.org/wiki/Time_hierarchy_theorem states: The theore...
a b c Y 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 1 0 1 1 0 0 How would you put this into a logical expression that shows Y's behaviour?
As far as I know (despite some variations which provide empirical average-case improvements) quick-sort is worst case $O(n^2)$ with the original Hoare partition scheme having a particularly bad behavior for already sorted lists, reverse-sorted, repeated element lists. On the other hand a B-Tree has $O(\log n)$ inserti...
Whenever I'm coding a dynamic program , I usually struggle building the solution from the predecessor matrix . How should use the predecessor matrix to find the solution ? Thanks,
Once we fix a polynomial time deterministic verifier V(input, certificate), its corresponding NP problem is the question: For this input, does a (polynomial size) certificate exist such that V(input, certificate) returns True? The associated counting problem (#P class) is: How many certificates exist such that V(input,...
For instance, if we know a language $L_1 = \{ \langle M \rangle \mid ~ \lvert L(M) \rvert = n \} $ is decidable, can we prove that $ L_2 = \{ \langle M \rangle \mid ~ \lvert L(M) \rvert = n-1 \}$ is also decidable? In other words, prove $L_2$ reduces to $L_1$.
I am trying to come up with a proof for the following: For any language $A$, there exists a language $B$ such that $A \le_{\mathrm{T}} B$ but B $\nleq_{\mathrm{T}} A$. I was thinking of letting $B$ be $A_{\mathrm{TM}}$, but I realize that not all languages are Turing reducible to $A_{\mathrm{TM}}$, so $A \le _T B$ wo...
Let's say we have circuitry that can send pieces of data to the past state of the program through literal time travel. Said time travel takes 1-5 clock cycles (I cannot assume the nature of time travel so I am giving slight lee-way) and sends one byte to some byte in the past programs memory along with a check bit to s...
I've got a test on this tomorrow, my instructor's lectures aren't up, and the notes are ambiguous... Anyhow, we've been covering floating point operations, specifically addition, and he mentioned these three bits. While I can surmise their meaning to a degree, I'm wondering if anyone could explain concretely what they...
In articles you often find the terminus "capture avoiding substitution" that saves the author(s) from the tedious process to re-define a recursive function -including alpha-conversion and the invention of fresh names- in the discussion of dynamic semantics. The terminus is well understood by the readers and somewhat st...
$\textbf{stmt} \to$ $ \textbf{if} $expr$ \textbf{then}$ stmt $\mid $ $\textbf{if}$ expr $ \textbf{then}$ stmt$ \textbf{else}$ stmt $\mid \textbf{other} $ This grammar is called as Dangling Else Problem . However the ambiguity is resolved by parser as described as fo...
Has there been any research on the proof complexity of a resolution to the P=NP problem? If not, given the lack of progress on the problem, would it be unreasonable to conjecture that any proof that resolves the P=NP problem will require a super-polynomial number of steps?
You have two binary search trees A and B, each one is a complete binary tree containing $2^k-1$ nodes. The maximum value of the keys in the tree A is less than the minimum value of the keys in tree B. Propose an efficient algorithm for creating a single height-balanced binary search tree containing the key values of a...
Background: The idea of this data structure is as follows. We will have a collection of arrays, where array $i$ has size $2^i$. Each array is either empty or full, and each is in sorted order. However, there will be no relationship between the items in different arrays. The issue of which arrays are full and which are...
While setting left=0, right=n-1 and A an array of n numbers, find out the running time complexity in terms of $\Theta$. Firstly find out the recurrence and then evaluate it by using the substitution technique. (MergeSort is a regular mergesort between the given 2 indexes, and Merge is of linear time complexity as the n...
How many different binary search trees are possible that store the values 1,2,...,n ? So far I found a recursive formula for the number (by case distinction what's at the root): $ T(n) = 2T(n-1) + \sum_{i=2}^{n-1}T(i-1)T(n-i), n > 1 $ and $ T(1) = 1 $ But I have no idea how to solve this recursion. Our task was only to...
so I am currently learning about dfa and nfa and i came across the following question which requires me to use Brzozowski's derivatives method to construct a minimal DFA recognizing the language defined by the rational expression below. I am having quite a bit of trouble understanding how Brzozowski's derivatives works...
Is $L=\{ M | M\text{ leaves the start state on every input}\}$ decidable? I have an intuition that the following language is undecidable, since the complement $L^C$ seems to not be recursively enumerable. Some TM might remain on the start state for $k$ steps, but then leave at $k+1$ steps, so we can't get a definitive ...
I have to solve linear transportation problems for a research project. Ideally, I should design an application that will recieve the problem data as an input and then show some results. The size of the problems are in the order of N=10.000 sources and N=10.000 destinations, and 2N=20.000 restrictions of equality, one f...
I am working on finding the asymptotic estimate for $$ \sum_{k=1}^{N} {\frac{1}{k^2 H_k}}.$$ All I know is that ${\frac{1}{k^2 H_k}}$ is convergent because $${\frac{1}{k^2 H_k}}<\frac{1}{k^2}$$ and $\frac{1}{k^2}$ is convergent. Am I right to conclude that the asymptotic estimate for this is $O(\frac{1}{k^2})$?
This statement really made me confused, Is any superset of an undecidable set is uncountable?
I want to prove that $L = \{\langle T\rangle\mid T \text{ is a DFA and $L(T)$=$(101)^*$}\}$ is decidable. I have the following idea in mind: I design a TM $M$ such that, first of all, $M$ converts $(101)^*$ to NFA $P$. Then it converts $P$ to DFA $K$. After that $M$ determines whether $K$ and $T$ recognise the same la...
I'm currently reading up a bit on Turing decidability reductions as I'll take a more in-depth course about the topic next semester. While reading up on some older course material I asked myself the following question which leaves me a bit puzzled: Let $A, B$ be languages, and $\le_m$ be the mapping reduction for langua...
In lambda calculus, starting from $KII$ we can get by a single $\beta$-reduction to either $\lambda y.II$ or $KI$ Now, according to Church-Rosser, these should be reducing into a common normal form. But the first reduces to $I$ and the second to $\lambda y.\lambda z.z$. Am I doing wrong $\beta$-reductions or the theore...
Write the conjunctive or disjunctive normal form of an expression $f$ that is true if the number $t=(xyz)_2$ is a zero of the following polynomial: $$p(t)=(t-6)(t-5)(t-4)(t-2)t(t+1)(t+3)(t+7)$$ The zeros of this polynomial are $-7,-3,-1,0,2,4,5,6$. So $t$ has to be $(000)_2$ or $(010)_2$ or $(100)_2$ or $(101)_2$ or $...
I'm leaving out some specifics because this is a challenge problem and I don't want to be spoon-fed the answer, but I need a nudge in the right direction. I am given a complete digraph with the following characteristics: There is one "start" node There is one "end" node There are N additional "special" nodes Edges may...
If I have a nx2 grid which I need to fill using 2x1 dominoes and L shaped trominoes in any combination, how many different combinations are possible? I am aware that when only 2x1 dominoes are used then the cell definition using dynamic programming is: $$ f\left [ 0 \right ]= 0 $$ $$ f\left [ 1 \right ]= 1, i=1 $$ $$ f...
During my programming assignments in multi-agent systems, I noticed that it feels impossible to get distributed agents to cooperate without a synchronous component. Let me explain what I mean by these terms: Cooperation: I would loosely define this as any process which a single agent cannot solve without receiving non-...
All we know is that if a language is countable than it must be recognizable. However, a recognizable language may or may not be decidable.
Do we know an infinite sequence of decision problems where the most efficient algorithm for each problem takes $\Theta(n^k)$ time, where $k$ increases unboundedly? Suppose for example that we would know that finding a k-clique takes $\Theta(n^k)$, then this sequence could be {1-clique, 2-clique, 3-clique, ...}. However...
I have an excerpt from my textbook concerning direct mapped cache that I would like further clarification on, the text reads..... "Consider the following example: Assume memory consists of 2^14 words, cache has 16 blocks, and each block has 8 words. From this we determine that memory has 2^14/2^13 = 2^11 blocks. We k...
Given $n$ sets $r_1, r_2, \cdots, r_n$ and a number $\delta$ where $0 \le \delta \le 1$. Let $T=\cup_{i=1}^{n}r_i=\{t_1,t_2,\cdots,t_m\}$. Each $t$ has a value $v(t)$, which is given to us. The task is to find a subset $S$ of $T$ that minimize the total value $\sum_{t\in S}v(t)$ while guaranteeing $\sum_{i=1}^{n}\frac...
The steps to show something is NP-complete is to show it is a member of NP, and then show an NP-complete problem reduces to it in polynomial-time. Why is the first step necessary? Is it possible to reduce an NP-hard problem to an NP-complete problem in polynomial time? Because that would be the only instance in which t...
I am working on proving something by using Lambda Calculus and Beta Reductions, and I was following along a tutorial on another problem and attempted to carry over the knowledge onto a different problem and I am a little confused on the last step. The problem is to prove $\textbf{or true false}$. Here are my steps: (if...
So right off the bat, this is in fact a homework question. I've been banging my head on this problem for hours. From my naive understanding of inversions, I feel that this is not possible. Considering for $n=1$ elements, there are no inversions, it already seems like this won't work, but maybe it's just for $n > 1$, so...
A naive approach to checking if $n$ is prime is: Prime(n): for i=2, 3, ..., sqrt(n): if i divides n then return "composite" return "prime!" I remember something about how measuring the complexity of this algorithm must be done in terms of the number of bits in $n$. In that case, I think that we also ca...
I understand that the Backus-Naur Form is utilized to assess and specify type 2 grammar, but is it in itself a form of type 2 grammar?
optimal lifted alignment - is a dynamic programming algorithm. Its input is a tree $T$ with $k$ strings assigned to its leaf nodes (their length is $n$). The algorithm then assigns strings to the internal nodes s.t. the sum of distance (global alignment distance) on all the edges would be minimal, under the constraint...
Let we have oracle machine. Oracle get boolean formula and answer OK if this formula is feasible. How to explain that we can find satisfying assignment for any formula for polynomial time. I have аn idea, but I'm not sure it is right. Let we have formula $~f: \{0, 1\}^n \to \{0, 1\}$ with $n$ parameter and oracle $\The...
I do not understand the difference between page table and inverted page table. I know that both are used to translate the logical addresses into physical addresses produced by the processes necessary to store data in memory. This is what I know on the page table. Generally each page table contains an element for each v...
Following what is stated in the question Why is greedy algorithm not finding maximum independent set of a graph?, I have the following question: Even enumerating and testing all possible choices of the greedy algorithm (namely, when there are two possible choices, test both) and verifying which returns the highest valu...
What is a good metric to pick the degree of a B-Tree? I assume this depends on the number of expected elements? Degree 2 gives us a 2-3-4 tree (each node contains 1-3 items and 2-4 children). How can I decide this? I am looking to store a couple of thousand keys in it.
I know that a language that is input into a DFA (call it $X$) is regular just by being accepted by it, but given that it is accepted, how can one figure out that $L = Σ^*$? In other words, what does a DFA that accepts anything from $Σ^*$ even look like? When I learnt about DFAs, it was always under the context that $L(...
Let's start with a problem statement: given an array of length $n$ with numbers $1$ through $n$ (inclusive), consider the following steps: Select a random number $k$ in range $[1, n]$. Set $a[k] = q$. If there exists element $p$ in $a$ such that $p \ne q$, go to step 1, otherwise end. So, basically we are going to ...
I've been struggling to find the grammar to generate the language $$L = \{a^{2n}b^n : n \text{ is natural}\} \cup \{a^mb^{2m} : m \text{ is natural}\}.$$ I've considered $$S \to aS|Sb|ab,$$ which works in some cases, but not all (we can derive $a^{k}b$ for example). What considerations am I not taking into account? Th...
Would saying "Call the printf function" be the same as "Call the printf method"?
Show that NP is closed under concatenation. This is a homework problem and I would appreciate some guidance. I began by saying the following: Let $A$ and $B$ exist in NP. Let $V_1$ and $V_2$ be verifiers for $A$ and $B$, respectively. Is it as simple as saying build two NTMs $M_1$ and $M_2$ that decide $A$ and $B$ ...
How do I go about proving this? Prove that every undirected connected graph with $|V | > 2$ has at least two vertices such that if one or both are removed (along with their incident edges) the resulting graph is still connected, and describe an efficient algorithm to find two such vertices.
Let $L$ be the language $\{\langle M \rangle : M\text{ is a DFA that accepts only odd-length strings}\}$. Prove that $L$ is decidable. How wrong is my answer? Create a TM $T$ that decides $L$: Create an equivalent input string $v$ that is in the language $L(M)$. Give encoding to $T = \langle M, v \rangle$. TM $T$ ...
This question is both general in nature and also specific to computer vision. If this is the wrong forum, apologies in advance and suggestions on where to post would be much appreciated. After a certain point, do the benefits of more data plateau for machine learning algorithms? For instance, let's say the goal is obje...
I had this question on a previous homework assignment and was unable to answer it. I've done some research and am not really able to find anything that clears this up for me. Would appreciate any help or explanation. Q2. Consider a direct-mapping cache of 128 lines and a main memory block size of 8 bytes. What cache li...
In order to prove that the following language is regular, would I use a pumping lemma? The set $A$ of all strings that are substrings of some string in $L$, where $L \subseteq\Sigma^*$. $L$ Must be regular.
Consider a binary classification problem. In the Pittsburg approach each member of the population represents a set of rules. Each rule encodes information regarding the data features (that is, the conditions of the if rule) and information about the class (that is, the conclusion or then part in the if rule). Then in p...
Bar codes act just like any other device that contains data that you can read from. Can bar codes thus be considered a type of computer memory? I believe the principle is quite similar to the optical discs like CDs or DVDs. They work just like an SD memory card but instead of a card reader we use barcode scanner to rea...
How does one pick an optimal block size for a cache with a specific size limit? For example, if I have a size limit of 900 bits for the whole cache, including tags and validity bits and everything, how do I choose the best block size to maximize utilized space? I assume it's different for directly-mapped caches vs. set...
Automata Theory is a subject where we mathematically model a computing device and study the theory behind it. Here we group the computing devices based on the number of languages they can accept. Based on that we say : Finite Automata's Power < Push Down Automata's Power < Linear Bounded Automata's Power < Turing Machi...
I have a queue with 50 ints in it, and I have 3 threads that want to race at the queue to print the values in it, with a 2 second delay before trying to get the next int. The queue is not thread safe, and the semaphore protecting is is decoupled from the number of items inside the queue(the number of items in the queue...
I agree that a Turing Machine can do "all possible mathematical problems". But that is because it is just a machine representation of an algorithm: first do this, then do that, finally output that. I mean anything that is solvable can be represented by an algorithm (because that is precisely the definition of 'solvabl...
Given $m$ shortest paths between any two vertices of a graph. Determining whether we can pick $k$ shortest paths such that their union covers all edges. I am trying to reduce set cover problem to it. For a set cover problem we can convert its elements into edges and the set represent a path from the first element to th...
Given a set of $n$ distinct numbers, we would like to determine the smallest $3$ numbers in this set using comparisons. The elements can be determined using $n+O(\log n)$ comparisons. This was the answer given in a multiple choice question. Now, we can easily do this using $3n\in O(n)$ comparisons. However I have been...
I was reading this that details a polynomial reduction from $SAT$ to $3SAT$. In case $k = 1$ or $k = 2$, why don't we just replace those clauses with $C_i' = \{{z_1, y_{i, 1}, y_{i, 2}}\}$ and $C_i' = \{{z_1, z_2, y_{i, 1}}\}$ respectively? Instead, it suggested to replace them by $C_i' = \{(z_1, y_{i, 1}, y_{i, 2}), ...
I observed that with rewrite rules: $abb \rightarrow bab $ $baa \rightarrow aba $ Every derivation ends, moreover, if there is same amount of $a$'s and $b$'s in input, then derivation ends in $(ab)^*+(ba)^*$. Why do these two properties hold?
When reasoning with NP-completeness, I find SAT and k-clique more convenient to reason with than generalized games that are NP-complete or the Turing machine model. I'm looking for something similar for EXPTIME-completeness. Wikipedia mentions: Another set of important EXPTIME-complete problems relates to succinct c...
I read about Multiversion Concurrency Control in Wikipedia. They say that every piece of data in DB has a Read Time Stamp (RTS) and If transaction Ti wants to Write to object P, and there is also another transaction Tk happening to the same object, the Read Timestamp RTS(Ti) must precede the Read Timestamp RTS(Tk), i....
I have a directed graph, eg: $$A\to B\to C$$ $A$ and $C$ may have multiple in- and out-edges, but B has exactly one in- and one out-edge. I want to remove node $B$ and replace the edges $(A,B)$ and $(B,C)$ with a single edge $(A,C)$. Is there a name for this operation? In particular a name or algorithm for finding all...
This question might sound stupid but, can the language of a TM be not recursively enumerable ? Thank you ~
I need to determine whether the following problem $X$ is in coNP: Given a graph $ G=(V,E) $ and a positive integer $s\leq|V| $, is there an independent set that is the largest for $G$ of size at least $s$? My solution for this was that in fact the above problem is in coNP because we can provide an NP solution for $\o...
How can the EQP quantum complexity class exist? I mean, doesn't the superposition principle imply it is not possible to know with probability 1 whether a quantum algorithm will return a solution? For if a quantum computer’s state is in superposition, quantum measurement implies the state we obtain when we read the comp...
I was just thinking about image processing neural networks and how to effectively train them in regard of the available dataset. Let's say you'd want to build a neural network which can distinguish between pictures showing a cat or a dog. I do not have much experience in the field, but I think it would take a pretty bi...
Suppose there are two functions: $ f : X \rightarrow Y $ and $g : Y \rightarrow Z$ Both $g$ and $f$ can be implemented as algorithms that yield the correct result in a finite amount of time. It appears to be obvious, that there is also a correct and terminating algorithm that computes the composition of the two $g \ci...
The linear programming problem: find a strongly-polynomial time algorithm which for given matrix A ∈ Rm×n and b ∈ Rm decides whether there exists x ∈ Rn with Ax ≥ b. I know that Steve Smale's lists some of the unsolved problems in mathematics. But such a linear programming problem is it until now not-solvable ?
I am trying to either solve or find a tight bound $\Theta$ for the following recurrence relation: $$T(n) = x + T(n-\log_2 n)\,.$$ For some nonzero constant $x$ (we can suppose it to be 1, for simplicity). Thus far, I have been able to prove the following: \begin{align*} T(n) &\in O(n)\\ T(n) &\notin \Omega(n)\\ T(n) &\...
Suppose you have data of the form input a matrix A, and output a matrix B, where each row of each is one datapoint. Should you create multiple neural networks, one for each column of B, or one NN with multiple output neurons, one for each column of B?
I am breaking my head over this. Let the alphabet $A$ be given by $A = \{a,b,c\}$ and let $$L = \{ww^R \mid w \in A^* \}.$$ Prove that the language $L$ is not regular without using the pumping lemma, but using: The fact that $\{a^nb^n \in A^* \mid n \geq 0 \}$ is not regular. The fact that $\{w \in A^* \mid w \text{...
This question is about the correctness proof of Dijkstra's algorithm in the third edition of Introduction to Algorithms by Cormen et al. (pages 660–661). The proof makes a case that considering path $p$ is the shortest path that connects a vertex in set $S$ (set of vertices where the distance of nodes to node $s$, the ...
I know the grammar for the language $\{ xy : |x| = |y|, x ≠ y \}$ if $\Sigma=\{a,b\}$: $$ \begin{align*} &S→AB∣BA \\ &A→a∣aAa∣aAb∣bAa∣bAb \\ &B→b∣aBa∣aBb∣bBa∣bBb \end{align*} $$ I know this is a grammar, but I need a PDA for this language, and intuition how $\{xy: |x|=|y|,x \neq y\}$ is a CFL while $\{xy: |x|=|y|,x...
Assume we have two LTSs, say DFA with labels over the transitions (though the question can be generalized to more sophisticated automatons), define the input to each system to be as usual just the input word, and define the output of each system to be the sequence of labels of visited transitions. Now assume that the t...