instruction stringlengths 35 29.1k |
|---|
Suppose we have an algebraic specification in the form: $\{S,F,w\}$ where $S$ are the sorts, $F$ are the functions and $w$ are the set of equations.
For example, the specification for natural numbers:
$S = \{\mathrm{int}\}$
$F = \{
0: \mathrm{int}, \;
\mathrm{succ} : \mathrm{int}\rightarrow\mathrm{in... |
This question follows on previous questions (1), (2), where we define an initial space of possibilities and reason about how a solution is chosen from that.
Consider a problem P where we are given:
the initial space of possibilities is exponential in the size of the input,
the search space decreases monotonically as w... |
As a preperation of an exam about algorithms and complexity, I am currently solving old exercises. One concept I have already been struggling with when I encountered it for the first time is the concept of amortised analysis. What is amortised analysis and how to do it? In our lecture notes, it is stated that "amortise... |
Standard busy beaver function draws attention to final count of nonzero symbols on tape. We could instead look at largest amount of nonzero symbols appearing on tape at any point of computation. This function's lower bound would be $\Sigma(n)$ and upper bound would be $S(n)$ (max shifts function). Was there made any re... |
A recent puzzle blog post about finding three evenly spaced ones lead me to a stackoverflow question with a top answer that claims to do it in O(n lg n) time. The interesting part is that the solution involves squaring a polynomial, referencing a paper that describes how to do it in O(n lg n) time.
Now, multiplying pol... |
I try to figure out a redundant power of two-sided error randomized Karp - reduction.
It's well known fact and it is relatively hard to show that BPP is reducible by a one-sided error randomized Karp-reduction to coRP (in case of promise problem).
Without delving into details it make sense that the combination of the o... |
FRP is about streaming events and behaviours through pure functions. The Actor model - at least, as implemented in Akka - is about streaming immutable messages (which can be considered to be discrete events) through potentially impure objects, called actors.
So on the surface they seem related.
What else can we say abo... |
I am tackling the halting problem right now and its remarkable theorem. My book states $\text{HALT}(x,y)$ is true if $\psi^{(1)}_{\mathcal P}$ is defined and conversely $\text{HALT}(x,y)$ is false if $\psi^{(1)}_{\mathcal P}$ is undefined.
The purpose of the theorem, of course, is showing that $\text{HALT}(x,y)$ is a ... |
I'd like your help with the following question:
Assume we proved that $\mbox{BPP}\subseteq \Pi_2$ -What conclusions can you make?
BPP is the class of decision problems solvable by a probabilistic Turing machine in polynomial time, with an error probability of at most 1/3 for all instances,
$\Pi_2$ is the class of al... |
Based on the definition of a multiset and the information in this paper, why do we use multisets in proving the termination of a program?
Is not the well-founded order enough?
|
I'm interested in finding a solution for the following problem:
problem space: any language that has more than 1 article
let's take German language as example. So the articles in German are "der", "die", "das". - every word has an article as prefix and you must use the article. for example you can't say just "Auto"(ca... |
First, I have tried to build a DFA over the alphabet $\sum = \{0,\dots, 9\}$ that accepts all decimal representations of natural numbers divisible by 3, which is quite easy because of the digit sum. For this I choose the states $Q = \mathbb{Z}/3\mathbb{Z}\cup\{q_0\}$ ($q_0$ to avoid the empty word), start state $q_0$, ... |
Anyone knows if there is an algorithm for directly write the context-free grammar that generates a given regular expression?
|
Concerning the Master Theorem. I have found the following equation as the base of analysis:
$\quad T(n) = aT(n/b) + \Theta(n^k)$
but I also found the following:
$\quad T(n) = aT(n/b) + \Theta(n^k\cdot\log_p n)$
where the base $p$ is a real number.
Can anyone explain the second equation? I understand the proof... |
I want to implement mutual exclusion for $n$ processes. Critical section code:
int turn = 0; /* shared control variable */
Pi: /* i is 0 or 1 */
while (turn != i)
; /* busy wait */
CSi;
turn = 1 - i;
This solution from this page but it is only made for two processes.
I tried... |
I need to show that $H_1(x)$ defined as follows is partially computable.
\begin{equation}
H_1(x)=
\begin{cases}
1 \;\;\;\;\;\text{ if } \Phi(x,x) \downarrow \\
\uparrow \;\;\;\;\; \text{ otherwise}
\end{cases}
\end{equation}
The thing is my textbook, that is "Computability, Complexity, and Languages" by Davis, Sigal a... |
If I have a collection of oracle machines, can I decide every language? (I got this question from a former university exam and it sparked my interest).
I thought if my collection has to be countable than I can't decide every language, since there's an uncountable amount of languages.
But if my collection can be of any ... |
I'm wondering if there is a good example for an easy to understand NP-Hard problem that is not NP-Complete and not undecidable?
For example, the halting problem is NP-Hard, not NP-Complete, but is undecidable.
I believe that this means that it is a problem that a solution for can be verified but not in polynomial time.... |
I'm starting my mater's thesis in computer science. I'm interested in computational Origami (algorithms mainly); I've read a little about the subject and I'm worried because I lack some of the knowledge that I think is necessary to do research in that area. But still I'd like to start and want to ask: which is better a... |
The question is: What is the smallest complexity class in which the following problem is contained: Given a graph with $n$ nodes, Is there independent set of size of at least $n-10$?
I have a little difficulty to understand the meaning of being in ${\sf L}$ and examine problems in a correct way for deciding if they ar... |
I know that $\sf BPP[2/3,1/3]= BPP[\alpha,\beta]$ when $\alpha\lt\beta$, but I read something on Wikipedia which got me confused:
In practice, an error probability of $1/3$ might not be acceptable, however, the choice of $1/3$ in the definition is arbitrary. It can be any constant between $0$ and $1/2$ (exclusive) and... |
I am trying to understand the basic ideas of pattern calculus and do not have a lot of time to read through a rather long book. Can someone explain this in simple terms and give an example of how pattern calculus works?
http://bondi.it.uts.edu.au/
http://www.amazon.com/dp/3540891846/?tag=stackoverfl08-20
I don't unders... |
Several years ago I was self learning lisp by a book which I do not remember. As an example there was a recursively defined sequence which was said to be unknown to be finite or not for every input --- to generate a sequence you were required to provide two(?) initial values. At least that is how I remember.
There was ... |
I cannot imagine how cohomology is related to graph theory, actually I read solid definition from wiki, and to be honest, I cannot understand it.
e.g I know what is homotopy (in simple term), group of functions such that I can continuously convert each of them to another one, and I think this is useful for understandi... |
Here's a simple question which made me confused.
Please tell me if my analysis of the problem and my conclusions are correct.
For an optimization problem $\sf Gap-A[a,b] \in L$ for $b>a$. I want to discuss what I can know about $\sf Gap-A[a/2,b/2]$.
$\sf(i)$ Is it correct to say that $\sf Gap-A[a/2,b/2]$ is not in $\s... |
The basic idea is to have one or more symbol that clearly indicate the end. For example:
Non-ambiguous:
$ab^*c$
$(a|b)c$
$ab^+c$
$ab?c$
$a(b|c)$
$c(ab)^*ccc$
$acc^*d$
$abc|bcd$
Ambiguous:
$abc^*$
$abc^+$
$abc?$
$acc^*$ or $ac^*c$
An alternative definition of a non-ambiguous ending would ... |
Going through some knowledge representation tutorials on resolution at the moment, and I came across slide 05.KR, no77.
There it is mentioned that "the procedure is also complete".
I think this completeness can not mean that if a sentence is entailed by KB, then it will be derived by resolution. For example, resolutio... |
I have a CTL* formula: $\mathsf{EF}[p\land \mathsf{AX}[q\ \mathsf{U}\ r]]$ but in my application, I am limited to CTL. To my understanding, this formula is no valid CTL and I wonder whether I can transform it (preserving semantic, of course). The CTL* formula should express "there exists a path on which $p$ holds and f... |
Here is a question from Daniel I. A. Cohen's book Introduction to Computer Theory:
Consider the language:
$\quad \mathrm{PRIME}' = \{ a^n \mid n \text{ is not a prime} \} = \{ \varepsilon, a, aaaa, aaaaaa, aaaaaaaa, \ldots \}$
Prove that $\mathrm{PRIME}'$ is non-regular.
Prove, however, that $\mathrm{PRIME}'$ doe... |
I'm trying to solve exercise 6.5 on page 309 from Richard Crandall's "Prime numbers - A computational perspective". It basically asks for an algorithm to factor integers in randomized polynomial time given an oracle for taking square roots modulo $n$.
I think, the basic idea is the following: Given a composite number $... |
In the Dragon book (Aho, Sethi, Ullmann) there is one exercise I don't get.
Chapter 2, Exercies: 2.1
Given the context-free grammar
$$S \to S S + \mid S S * \mid a$$
Task: Show how the signs aa+a* can be produced from this grammar.
I understand the grammar, $S$ can have the form $S S +$… and so on. But I don't ... |
Let r be the number of rows in a DRAM array, and c be the number of columns.
Apparently, DRAM with organization 16x1 requires least pins when r = c = 4 because fewer address bits are required to represent them, and so does DRAM with organization 16x4. Why are these the same? Doesn't the latter have 4 columns instead of... |
Is it possible to design a Universal Turing Machine in which the simulation time of a given Turing Machine $M$ is bounded by a factor of $\mathcal{O}(\log|\Gamma|+\log|Q|)$ of the original running-time of $M$, where $\Gamma$ and $Q$ are the tape alphabet and states of $M$ respectively?
If so, how can this be done?
|
There is a formula in wikipedia for the general case of josepus problem
Josephus Problem
But there is no reference for it, I don't know where it came from and I need too find out...
Maybe Donald Knuth's Art of Programming?
|
Can someone tell me why almost in every book/website/paper authors use the following:
foreach vertex v in Adjacent(u)
relax(u,v)
when relaxing the edges, instead of:
foreach vertex v in Adjacent(u)
if (v is in Q)
relax(u,v)
This is extremely confusing for someone when learning the algorithm. Is there ... |
Given some undirected, unweighted, connected, and potentially parallel-edged graph $G$, an Euler circuit may be constructed iff every vertex in $G$ has an even degree.
In graphs with two or more vertices of odd degree (there may only be multiples of two), one must "Eulerize" the graph, connecting the odd vertices with ... |
Is there an algorithm to solve following problem?
Given two finite automata $A$ and $B$. Determine whether the language recognized by automaton $A$ is a subset of language recognized by automaton $B$ or otherwise.
|
I have an alphabet $A = \{b,B\}$ and I'm asked to write down the pattern of the regular expression $(\epsilon|bb|b)(B|bb)(b|\epsilon|b)$. What does the question actually want me to do? I'm not sure. Does it want me to give the possible patterns that can be formed with $b$ and $B$? But then surely the question would not... |
Given a directed acyclic graph $D = (V,A)$, a vertex $v \in V$ is a source if its indegree is zero, meaning that it has only outgoing arcs.
Does there exist a linear time algorithm to find a source in a given directed acyclic graph?
Follow-up question: Can one in linear time find all sources?
|
My professor gave this assignment question, where he asks us to compare the expressive ease and the expressive range of Low Level and High Level theoretical programming languages.
While in context, I could understand that "hook" seems to refer to the opposite of an abstraction, I don't understand precisely what it mean... |
I have a multilayer perceptron. It has an input layer with two neurons, a hidden layer with an arbitrary number of neurons, and an output layer with two neurons.
Given that randomboolean and targetboolean are random boolean values, and the network operates as such:
input(randomboolean); //Set the input neurons to refle... |
I am trying to learn some basic benchmarking. I have a loop in my Java program like,
float a=6.5f;
int b=3;
for(long j=0; j<999999999; j++){
var = a*b+(a/b);
}//end of for
My processor takes around 0.431635 second to process this. How would I calculate processor speed in terms of Flops(Float... |
In the CLRS book (http://en.wikipedia.org/wiki/Introduction_to_Algorithms) Chapter 26 (Maximum Flow) page 744 (third edition), there is the following equation -
$$
\sum_{u \in U}e(u) \;=\;
\sum_{u \in U}\;\sum_{v \in U}f(v, u) \;+\;
\sum_{u \in U}\;\sum_{v \in \bar{U}}f(v, u) \;-\;
\sum_{u \in U}\;\sum_{v \in U}f(u, v)... |
I want to implement efficiently "streaming Knapsack" problem in java.
The problem is I have a stream input of integer data coming continuously for example -1, 2, 9, 5, 5, 11, 1 -3,...
The question is to find the first "k" elements in which their sum is "n>0". for example k=3 and n=12,
then the solution is: ...,2,...,5... |
What is an algorithm to calculate the maximum "score" possible in a directed graph, with the constraint that edges with the same value can only be traversed once? For example, in the graph below, given that you can use each of a, b, and c once, the best path is to use a and b to get to 7, and c to get to 2, for a score... |
Supposing we have two grammars which define the same languge: regular one and LALR(1) one.
Both regular and LALR(1) algorithms are O(n) where n is input length.
Regexps are usually preferred for parsing regular languages. Why? Is there a formal proof (or maybe that's obvious) that they are faster?
|
The Graham scan algorithm computes the convex hull of a finite sets of points. It works only in the plane but is also fast (time $O(n \log n)$).
An old exam question asks, why does the algorithm not extend for three dimensional space? I just can't find an answer; it seems to me as if it should work.
Sorting the points... |
l is a matrix of size [1...n, 1...n]
function: rec(i,j)
if (i*j == 0)
return 1
else
if (l[i,j] == 0)
l[i,j] = 1 * rec(i-1,j) + 2 * rec(i,j-1) + 3 * rec(i-1,j-1)
return l[i,j]
end_function
for i=1 to n
for j=1 to n
l[i,j] = 0
rec(n,n)
The nested for's are O(n2). But i have difficulties to... |
I would like to know if there are some topics that could be covered in an undergraduate first-term course about analytic geometry, but related to Computer Science.
I know that, for example, the simple equation for the line can be used for explaining linear regression or other topics in elliptic cryptography (too advanc... |
I'm just learning about Turing Machines, and I'm a bit confused by the difference in formal description between Wikipedia and my textbook.
My textbook says the following:
$$M=\langle Q,\Sigma,\Gamma,\delta,q_{0},q_{accept}, q_{reject} \rangle$$
where:
$Q$ is the set of states,
$\Sigma$ is the input alphabet not contai... |
As we know, using the pumping lemma, we can easily prove the language $L = \{ w w \mid w \in \{a,b\}^* \}$ is not a regular language.
However, the language $L_1 = \{ w_1 w_2 \mid |w_1| = |w_2| \}$ is a regular language. Because we can get the DFA like below,
DFA:
--►((even))------a,b---------►(odd)
▲ ... |
I have been posed with a question whereby a computer truncates numbers to x number of digits. Due to this, if this computer is trying to store a decimal number which has a binary equivalent greater than x, it truncates the remaining digits producing a different binary number. However, this binary number is still an 'ap... |
It's a homework assignment, we were asked to read, understand, and present to our colleagues a short paper/article (suggested 4-6 pages) for our Computability, Decidability or Complexity class.
The articles I was able to find in the past couple days using google scholar a way over what we were taught, plus, 50-100+ pag... |
Given a regular language $L$, then it is easy to prove that there is a constant $N$ such that is $\sigma \in L$, with $\lvert \sigma \rvert \ge N$ there exist strings $\alpha$, $\beta$ and $\gamma$ such that $\lvert \alpha \beta \rvert \le N$ and $\lvert \beta \rvert \ne \epsilon$, and for all $k$ it is $\alpha \beta^k... |
I have been reading on converting first order logic sentences to conjunctive normal form, and then performing resolution.
One of the steps of converting to CNF, is to Standardize variables: rename all variables so that each quantifier has its own unique variable name.
Most general Unifier is the least specialized unifi... |
So as to optimize an application, I must implement data caching: not to recompute some data - those heavy on cpu but that don't change often.
When playing with the idea, I imagined something like the way win32/MFC manages the windows screen i.e.:
While a part is valid, it is not repainted.
When a rectangle or a region... |
Looking at the document Fundamentals of Computing Series, The Stable Marriage Problem.
Theorem 1.2.3 - page 12:
In a man-optimal version of stable matching, each woman has worst
partner that she can have in any stable matching.
Proof:
Suppose not. Let $M_0$ be the man-optimal stable matching, and
suppose there i... |
obviously the "Finding an $n/2$ size clique in a directed/ non directed graph" is not $\sf NL$ but I'd really like to understand where does it fall in terms of the definition of the $\sf NL$ definition.
I have to have an input and witness tapes, both of them can be polynomial and a logarithmic size of work stripe. So w... |
The ideal random permutation algorithm of Fisher and Yates (Algorithm P in Knuth vol.2) for a sequence of $n$ objects requires $n-1$ random numbers.
In some card games one first does a "cut" and then a riffle shuffle. The cutting point is a random value, the subsequent shuffling could be considered as deterministic. T... |
Possible Duplicate:
Show that $\{xy \mid |x| = |y|, x\neq y\}$ is context-free
Can anyone prove that the following is a CFL? or not? why?
$$L=\{w=w_1w_2 \mid len(w_1)=len(w_2) \mbox{ and $w_1$ does not equal $w_2$}\}$$
|
I have some recurrence relationships I use to compute some coefficients of a series. I want to know what the time complexity of computing these is. Suppose I know the coefficients $a_0,...,a_n$, and I want to compute $c_0,...,c_n$ as follows
$ c_{n}=\begin{cases}
e^{b_{0}}, & n=0\\
\frac{1}{n}\sum_{k=1}^{n}kb_{k}c_{n-k... |
Do we need to use BFS or DFS algorithm to find the k shortest loopless paths in a graph between any two nodes?
If so where can it be useful?
|
Given a graph with $n \leq 50 $ vertices. Count all $k$-cliques of this graph, where $k = 1, \ldots , n$.
I need the most efficient algorithm.
|
There are some not-very-commonly considered forms of trinary logic using 3 truth values. Even entire (unusual/rare) ternary computers have been built from it.
Is there some knowledge or reference of how to convert some trinary logic systems into functionally complete boolean circuits/logic?
"Functionally complete" me... |
An assignment questions asks the following:
Consider an array 'var a : array[1..10] of real'. Express the
semantics of this array as a function, defining the domain and
codomain (you might also be able to write the rule). In this
programming language, the subrange '1..10' is viewed as a genuine
type, so we c... |
Just a basic question to ask
Does the write through cache copies the whole block or just the byte which is updated?
I went through the following question
Array A contains 256 elements of 4 bytes each. Its first element is stored at physical address 4096.
Array B contains 512 elements of 4 bytes each. Its first element ... |
If I have production $G_n$
$S \rightarrow A_i b_i \quad$ for $1 \le i \le n$
$A_i \rightarrow a_j A_i \mid a_j\quad$ for $1 \le i$ and $i \ne j$
Prove $G_n$ is sub-productions from $2n^2 - n$
Prove $G_n$ is $LR(0)$ production from $2^n + n^2 + n$
|
SAT [5] can be solved with resolution definitively, i.e. if the formula has a true assignment, resolution can find it, and if it cant be satisfied, resolution can show that no assignment exists (at least in exponential time/space.). [4]
Is there a good fully-self contained description somewhere of solving SAT with re... |
Frankly I'm very uncomfortable with the material right now. There are some things I can understand, but many I still do not.
My first assignment is asking me in one question (which I do know how to do) to give a full description of a TM that accepts a language $L = \{ x \in \{0,1\}^* \mid x \text{ is divisible by } 4 \... |
I was asked to design an algorithm that solves the following problem :
Consider a travel from city A to city B, made of several trips by
train through other cities in between. With an access to the
unordered list of train tickets from which you can read the cities of
departure and arrival of each trip, find A an... |
Let's say we have a fictional operating system in the user mode. Whenever an interrupt or a trap occurs, the os would switch to the Kernel mode jumping to the address determined from the interrupt vector. A malicious user could take advantage of the loophole by executing a malicious program in the kernel mode.
Why is i... |
I have seen a few years back a nice and simple algorithm that, given a (finite) set of words in some alphabet, builds a context-free grammar for a language including these words and in some sense "natural" (e.g., the grammar doesn't produce all words in the alphabet). The algorithm is very simple, it has something lik... |
How do I calculate RTT, do I start to measure the time from the beginning of the segment transmition or from the moment all the segment had been transmitted?
The end time is the moment the sender gets the "ACK".
|
I'm looking for the name (or a name if there isn't one already) of this relation between $G_1=\left<\Sigma_1,\mathcal{N}_1,\mathcal{R}_1,S_1\right>$ and $G_2=\left<\Sigma_2,\mathcal{N}_2,\mathcal{R}_2,S_2\right>$:
$$\exists f_\Sigma\in\Sigma_1\times\Sigma_2,f_\mathcal{N}\in\mathcal{N_1}\times\mathcal{N}_2 \text{ surjec... |
I am studying formal language theory and have been asked to prove the following:
$\forall L, L^*=(L^*)^*$
I've started with
$def. L^* = \bigcup_{i \in \mathbb{N}} L_i, L_0=\{{\epsilon}\}, L_1=\{L\}, L_{i+1}=\{uv|u\in L_i, v\in L\}$
$then (L^*)^* = \bigcup_{i \in \mathbb{N}} L_i^*, L_0^*=\{{\epsilon}\}, L_1^*=\{L^*\}, L... |
Suppose that we take an initial search problem and we add $c > 0$ to the costs on all edges. Will uniform-cost search return the same answer as in the initial search problem?
Definitions: Uniform-cost search is also known as lowest cost first. Initial search problem can be any graph with a start and a goal state. You j... |
For a language $L$ with pumping length $p$, and a string $s\in L$, the pumping lemmas are as follows:
Regular version:
If $|s| \geq p$, then $s$ can be written as $xyz$, satisfying the following conditions:
$|y|\geq 1$
$|xy|\leq p$
$ \forall i\geq 0: xy^iz\in L$
Context-free version:
If $|s| \geq p$, then $s$ can be ... |
Suppose you have a sequence generated by an i.i.d. process (such as repeatedly rolling a die and recording the values in order) parameterized by some K-dimensional vector $\vec{\gamma}$ (the probabilities associated with each side of the die), which is unknown. But, if you assume some distribution $Q$ on $\vec{\gamma}$... |
I am looking for algorithms to prioritize equipment renewals.
Input: (years since last renewal, cost of renewal, importance of renewal).
Output: An ordering of the equipment according to which it will be renewed.
I do not know if there are any algorithms for this particular problem. If you have any idea how to fit this... |
The XOR linked list is perhaps the most prominent example of storing a reversible hash of two values and using a known value and the stored hash value to derive the other value. Is there a term for the general mechanism (or a way to describe it very concisely)?
As a related question, are there other somewhat recognize... |
On Facebook HackerCup 2013, they asked the following question:
Your friend John uses a lot of emoticons when you talk to him on
Messenger. In addition to being a person who likes to express himself
through emoticons, he hates unbalanced parenthesis so much that it
makes him go :(
Sometimes he puts emoticons with... |
I wonder if two famous (and, IMHO, very nice) recreational problems are been studied in some general form.
Here's the first.
We have 13 balls, all looking absolutely the same, with 12 of them having the same weight; we don't know whether the ball that has a different weight is heavier or lighter. We have a balance with... |
I wonder where those terms came from.
Is it computer science related?
Or are they related to civil engineering, or swimming sports?
Is it some analogy with filling water in a pool, or something like that?
|
When I am reading a paper I found a notation $\operatorname{poly}( |F|,n,$$\frac{1}{\epsilon}) $.
Its not clear to me that what this notation represents. Can you please help me out?
|
I'm a pure mathematician interested in learning about information theory. Unfortunately, I'm about as pure as they come - my specialty is mathematical logic, and I have absolutely no experience with programming or anything of a computational nature. I tried looking at Shannon's original paper, but the profusion of numb... |
I am familiar with asymptotic notations like Big-O ,little-o. But while I am reading some papers people are using the notations like $O(\epsilon^{1/2^d})$, $O(d)^d$ etc. I couldn't understand these notations properly. Is there any way (Lecture notes or video lectures with examples) to understand these things clearly.
... |
I'm looking for an OCR technique (PCA or SVM or anything else) in a peculiar setting. I want to detect the motion of the finger so that if someone writes something in front of the camera in the air, I want to recognize the characters online (meaning as soon as they are written).
|
So say I have a task like this:
Construct a Turing machine transforming the word u to the word v byt
removing all the sequences of form "ba" from the word u. Input
alphabet = {a,b,c}.
Example: for IN cabbaacba, OUT cac.
And my problem always is: can I leave blank characters in place of "ba" sequences in tasks li... |
Can GDB be run on itself? How or why not?
I see something about it http://www.math.utah.edu/docs/info/gdbint_3.html
But GDB might not be written in a language that it can debug?
|
I find this a bit difficult to describe, but I am interested in the following idea :
The LZ algorithm factors (verb) an input stream into adjacent factors, these are by definition the maximal prefixes of the piece of text that occur in the previous text (or equivalently the previous concatenation of LZ factors).
I kno... |
I have been experimenting with LZ77 (naively $O(n^2)$ runtime, infinite window). Applying it to the 7th Fibonacci word $abaababaabaab$ yields the correct LZ factorization:
$\qquad a,b,a,aba,baaba,ab$.
My question is about the behavior of LZ77 if we iterate it. My experiments suggest that reapplication of LZ77 to the in... |
Problem: Consider a graph $G = (V, E)$ on $n$ vertices and $m > n$ edges, $u$ and $v$ are two vertices of $G$.
What is the asymptotic complexity to calculate the shortest path from $u$ to $v$ with Dijkstra's algorithm using Binary Heap ?
To clarify, Dijkstra's algorithm is run from the source and allowed to terminate... |
So I'm doing some exercises with Turing machine and quite often it happens that a given set of states can be achieved if and only if some character was met. Therefore, we may have some states q3-q7 which the machine may be pointed to if and only if we spotted a and (because of the task spec, for example), we know that ... |
As part of my homework I need to prove (or disprove) that changing the contrast and, then, changing the brightness is (or isn't) the same as changing the brightness and, then, changing the contrast.
Let's assume that we are using gray-scale.
Brightness: the mean of the gray levels.
Changing brightness: adding or decre... |
For a language $L$ with pumping length $p$, and a string $s\in L$, the pumping lemmas are as follows:
Regular version:
If $|s| \geq p$, then $s$ can be written as $xyz$, satisfying the following conditions:
$|y|\geq 1$
$|xy|\leq p$
$ \forall i\geq 0: xy^iz\in L$
Context-free version:
If $|s| \geq p$, then $s$ can be ... |
We say that the language $J \subseteq \Sigma^{*}$ is dense if there exists a polynomial $p$ such that $$ |J^c \cap \Sigma^n| \leq p(n)$$ for all $n \in \mathbb{N}.$ In other words, for any given lenght $n$ there exist only polynomially many words of length $n$ that are not in $J.$
The problem I am currently studying as... |
I'm having a real hard time solving recurrences using the substitution method.
Show that: $T(n) = T(n/2) + 1$ is $O(\lg n)$
I thought this to be relatively easy:
We have to show that $T(n) \leq c \lg n$
Substitution gives me:
$\qquad
\begin{align}
T(n) &\leq c \lg(n/2) + 1 \\
&= c \lg n - c \lg 2 + 1 \\
... |
Suppose that I have a turing machine that receives as input the string $1^{n\times n}$ (unary input), what is the time complexity of writing $p_1,...,p_n$ on the output tape, where $p_i$ is the i-th prime number (written in binary)? And writing the first $n$ primes followed by their product (all written in binary)?
|
Operate on an image by performing Median Filtering in a 3x3 window.
Operate on the resulting image by performing, again, Median Filtering in a 3x3 window.
Can the resulting image be obtained from a single Median filtering?
my initial thought is that it can be done with the right mask. maybe a median next to a median.
b... |
Possible Duplicate:
Show that $\{xy \mid |x| = |y|, x\neq y\}$ is context-free
Do there exist context-free grammars for the following two languages:
The set of all strings of the form $xx$ where $x$ is a sequence of $0$'s and $1$'s. (For instance $0110101101$.)
The set of all strings of the form $xy$ where $x$ and ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.