instruction stringlengths 35 29.1k |
|---|
I have built a heuristic algorithm for approximately solving an NP complete graph problem by recursive linear relaxations. In each recursion, the algorithm returns a reduced graph, with number of nodes $N_{k+1} \leq 0.5N_{k}$.
I think this means that the overall complexity should be order $\log N \times T(N)$ where $T(... |
This seems like a simple problem but I'm getting the impression I'm missing something.
The problem
Given the values $v_1, v_2, \ldots, v_n$ such that $DFT_n(P(x)) = (v_1, v_2, \ldots, v_n) $ for $ P(x) = \sum\limits_{i=0}^k a_ix^i$ , $k < n$ - find $ DFT_{2n}(P(x^2)) $
My attempt:
First expand $P(x^2) $ :
$$P(x^2) = a... |
So the Euclidean TSP decision problem is NP-complete (see http://dx.doi.org/10.1016/0304-3975(77)90012-3 ) so the TSP optimization problem should be NP-hard.
On the other hand there is a PTAS for the Euclidean TSP (see http://dx.doi.org/10.1145/290179.290180 ).
Wikipedia says that a PTAS is not possible for strongly N... |
I'm trying to understand the pumping lemma for regular languages and would like to prove that $L=\lbrace{ab^{n}ba^{n}|n\geq1}\rbrace$ is not regular.
My suggestion is as follows:
Assuming $L\in{}REG$, let $p$ be the number that exists for $L$ according to the pumping lemma.
Let $w=ab^{p}ba^{p}$ with $|w|=2p+2>p$.
Since... |
In 2PL (two phase locking), what advantage(s) does the rigorous model have over the strict model?
I) There is no advantage over the strict model.
II) In contrast to the strict model, it guarantees that starvation
cannot occur.
III) In contrast to the strict model, it guarantees that deadlock
cannot occur.
IV) I... |
I am looking for some advice and direction on solving the weighted interval scheduling problem with $m$-machines to plan some experimental "wet lab" procedures.
The problem is very similar to the standard weighted interval scheduling problem described but with the important difference that more than 1 'machine' can be ... |
The list of finite languages over a finite alphabet is countable.
I could prove it by saying that the list of languages of size 1 is countable, the language of size 2 is countable, and so on. Then I can prove that the infinite union of countable set is countable.
However, I am sure that there is a simpler proof. Can so... |
I want to implement following algorithm on Turing machine:
rewrite binary numbers to their unary counterparts. For example: 101
will be rewritten to a string of 5 consecutive bars
(wikipedia)
But I don't know how to make the replacement "|0" -> "0||" because it requires 3 cells. Basically I want to insert addition... |
Is there an algorithm to test whether the decomposition of relation $R$ into relations $R_1,\dots,R_n$ is dependency-preserving?
In more detail, I am given a relation $R(x_1,\dots,x_m)$ on $m$ variables. I am given a decomposition of $R$ into relations $R_1,\dots,R_n$, where each relation $R_i$ refers to a subset of t... |
I have a finite automaton with no final/accepting states, so F is empty.
How do I minimize it?
I got this on a test and I didn't know how to approach the problem because the automaton had no accepting states.
Is a single initial state with all the transitions into itself the correct answer?
|
My textbook says a "complete binary tree" is a "full binary tree" where every root is at the same level.
My conceptual understanding:
All this time, I was led by my textbook to believe a root is the "top-most vertex" in which all the other vertex are led away from it. So basically I am led to believe there can be only... |
I would like to implement short circuit evaluation logic in my code. And I want to know about the full details how it works?
Ex:
function a() {return true;}
function b() {return false;}
function c() {return true;}
Expression
Case 1) a() && b() && c();
Case 2) a() || b() && c();
Case 3) a() && c() || b();
Case 1:
b() wi... |
Is it $\mathsf{NP}$ complete to decide whether a graph $G$ has bigger clique $\omega(G)$ or bigger independence number $\alpha(G)$?
|
Setting
Exactly as the title stated:
Give an example of an $\mathsf{NL}$-complete context free language. $\newcommand{\angle}[1]{\langle #1 \rangle}$
Current Solution
Recall in the past we proved that $E_{DFA}$ is regular, so it is also context free. $E_{DFA}$ is in $\mathsf{NL}$ since given DFA $\mathcal M$ over $n... |
Given a graph G= (V, E) that is:
directed,
acyclic,
non-weighted,
may have more than one edge between two vertices (thus, source and destination are not enough to determine an edge).
And given a set of vertices, let's call them vSet; that contains a vertex vRoot; I need to find ALL paths pSet between vSet elements... |
For measuring the complexity of an algorithm, is it time complexity, or computational complexity? What is the difference between them?
I used to calculate the maximum (worst) count of basic (most costing) operation in the algorithm.
|
For the purpose of implementing an optimization algorithm (finding the minimum of a multivariate function) I want to create a data structure that supports the following operations:
load from array
Peek at maximum element (but don't destroy it)
Peek at next-to-maximum element
Peek at minimum element
decrease the maximu... |
I'm using Q-Learning to find the values of states in on a gameboard. For example, something like:
-----------------
| | | | 1 |
-----------------
| | W | | -1|
-----------------
| | W | | |
-----------------
| S | | | 1 |
-----------------
I have the transition, and I can calculate the values of th... |
In an out-of-order processor, what is the difference between a reorder buffer and an instruction window?
Wikipedia says:
"In particular, in a conventional design, the instruction window consists of all instructions which are in the Reorder Buffer (ROB)."
Does this mean that the instruction window isn't a seperate h... |
Consider the language below, on the alphabet $\Sigma = \{a,b,\$\}$:
$$L = \left\{ x$y \mid x,y\in\{a,b\}^* \land \left|x\right| \ne \left|y\right| \right\}$$
I need to define a CFG for this language. I've tried couple of CFGs but they all failed in one way or another.
I'd be glad for help.
|
$$L=\{0^m1^n \enspace | \enspace m \neq n\}$$
I saw that this exact question exists elsewhere, but I couldn't understand what was being said there. My question does not mandate the use of the Pumping Lemma as stated "elsewhere", but I am using the Pumping Lemma anyway. I want to present what I have so far, and for some... |
I tried to solve the following exercise :
What is the order of growth of the worst case running time of the following code fragment
as a function of N?
int sum = 0;
for (int i = 1; i <= N; i++)
for (int j = 1; j <= i*i; j++)
for (int k = 1; k <= j*j; k++)
sum++;
and I found that the complexity ... |
In my lecture notes, the definition of the class NP is given as:
A language $L$ is in the class NP, if there exists a turing machine $M$ and polynomials $T$ and $p$ such that:
For every input $x$, $M$ terminates after at most $T(|x|)$ steps
If $x\in L$, then there is a "proof"(or certificate) $t\in\{0,1\}^{p(|x|)}$ su... |
I am thinking of the equality "PCP(O(log(n)),0) = P"
Say I have a deterministic polynomial time algorithm $A$ whose correctness I can't prove immediately. But say I create a probabilistic version of this algorithm say $A_P$ such that it uses log(n) random bits. Now if I prove somekind of (exactly what ?) expectation c... |
That's my question, since it has two symbols but go to a single state, is DFA or NFA?
|
I've written a library which stores numbers as an array of nibbles. You set the digits and decimal places at compile time.
I've written all basic math +-*/% but I'm not sure how to do exponentiation ($a^b$). Raising a decimal to an integer power is a piece of cake, but how do you do, e.g., $4.6345^{3.1425}$ from first... |
I have written a math library which handles really big numbers with good precision. Each digit is stored in a nibble and a 'nibble array' makes up the number. There is no epsilon portion, as for currency calculation big brother is happy enough to loose penny fractions with int like rounding.
My problem is $a^b$ . It's... |
What's the difference between them - Physically based simulation, Physically based animation, Physical simulation for computer animation, Physically based animation for Computer graphics, Physically based modelling for interactive simulation and games and Cognitive modelling ?
|
LW R2, 0(R1)
CMP R3, R2
CMP R7, R5
the LW instruction stalls the first CMP so the second one will execute first. Wouldn't this cause the flags register to contain the wrong value since it expects the second CMP to be the last one that updates the flags register?
I'm not sure about this one: does an ADD instruction ALW... |
Suppose we have digraph G, set of its vertices W and two (possibly equal) vertices s and f. I'm looking for an algorithm which will solve the following problem: whether there is path from s to f passing through all vertices from W; if yes, return any of such paths. By "path" i mean path in the most general sense: repet... |
For an assignment we are asked the following(simplified) :
A function F(a) has a non-negative integer as a result. This result is reused in the function itself. Like this, and where the first a is given:
new_a = (c1 * (previous_a or first_a) + c2) mod c3
Write, in C#, a sufficiently fast and memory efficient algorithm... |
There is that popular problem [1] [2] in the computer science that is finding minimum number of straight lines that covers a given set of points in 2D.
Even though I have scanned many papers, none of them has a clear motivation for the problem.
What is the use of solving this problem? Is there a paper that explains thi... |
Trying to explain a problem, I thought of a variant of Turing
Machines. It is unlikely to be new, but I do not recall ever seing it
before, and I wonder whether it has been used or has a name. The idea
is that the TM uses a "linked list" rather than a tape, so that the
head can splice a new symbol position between two ... |
I have read various explanations why a 1-bit branch predictor is wrong twice per loop, once at the beginning when it wrongly predicts against entering the loop and once at the end when it wrongly predicts against leaving the loop. Makes sense.
What I don't understand is why the 2-bit predictor is better. It seems it ... |
Is it true that
$\mathsf{P} \neq \mathsf{NP}$ implies $\mathsf{NP} \neq \mathsf{PSPACE}$?
I have here some problem that is in $\mathsf{PSPACE} \setminus \mathsf{NP}$ if $\mathsf{P} \neq \mathsf{NP}$. Since I cannot find a fault in my proof, I wanted to be sure, if the upper implication holds or not.
|
My professor doesn't always know what's actually correct or wrong - he always has to think about it for a very long time and get back to the book and read the book for a long time to answer any of our questions.
He says that
I tell you that an algorithm runs in $O(2^n)$ but yet is in $\mathsf{P}$. How can this be?
Ans... |
Suppose a router X is dropping packets. Another router A will investigate whether X is dropping packets due to congestion. What are the procedures that A should follow?
A already knows X's buffer capacity. Please explain the procedures and assume an arbitrary threshold T (if needed).
|
I'm working on a project where I want to to search for vectors in the form (x1, x2, x3,...xn), and be able to search for them by specifying a specific x value and getting all vectors with that x value for that dimension. The value n, the number of dimensions, will be 4 or 5 in most cases.
For example, if I have a vect... |
I am trying to show the data abstraction for a double ended queue along with the axioms. A double ended queue is a queue where items can be added to and remove from either end of the queue. I have already got the abstraction and axioms for a normal queue but looking at it, it looks to me like it would also work for a ... |
Given boolean function $f$, let $F$ denote the unique multiaffine real polynomial representing $f$.
Sensitivity of $f$ at input $x$ is $$S_x(f) = |\{i:f(x)\neq f(x^i)\}|$$ where $x^i=x\oplus\Bbb 1_i$ where $\oplus$ is $XOR$ operation.
Sensitivity of $f$ is $$S(f)=\max_xS_x(f)$$
Is there an easy proof to show $S(f)\leq ... |
Is the language $ L = \{a^n ~| ~n \text{ has even number of digits in 10-base system}\} $ regular?
My approach: let the $ p $ be from the Pumping Lemma. Chose the smallest $ n $ which has even number of digits in 10-base system, but bigger or equal to $ p $, that is $ n = 10^{2m - 1} $ for appropriate $ m $.
According... |
Critical sections limit performance by constraining parallel execution and adding overhead. What features should a critical section have for improving performance?
|
I am writing a greedy algorithm for a variation of the interval scheduling problem that I haven't seen before.
I have a set of jobs, each with start and finish time. All jobs in set must be assigned to a worker, workers cannot have overlapping jobs. My greedy algorithm should minimise workers - use the least number of ... |
I understand what a multilayer neural network is, but what about them allows them to solve non-linear problems unlike perceptrons? Is it the fact that they can extend to any number of outputs/hidden layers? Or is it another feature?
|
It is definitely possible to write a program that takes another program as an input and changes it syntactically, but does not alter the meaning.
But is it possible to write a general program $alter$ that alters the output of a given program $P$ for some input, i.e. $\exists x: P(x) \neq alter(P)(x)$? Edit: Let's add t... |
Suppose $P \neq NP$. Does it imply that there exists some superpolynomial time bound, such that any $NP$-complete problem, like SAT, can be used to simulate an arbitrary deterministc Turing Machine working in that time bound?
Rephrasing does $P \neq NP$ imply that there exists some class $D$ of languages solvable by a ... |
For measuring the complexity of an algorithm, is it time complexity, or computational complexity? What is the difference between them?
I used to calculate the maximum (worst) count of basic (most costing) operation in the algorithm.
|
Its known that a polynomial time approximation algorithm that satisfies 3MaxSAT in 7/8+e clauses implies P=NP.
Its also experimentally known that 3SAT has the most difficult known cases when the clause to literal ratio is approximately 4.2.
Q1. Is there a similar result for 3MaxSAT where the approximation algorithm ... |
When implementing TSP GA I decided for adjacency representation (i.e. $j$ value in $i$-th index means that node $j$ goes right after node $i$), as it enables interesting heuristical crossover operation (see Greffenstette, 1985). However this source, like many others, is silent about a sensible option of mutating soluti... |
I see this theorem whose proof is not clear to me :
"Let $L \subseteq \{0,1\}^*$ be a language and suppose that there exists a polynomial time PTM M such that for every $x \in \{0,1\}^*$ and $Pr[ M(x) = L(x) ] \geq 1/2 + \vert x \vert ^{-c}$ Then for every constant $d >0$ there exists a polynomial-time PTM M' such th... |
What does "in positive position" and "in negative position" mean in the context of type theory?
The only thing I understood from Bob Harper's blog post on the topic is that there is a connection between polarity in this sense in type theory and polarity in logic, but I don't know what that connection is.
|
I'm wanting to dabble with metaheuristics and am interested to know what the "hello world" problem sets are.
In other words, what are the common problems (e.g Traveling Salesman, Vehicle Routing Problem, Maze Solving) to test various algorithms against in order to compare algorithm design?
|
I'm working on graph generation, trying to implement the RT-nested-Smallworld network model described in this paper.
We are talking about generating an undirected graph in a slightly different way than what the Watts-Strogatz model does.
One of the very first steps of the algorithm is
instead of selecting links to con... |
Set cover is NP-complete given an arbitrary set $U$, a set $S$ of subsets of $U$, and an integer $k$. However, what if $k$ is always a constant 3? Is that problem still NP-complete?
|
By this I mean a permutation of the $n$ input items to be sorted such that the number of comparisons taken to produce the correct order is maximal over all of the possible permutations of $n$ items.
Is there a pattern like all input ascending is worst case, or even some class of input permutations that have been proved... |
I am taking DBMS classes and am currently studying the various normal forms. The following is the definition of a Prime Attribute I learned in class:
A prime attribute belongs to the set of attributes which compose the candidate keys.
For example, if R(ABCDEF) is a relation with the functional dependencies given as:
F... |
http://www.algorithmist.com/index.php/UVa_10918
The above link is a solution to UVa 10918 Problem. The problem is based on Dynamic Programming. I am not able to understand this approach to the problem. I have coded the solution but the approach is completely different. I want to understand the given approach. The probl... |
Given $n$ points $(x_1, y_1), \ldots, (x_n, y_n)$ on a 2-dimensional plane.
A point $(x_1, y_1)$ dominates $(x_2, y_2)$ if $x_1 > x_2 \land y_1 > y_2$.
A point is called a maxima if no other points dominate it.
I can come up with an $O(n \log n)$ algorithm to find all the maxima. However, I failed to solve:
Prob... |
I recently created a parallel implementation of the Merge Sort, in which the sorting of several groups was accomplished by different processes, and was wondering if this was theoretically possible on Turing Machine?
|
I've been trying to convert a regular expression to a non-deterministic finite automata (NFA) first using Thompson's construction, giving:
, which looks correct.
I am then using subset construction to create the DFA from the NFA, shown here.
But this does not look correct to me, as for example 0 followed by 0 is not ... |
I know from several sources that they are equivalent, but couldn't find a reasonable explanation. My first approach was to show their equivalence by using the logical consequence rule and both axioms, but I couldn't figure out a reasonable solution.
Here is the exact problem definition:
Anybody can give me a hint how ... |
On the Lambda Calculus, there are several different ways to represent a list. For example, one can encode it as its right fold:
list = (λ (cons nil) (cons 1 (cons 2 (cons 3 nil))))
One can, instead, use pair, false, fst and snd as aliases to cons, nil, head and tail. This way, you will have this:
list = (λ (a) (a 1 (λ... |
count=0
x=7
y=3
while(y<x):
y+=1
count+=1
I'm having trouble writing this as a single expression.
|
Let $P$ be a given polygon in $\mathbb{R}^{2}$ such that all the vertices lie on integral points $\mathbb{Z}^{2}$. An integral polygonal sub-divison of $P$ is a subdivison of $P$ into integral sub-polygons. I would like to know:
If there is an algorithm to generate all such sub-divisons? I would prefer an easier to i... |
So I've been stuck trying to figure this problem out for a while. I've looked on wikis and all over stack exchange but I'm really stumped. This isn't my best subject, so any sort of explanation would be AMAZING.
The Double CNF SAT problem is given a Boolean formula in CNF determine if it
is satisfiable with every claus... |
I am wondering if deciding the decidability of problem is a decidable problem. I am guessing not, but after initial searches I cannot find any literature on this problem.
|
For generating certain hard puzzles, I am trying to model a problem (ultimately) in SAT. I don't know how to do that, so I am starting with CSP because it's more expressive. In CSP, there is a global alldiff constraint, which requires all variables to take on different values from their domains. I have a set of alldiff... |
I have the following assignment:
Prove that $\sum^n_{i=1} i2^i \in \Theta(n2^n)$
My current approach thus far is the following:
Since we need to prove $k_1 \cdot n2^n \le \sum^n_{i=1} i2^i \le k_2 n2^n$ I chose $k_1 = 1$ and $k_2 = 2$. This holds true to my condition. However I'm unsure whether I can just freely deci... |
I'm looking for a regexp matching strategy that supports conjunction and which is based on an NFA-style machine. I know how to handle conjunctions using a DFA, or using Brzozowski's approach, but for various reasons, I can't use Brzozowski's technique and bump into state explosion when using a DFA.
I know about the cr... |
What is the difference between system bus, address bus and data bus?
Are they different wires or they are using same wires but logically different?
|
We all know how to find the shortest path between two vertices, but what if I just want to know the answer to this question - is there a path, (any path), between vertex A and B of length larger than some X?
Should start from the shortest path, and then merge adjacent nodes if its length is less than X? (or extend the ... |
Consider the following adjacency matrix:
0 1 1 0 0 0 0 0 0 0
0 1 1 0 0 1 0 0 0 0
0 0 0 1 1 0 0 0 0 0
1 0 0 1 1 0 0 0 0 0
0 0 0 0 1 1 1 0 1 0
1 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 1 1 1 0
0 0 0 0 0 0 0 1 0 1
0 0 0 0 0 0 0 1 0 1
0 0 0 1 0 0 0 0 0 1
I need to find the number of paths (repeated vertices are allowed) f... |
In a cache with byte addressing, the byte you want to load is selected using the block offset. But what if I execute a LW instruction and don't want a single byte but a full 32 bit word?
Is there some logic that selects whether you don't look at the block offset and just load the whole word (when you use a "load wor... |
I have the following equation
if (x > y) {
if (y < a) {
x:= a
y:= b
} else {
x:= b;
}
}
I was thinking of something like this however I've never done it with actual functions so I'm not quite sure how to proceed.
What are the steps to take in creating a parse tree for something like this?
|
I'm trying to train a neural network using this sort of data (for a homework):
Number of Features : 42,
Target data : 0 or 1,
Number of Samples : 111 Individuals ( 69 Cases + 42 Controls )
However i'm facing an over-learning issue (the learning curve approaches the goal set, however the validation curve shows no improv... |
The problem
Some people are crossing a bridge. Each one takes a different time to pass.
Assume the people are sorted by their passing time increasingly.
These are the conditions of crossing the bridge:
only 1 or 2 people can cross the bridge at the same time in the same direction;
the speed of the two people crossing... |
I have a very simple question.
What is the right standard convention to use for declaring arrays?
I understand that for a simple declaration of a variable as an integer, this is the convention:
DECLARE myVar : INTEGER
What about for an integer array of 10 elements?
DECLARE myVar : ARRAY[1,10] of INT
or
DECLARE myVar... |
I am currently enrolled in a computer organization and design class, which I am struggling mightily with, and I have a final homework in my class that I need to get a perfect score on. The question I have having issues with is:
A program has a parallel section that represents 80% of its execution time when run on one ... |
I am currently enrolled in a computer organization and design class, which I am struggling mightily with, and I have a final homework in my class that I need to get a perfect score on. One of the questions covers cache hit-misses, and the lecture we had on the subject was relatively brief. The question I have having is... |
I've implemented two red-black trees (using the pseudo-code in CLRS) with slightly different flavors:
1) In the first tree, all the data is stored in the leaves.
2) In the second tree, the data is stored in the internal nodes.
In an application I have, I have many insertions and deletions. The performance of the first... |
A BBP algorithm is a formula with the following form where $b \in \mathbb Z$, $b \ge 2$, and $p(k)$ and $q(k)$ are polynomials in $k$
$$\sum_{k=0}^{\infty}\frac{1}{b^k}\frac{p(k)}{q(k)}$$
There are known BBP formulas for many computable numbers and it is easy to prove that any number with a BBP formula is computable.
O... |
Assume you have an infinite language $L$ over alphabet $\Sigma=\{a,b\}$
For example, $L=\{ax \mid x \in \Sigma^*\}$
Can a Turing Machine, $M$ decide this language?
(Generalizing, are all the recursive languages finite?)
In my opinion, it can, since I can enumerate all the strings and say if they are in the language or ... |
I have simple undirected graph. I want to determine a size of minimum vertex cover, a size of maximal independent set and a size of a global minimum cut.
A minimum vertex cover is complementary to a maximum independent set. So, I can find one of this this and get both of them.
Is there any relation with global minimum... |
I'm reading through William Stalling's operating system intrnals and design principles book. Talking about interrupts, it gives the following examples when comparing the speed of a processor and a hard disk:
To give a specific example, consider a PC that operates at 1 GHz, which would
allow roughly 10^9 instructions... |
This is a question from Introduction to Algorithms by CLRS (Exercise 9-1-1).
The approach I thought of is
compare the first two numbers, assign the lower number min and the bigger one to next_min
loop through numbers 3 - n,
if the number is lower than min, set min to that number.
else if the number if lower than next... |
I've been trying to wrap my head around Co-NP, and how it's different to NP, but I am having some trouble.
Co-NP is defined by Wikipedia as this: "A decision problem $\mathcal{X}$ is a member of co-NP if and only if its complement $\overline{\mathcal{X}}$ is in the complexity class NP."
When it was explained to me in c... |
I am trying to redesign my algorithm to run on Hadoop/MapReduce paradigm. I was wondering if there is any holistic approach for measuring time complexity for algorithms on Big Data platforms.
As a simple example, taking average of n (= 1 billion) numbers can be done on O(n) + C (assuming division to be constant time o... |
There is a lot of explanation about big O, but I'm really confused about this part.
Acoording to the definition of Big-O, in this function
$$f (n) \le c g(n), \quad \text{for } n \ge n_0$$
$f (n)$ is $O(g(n))$.
But a description of a function in terms of big O notation usually only provides an upper bound on the g... |
An example given for a relation R where its negation and itself are not semi-decidable was:
$R(x,y)$ holds iff $y = 0$ then $R_{HALT}(x)$ holds, otherwise $y = 1$ and $R_{HALT}(x)$ does not hold.
It's stated with the assumption that the proof is trivial (which for most it probably is), but I am struggling to see why it... |
Curry-Howard correspondence states the equivalence between logic/deduction and types/programs.
The Church-Turing thesis states the equivalence of some models of computation. Specifically, all computable functions can be written both on a Turing Machine and in Lambda Calculus.
Not all logics are equivalent however. 2nd ... |
What do you call an algorithm which is
Deterministic
When an answer is returned, it is correct
For some input, the algorithm returns no answer (fails, in bounded time).
Such algorithms crop up a lot in cryptographic attacks, for instance, where a
cipher is deemed broken when an attack (provably or demonstrably) works... |
In "Rational Set of Commutative Monoid", S. Eilenberg and M.P. Schützenberger define the class of rational subsets of a monoid $M$ as the least class $F$ of subsets of $M$ such that satisfy the following properties:
the empty set is in $F$;
Each single element set is in $F$;
If $X, Y$ are in $F$, then $X \cup Y$ is i... |
I know that:
Binary leaf trees are free magmas.
Non-empty lists are free semigroups.
Lists are free monoids.
The generalized algebraic datatype data FM a where {Return::a->FM a; Bind::FM b -> (b->FM a) -> FM a} is a free monad.
I know also that various abstract datatypes also correspond to free structures—bags are fr... |
How should I go about building a Turing machine for the following language:
$$L = \{ a^ib^j \in (a,b)^* \mid i \le j \le 2i \} $$
I know how to construct a Turing machine for $\{ a^nb^nc^n \mid n \in \mathbb N \}$ but don't really where to start for the one above.
|
Create a pushdown transducer that translates $a^m b^{2m}c^{m+n}$ into $b^{n-m}$, with $n\geq m \geq 0$.
How should I use the stack to remember or to compute how many characters of c to read? And how can I output $b^{n-m}$?
I have also tried to simplify the problem and firstly create a pushdown automata for $a^m b^{2m}c... |
Using pumping lemma, how can I prove that $L=\{a^n b^m c^k \mid n = m \vee m\neq k\}$ is not regular?.
If I choose $w= a^m b^m c^m$ and pump up with $i=2$, if have $a^m=1 b^m c^m$ but the string is still in the language. Any hint?
|
Except for the undecidable unaries I have no idea if there is anything in the gap between $P/poly$ and $P$
|
I was told to built a PDA that recognizes the following language:
$$L = \{x\#y \mid x,y \in \{0,1\}^{\ast} \wedge x \neq y\}$$
My attempt is basically to push $x$ to the stack for every $1$ and $0$ read. And then pop them for the second half. If it finishes and the stack is still not empty, it will be accepted. Or if i... |
Is it better to use comparison or radix sort to sort a long sequences of java int array?
I know that I should probably use mergesort (NlogN) for comparison sort, since it is one of the fastest and compare that to LSD or MSD. I thought about how for extremely large N, the logarithm would be larger than runtime for LSD,... |
When I'm solving a question I usually spent too much time testing whether I should pump or down? Is there any formula to know when to use which?
Also, on proofing non context free grammar we use three pumping lemma, and one that's confused me is $|uvy| \le p$. I mean in the example given in the book I read, it is not... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.