instruction stringlengths 35 29.1k |
|---|
Question: Find out next increasing value of each element in this below array.
int[] array = { 5, 2, 7, 10, 4, 12}
e.g)
5's nextIncreasingValue: 7
2's nextIncreasingValue: 7
7's nextIncreasingValue: 10
...
12's nextIncreasingValue: -1
Implementation:
for(int i = 0; i < array.length; i++) {... |
This is how I see threads. Please do correct me if I'm wrong:
A thread is a part of a process that runs a sequence of program code. There can be many threads within a process that run different parts of a program (one thread manages keyboard input, one manages auto-saving, one manages printing etc.).
The process allo... |
I have a very simple quantum algorithm:
Let's start with two qubits in the state $|00\rangle$. I apply a Hadamard gate to the first one. Then I apply a CNot gate, with the first one as a control. Then I apply a Hadamard gate to both of them.
I think I should end up with with two qubits 100% in the $|00\rangle$ state. ... |
Let H = (V,E) be a connected, undirected graph. Let A be a subset of E.
Let C = (W , F) be a connected component (tree) in the forest G = (V,A). Let (u,v) be an edge connecting C to some other component in G.
Now doesnt it imply that (u,v) must belong to A since it is in forest G and it doesnot matter which component ... |
I was solving recurrence relations. The first recurrence relation was
$T(n)=2T(n/2)+n$
The solution of this one can be found by Master Theorem or the recurrence tree method. The recurrence tree would be something like this:
The solution would be:
$T(n)=\underbrace{n+n+n+...+n}_{\log_2{n}=k \text{ times}}=\Theta(n \... |
How do you suggest I go about proving this:
Give a short, basic outline of a proof that Turing machines can accept all languages accepted by PDAs. You are allowed to use a non-standard Turing machine.
The best I can come up with is that since TMs are equivalent to computers, where as PDAs are not. A TM accepting any PD... |
(This question was originally posted at https://academia.stackexchange.com/questions/68675 but was considered too specific for Academia.)
In computer science/engineering research papers relating to performance improvement wherein execution time is normalized to control benchmarks (i.e. speedup plots), how is that norma... |
Both S. L. Thaler and R. Hecht-Nielsen have set forth neural-based theories of "confabulation" applicable to machine learning.
The essential mathematics of Hecht-Nielsen is set forth in his paper "Cogent Confabulation". Briefly it is an inversion of Bayesian inference. Bayesian inference is P(x|a&b&c&d...) where on... |
I never used a debugger that can run a program backwards but I would like to. Now I wonder if there is much evidence and theory about backwards runnable programming, when and why a program can be run backwards or when and why not?
Intuitively I find that the computer should be able to run the program backwards, if it o... |
I need to find an upper limit for the runtime of $f(n)$.
f(n):
{
g(n,1)
}
g(n,k):
{
if n<=0 return;
for(i=1; i<=n; i++)
{
print "I love data structures!";
k++;
g(n-1, k);
}
return;
}
I tried to think of it this way:
for(i=1; i<=n; i++) $\rightarrow (n+1)c_2$
g(n-1, k) $\rightarrow ng(n-1)$
$$f(n) = g(n,1)... |
What is a possible data structure $X$ which stores non-negative integers $x_1, x_2, ..., x_n$ which supports the following operations:
$index(k, X)$ returns the biggest $i$ so that $\sum_{i=1}^n x_i \leq k$
$sum(j, X)$ returns $\sum_{i=1}^j x_i$
The data structure should support every operation in $O(1)$ (worst cas... |
I am stuck on that question, it's about Voronoi diagrams
Show that for some set of $n$ points, there can be $\Omega(n^2)$ intersections
between the edges of the Voronoi diagram and the edges of the farthest site Voronoi diagram.
In this question, I think the intersections is the vertexes of the farthest site. Am I ... |
I am a bit confused about the notion of connected component of a graph. I understand what is a subgraph and what means for a graph to be connected. But the definition we got in class is this: "A connected component of a graph is a maximal connected subgraph.". My question is, if the subgraph is connected but it is not ... |
I get that one transistor can store a value of 1 or 0. That's not the problem. What I don't get is how the fact that a transistor represents a 0 can translate into logic? How do these transistors turn each other one or of? Is there a uniform pattern to the circuit? how do these electrical signals magically transform in... |
1)Is it possible for a full adder to add three e.g 4 bit numbers? I mean I know the full adder has 3 inputs and two outputs but the second bit of C comes from the previous block (as shown in the image below).I mean C1 comes from the frist block and I dont provide it. And this mean I can only choose the first bit of C0.... |
I spent some time to search in internet who was the first to formaly define Flow Shop and Job Shop problems but with no effect. I'm especially interested in article/book so I can mention it in my master thesis.
I'm guessing that there may be no author of this problems but this information also would help me a lot.
|
I have the language and I want to prove that is not context-free.
So I started like this:
is variable.
Choose w =
Case 1:
vxy has no c. Choose i = 2
has more a than c or more b than c.
Case 2:
vxy has no a.
At case 2 I don't know how to continue, I'm confused since I seem to be not able to prove that there is a ca... |
The article Computational complexity of mathematical operations mentions that the complexity of division in $O(M(n))$, and that "$M(n)$ below stands in for the complexity of the chosen multiplication algorithm".
But I'm not sure how to read that $M(n)$ embedded in $O(M(n))$: does it mean that the division has the same ... |
I had two questions on my automated test which I don't understand the answer for.
$\log(n!) = \log(n\cdot (n-1)\cdot \cdots \cdot 2\cdot 1) = \log(n)+\log(n-1)+....+\log(1)$. So it is in $O(n\log(n))$. But is it also in $\Omega(n \log(n))$? I don't think so, but my automated interview test thought so!
$\log(n)+\log(... |
In Reinfrocement Learning (RL) in Neural Networks (NNs), I've seen two approaches to Q-learning.
The first is to tile the state space with basis functions using Spiking Neural Networks (SNN) to represent reward. This approach is used in "A neural reinforcement learning model for tasks with unknown time delays" by Danie... |
In my lecture I have examples about 0 -> R (which means if it's 0, move Right) or 0 -> x, R (replace 0 with x and move Right) but I don't quite understand about the 0, 0 -> R expression. What is the configuration of Turing machine btw
|
If $f(n)$ is in $O(g(n))$ but not in $o(g(n))$, is it true that $f(n)$ is in $\Theta(g(n))$?
Similarly, $f(n)$ is $\Omega(g(n))$ but not in $\omega(g(n))$ implies $f(n)$ is in $\Theta(g(n))$?
If not, can you provide an explanation/counter-example, please?
|
Parikh's Theorem is quite complicated, I understand intuition of that theorem but I don't see how to use that to prove that language is not context free. I kindly ask you to show me how to do, language isn't important, but for definiteness:
$$ L=\{0^m1^n:m>n\text{ or }(m\text{ is prime and }m\leq n)\}$$
|
I understand basic neural networks (input layer, hidden layers, output layer) and gradient descent learning. However I keep hearing about news talking about neural networks painting and making jazz music. That is puzzling me.
As I understand a neural network, you feed it the input data (i.e. a picture, music, ...) and ... |
Intro
I am trying to understand how those two models of interactive proof are different. I understand that
$\text{AM}$ relies on public coins (the prover knows the random bits used by the verifier)
$\text{IP}$ relies on private coins (the prover does not)
And here are some common results in those classes
Goldwasser ... |
A combinator expression (let's say in the SK basis) can be thought of as a function that maps combinator calculus expressions to combinator calculus expressions. That is, one can think of an expression $X$ as a function $X:L \to L$, where $L$ is the set of all syntactically valid combinator expressions in the SK basis.... |
Prove that $T$ is MST $\Leftrightarrow$ for any edge $uv \notin T$, $uv$ has the maximal weight on the cycle created by adding $uv$ to $T$.
It's my attempt to prove $\Rightarrow$:
Consider the cycle $path(v, u) \in T \cup E(v, u)$. If $(v, u)$ is not maximal, replace the maximal edge on the path by $(v, u)$. T is st... |
Let $P$ be a finite set of $n$ distinct points in $\mathbb{R}^2$. The set $P$ is called completely triangulable if for any three points $p, q, r \in P$ the area of their triangle is always positive.
An algorithm that determines if a finite set $P$ is completely triangulable returns TRUE if $P$ is completely triang... |
I am trying to solve this question from Project Euler for past few days: Divisor game.
The problem is as follows:
Two players are playing a game. There are $k$ piles of stones. When it is his turn a player has to choose a pile and replace it by two piles of stones under the following two conditions:
1.Both new piles m... |
Let $ C $ be a reed solomon code with length $6$, dimension $2$ and distance $5$.
Suppose that we are over $\mathbb{F}_7$ and we have the genrator polynomial $g(x)=(x- \alpha)(x- \alpha^2) (x- \alpha^3) (x- \alpha^4)$, where $\alpha=3 \in \mathbb{F}_7 $.
We get the word $r(x)=x^5+6x+4$ and we want to find the word tha... |
Let L ⊆ {0, 1}* . Then
1) If all proper subsets of L are regular,is L regular?
2) If all finite subsets of L are regular,is L regular?
3) If a proper subset of L is not regular,is L non regular?
I am not sure if one or more of the above are true.I think 2) is true because any finite subset can be accepted by a DFA.Are... |
Suppose a process wish to open a file named test.txt. So it issues a system call requesting Operating system to find the file on disk,and to grab the handle of file to operate on it. My question is how does the operating system actually locates file on disk(Particularly sequence of actions the operating system performs... |
I have to draw a finite automaton of a language over $\{a,b\}$ of all strings having odd length and has an even number of $b$s.
I already came up with following regular expression
$(a+b)((a+b)(a+b))^*$
which satisfies the condition that a string must have odd length.
What should it look like so that a string has even n... |
I was trying to implement an algorithm which finds the strongly connected components (SCC's) of a directed graph. In order to find the SCC's, as the last step we need to be able to generate the Depth-First Search Forest as mentioned in CLRS:
STRONGLY-CONNECTED-COMPONENTS (G)
1. Call DFS(G) to compute finishing times ... |
I'm trying to understand why exactly the 0/1 knapsack problem actually has the optimal substructure property.
Let $E$ be the set of items to consider and $v$ and $w$ the value and weight functions defined over $E$.
Now, suppose that, among all solutions weighing at most $W$, $S \subseteq E$ is the best solution. How ca... |
I have this code:
if n is even
{
for i=1....n
for j=1...i
print j
return 8*foo(n/2)
}
Asking to calculate the running time $T (n)$. I thought at first that I can write the function like this:
$$T(n)= 8T(n / 2)+n^2$$
But according to the answers of the quiz, they are saying that the function looks like this:
$... |
Can we construct reduction from $k$-sum to $l$-clique or vice versa where $k$ and $l$ are some fixed integers?
That is given two parametrized problems whose unparametrized version is $NP$-complete when can we construct reductions between them?
In general NP complete problems the reductions are polynomial time.
What is ... |
A couple of friends and I were talking about the best way to attempt to shuffle a infinite list, given finite memory.
We immediately concluded that you could not do so, at least not in the same sense that you could shuffle a finite list.
But we devised an approximation.
Initialize: Draw from the infinite list $L$, a ar... |
It is well known that the S and K combinators form a basis set for combinator calculus, in the sense that all other combinators can be expressed in terms of them. There is also Curry's B, C, K, W basis, which has the same property. There must be an infinite number of such bases, but I don't know of any others.
I am awa... |
There are a number of specialized data structures that implement ordered dictionaries for integer keys: van Emde Boas trees, y-Fast tries, fusion trees, etc. Each of these data structures implement the key ordered dictionary primitives in sublogarithmic time.
However, to the best of my knowledge, all three of the above... |
Can someone explain to me in the simplest possible way, how to reduce $3SAT$ to $Vertex\:Cover$?
I am following the explanation here (scroll to the bottom of page 4). I understand the basic setup of having two "gadgets": the 2-node variable gadgets and 3-node clause gadgets.
I also understand the formula $k = variabl... |
I'm trying to figure out how to compute an amortized complexity/ or complexity of this algorithm. We have a Graph which is oriented. And we are going to run Dijkstra's algorithm for finding a shortest path between vertices, but it has to start only in those vertices, which has no input edge going to this vertex (the ve... |
Recently the following problem was posed in a private coding competition at my workplace:
An array $A$ is given that has only positive integers in it. The objective is to equalize the array in minimum possible steps. In every step all but one element are incremented by a fixed step size. The possible step sizes are gi... |
Are all languages in $\mathbf{P}$?
Note: The definitions of all the symbols and functions here follow the document [1].
The following is my attempt to answer the question. Assume that we design a special Turing machine $M_1$, no matter what the input is, $M_1$ will jump to the state $q_{\rm accept}$ (the accepting stat... |
For example
printf("%u",&a);
gives me output
65524
|
I am currently learning landau notations and am stuck on the following True/False question.
What seems a little confusing to me is the use of big-theta notation to describe worst-case run-time.
What is the difference in saying "worst-case run-time Θ(n log n)" or simply "run-time O(n log n)"? Giving the worst case a t... |
Assuming we have a single-level (L1) cache and main memory, what are some of the advantages and disadvantages of having a larger cache block size (considering average memory access time).
The only ones I can think of are that a larger block size could increase the hit rate when adjacent memory locations are accessed, i... |
Given a matrix $A$ and a vector $v$, I'm aware there are efficient algorithms for computing $e^Av$, where efficient means significantly faster than computing $e^A$ and multiplying by $v$. For a diagonal matrix $D$, is there a similarly efficient algorithm to compute $$ e^A \cdot D = \sum_i (e^A)_{ii} D_{ii}?$$
In parti... |
I was interested in the Tremaux Algorithm as a Depth First Search to solve a Maze.
Unfortunately I was not able to understand what Data Structures are and how they could be used.
For example, I saw a YouTube video which shows the process of solving a Maze using the Tremaux Algorithm but I did not understand what data s... |
I was reading a paper and I came to the following :
"Since independent set is $Ω(n^{1−\epsilon})$-inapproximable unless P=NP (see [19]) for any fixed $\epsilon> 0$, the ..." where [19] is the following article : D. Zuckerman. Linear degree extractors and the inapproximability of max clique and chromatic number. In STO... |
Give the recursive inference of the word $abcddd$ from the Context-free Grammar:
$A\rightarrow aAd\mid B$
$B\rightarrow bBd\mid C$
$C\rightarrow cC\mid cD$
$D\rightarrow Dd\mid ϵ$
This is a follow up question to this one here. Much like that question I haven't found any good information on the subject. I unders... |
I have the optimization problem given below
max $\sum_{i=1}^{N}\sum_{j=1}^{M} x_{ij}R_{ij}$
s.t
$\quad 1)\quad \sum_{j=1}^{M} x_{ij}=1 \quad \forall i$
$\quad 2)\quad x_{ij} \in {0,1}$
$\quad 3)\ \ \sum_{j=1}^{M} x_{ij}R_{ij} \geq R^b_{i} \quad \forall i$
$\quad 4)\ \ \sum_{i=1}^{N} x_{ij}R_{ij} \leq R^u_{j} \quad... |
DPA denotes “Deterministic Pushdown Automata”.
Is the following (*) true regarding DPA:
After all symbols of the input sequence are consumed, the input sequence is accepted either (1) if the stack is empty or (2) if the current state of the DPA is an accepting one, or both.
My book is fairly vague on the subject (it ... |
I want to find the pth percentile of a stream of integers, exactly (not approximately).
If we know the number of integers which will be coming in the stream and the numbers can fit into the memory then we can simply sort the integers and find the pth percentile.
But, what if all the numbers can't be fit in memory? How... |
In their paper "Coevolutionary Free Lunches" David Wolpert and William Macready describe a set of exceptions to the No Free Lunch theorems they proved in an earlier paper. The exceptions involve two-player games in which a player tries to minimize expected search cost given optimal play, or at least good play, by an op... |
I'd like to ask a question about MAX CUT and MIN CUT on graphs with unit edge-weight. I know that MAX CUT is NP-Hard, but MIN CUT is in P (i think)?
Barahona, in 1982, showed (Lemma 1) finding a cut of at least k on a unit-weight graph is equivalent to finding a cut of at most -k on a graph in which each edge is replac... |
Consider the following model problem:
I want to use an evolutionary algorithm to optimize the starting point of particles for which it is apriori clear where they would start in state space, but not when. Once a particle is placed, it is part of the dynamics, which is stochastic, i.e. whether certain particles interact... |
Preparing for an interview.
I see two cases where each one is specially suited
BFS: When you need to find shortest path between vertices (if one exists).
DFS: If you need to find cycles in a directed graph:
Uses-case where both can be used: Finding cycle in undirected graph, Is there a path from one vertex to anothe... |
While trying to compute the Matrix Exponential of an nxn array I decided to take advantage of a Python function called scipy.linalg.expm().
According to the documentation, this function adopts the Pade' Approximant to perform a calculation that, otherwise, is said to require a lot of resources and is still a matter of ... |
My question goes like this:
Write an algorithm (in pseudocode) that on input $w$, checks that $w$ encodes a valid Turing machine $\langle M\rangle$. e.g, you need to validate that the structure is correct, that $\delta(q_a,a)$ is undefined for every symbol $a$, etc.
Unfortunately, I got no idea how to tackle it. I ha... |
My assignment is to compare several probability distributions in random walk algorithm. I'd like to analyse it in 2D linear space to make the concept more intuitive.
What is the correct approach in selecting consecutive positions of the particle? Do I choose both coordinates independently or the step length?
|
Under assumption that the hash function is uniform, we have worst-case performance for the search operation in a separate-chaining (e.g. java.util.HashMap) hashtable $O(\log n)$. Why? I cannot really understand this. If we have a uniformly-distributed hash values it should be the case that each hash bucket contains app... |
Problem: Give a linear-time algorithm to find an odd-length (directed) cycle in a directed graph. (Exercise 3.21 of Algorithms by S. Dasgupta, C. Papadimitriou, and U. Vazirani.)
The related post@cs.stackexchange asks for the existence of an odd-length directed cycle in a digraph, which is solved by the following t... |
$L\subseteq \{0,1\}^*$
Since the language is r.e. there is definitely at least one Turing Machine that semi-decides the language. I'm thinking that if you have one Turing Machine that semi-decides the language, you can arbitrarily extend this Turing Machine (by adding redundant states), which means there are a countabl... |
It is a well-known fact that language generated by a context-free grammar is the minimal solution of a particular system of equations, for example:
$$\begin{align*}
X &=\{{\epsilon}\} \cup Y\\
X &=\{{a}\}Y \{{v}\}
\end{align*}$$
generates the language $\{a^nb^n : n \in \mathbb{N}\}$.
How can I prove that fact? How do ... |
Flow networks are often constructed when one is interested in measuring how resilient a graph is. The idea goes as follows: two vertices are designated as source $(s)$ and sink $(t)$ respectively, to each edge $e$ of the graph a capacity $c_e$ is assigned (which can be defined as a function vertex properties of the end... |
I'm reading through Sipser's Intro to the Theory of Computation for a class, and I'm having trouble understanding one of the examples in the book.
The example shows how $REGULAR_{TM}$, defined as the problem of determining if a Turing machine recognizes a regular language, is undecidable. The way they do it is by showi... |
I'm an undergraduate student, but not a computer science major. I'm thinking of switching to CS after I graduate. I found a program that seems to allow students to take a test and gain entry into their school without having majored specifically in computer science first.
Here's the link: http://www.calstatela.edu/site... |
I have the CRC polynomial 1101, and my information word is 10001111. How do I find the CRC code word?
Disclaimer: This is an assignment problem. I'd appreciate any help, particularly solving the problem for a different polynomial and word. Most of all, I'd like an explanation of what to do here, and what a CRC code wo... |
After some work on Minimum Spanning Trees and Steiner trees in combinatorial problems I came across this problem that I would like to look further in my research, but I want to know if there is an algorithm for it. I couldn't find anything in Google or Google Scholar.
Given a directed graph $G=(V,E)$ with a weight for ... |
I am looking for the time complexity of the following nested loops, where the inner loop is shrinking.
function(int n){
c=0;
for(int i=1;i<=n;i++)
for(int j=i;j<=n;j++)
c++;
}
|
The question itself:
Let us define a generalization of Turing Machines to include a finite memory of >size $n$.
We denote such
a Turing Machine formally as:
$M_{mem} = (Q, Σ, γ, δ_{mem}, n, q_0, q_a, q_r)$
where all the definitions are identical to the standard Turing Machine except >that there is the finite memory si... |
Let $A$ be an array (equipped with a total ordering $\leq$) of size $n = km$ with $k\in \mathbb{N}$, such such that $A[1],\dots,A[n]$ are all distinct. What is a fast way to find a partition $A_1,\dots,A_k$ of $A$ with $|A_i| = m$ for all $i$, such that $x<y$, if $x\in A_i$ and $y\in A_j$ with $1\leq i<j$?
I have the f... |
I have implemented a KD-Tree that stores coordinates (latitude, longitude). I have also implemented a Nearest Neighbor search algorithm using the Haversine distance. My question is, will I get correct results (same nearest neighbor) if I use euclidean distance instead ?
If not, can you give me a concrete example of 3 G... |
I've been trying to find an algorithm to list all binary trees of a given height $h$.
Note that I'm not trying to count them: the number of such trees is given in the OEIS (A001699).
All the algorithms that I have been able to see list all binary trees for a given number of nodes. A very inefficient way of solving th... |
A little bit of history first. I have asked this question here some days ago. Quoting from there:
An array $A$ is given that has only positive integers in it. The objective is to equalize the array in minimum possible steps. In every step all but one element are incremented by a fixed step size. The possible step size... |
Isomorphism testing of projective planes can be done in $n^{O(\log \log n)}$. This class is contained in quasi-polynomial time. I would like to know more about this class and natural problems in it.
Is there a standard name for this class of problems?
Also, I am looking for a reference (or survey) that gives other ... |
The author here writes:
Little known fact, the system of measuring length in the US is Turing complete
My question is: Is the system of measuring length in the US Turing complete?
|
I have a problem where I have a set of subsets and I want to create the shortest list where I can find all subsets in it. Each subset must be a block of that list.
The input is a set of set of elements. The elements can be duplicate between different sets, but are unique within one set.
The output is a list where the o... |
One would assume that a finite state transducer can perform any translation such that the resulting string is from a regular grammar. Similarly, that a pushdown transducer can generate strings from CFG grammars.
I am, however, unsure about this because we can construct a finite state transducer which translates a strin... |
I have to find the time complexity of the following program:
function(int n)
{
for(int i=0;i<n;i++) //O(n) times
for(int j=i;j<i*i;j++) //O(n^2) times
if(j%i==0)
{ //O(n) times
for(int k=0;k<j;k++) //O(n^2) times
... |
Can a problem (described by a set of inputs and accepted answers) be designed such that for all programs which produce an answer in finite time for a (countably) infinite number of inputs, at least one of those outputs is incorrect.
That is, the program need not terminate for all outputs, but the outputs it does gener... |
There are many applications where a pseudo random number generator is used. So people implement one that they think is great only to find later that it's flawed. Something like this happened with the Javascript random number generator recently. RandU much earlier too. There are also issues of inappropriate initial ... |
Karlheinz Brandenburg depicts a MP3 encoder like this:
Source: MP3 and AAC Explained
I marked the FFT as I'm not quite sure why it is actually necessary to perform one. Why can't the psychoacoustic model be applyed to the so called lines after the modified discrete cosine transform (MDCT) without performing a FFT?
I h... |
Think that we have M professors and N courses
every professor can wrote question for at least one course exam.
we want to choose minimum number of professors in order to design question for all N courses exams.
I try to hard but I only could model this question in a bipartite graph that one sections are professors and... |
Recently I am reading a document [1]. In this document, Prof. Cook provides a brief proof of $\mathbf{P} \subseteq \mathbf{NP}$, which is only one sentence:
It is trivial to show that $\mathbf{P} \subseteq \mathbf{NP}$, since for each language $L$ over $\Sigma$, if $L \in \mathbf{P}$ then we can define the polynomial-... |
A directed acyclic graph (DAG), is a directed graph with no directed cycles.
That is, it consists of vertices and edges, with each edge directed from one vertex to another, such that there is no way to start at any vertex v and follow a consistently-directed sequence of edges that eventually loops back to v again.
we h... |
A perfect shuffle of two words $u=a_{1}a_{2} \cdots a_{n}$ and $v=b_{1}b_{2} \cdots b_{n}$ where $a_{i}$'s and $b_{j}$'s are letters from the alphabet $\Sigma$ is defined as $u \diamond v=a_{1}b_{1} \cdots a_{n} b_{n}$.
It is obvious that if for two primitive words $u$ and $v$, their shuffle $u \diamond v$ need not be... |
We wish to find shortest cycle (if any cycle exists) that includes a special vertex $v$.
We know if we run DFS on an undirected graph, back edges show us that there exists at least one cycle.
This answer on SO explains why neither BFS or DFS work. However, I still think that DFS could be helpful in finding a minimun s... |
Consider, two $m \times n$ matrices $A, B$ such that there is a permutation $\kappa$ that such that such that $A^{\kappa}=B$ (Wielandt's notation), i.e. $A, B$ are isomorphic but not equal.
Since, permutations of rows are independent of permutations of columns, so $\kappa = \sigma \pi$ where $\sigma$ is a row per... |
So I've seen that most NP-Complete problems seem to take the form of decision problems - problems which require only a yes/no answer. However, how can this be reconciled with the requirement that the solution of an NP problem can be checked in polynomial time?
For example, for a graph G, the max cut decision problem: "... |
I've been trying to proof The Chomsky–Schützenberger, but I stuck on creating regular language from that theorem. I mean reagular language, which is intersected with Duck language. Could anyone give me hints how to construct proper language?
|
I'm trying to prove that $BPP^{BPP}=BPP$.
$BPP\subseteq BPP^{BPP}$ is obvious. I'm struggling with $BPP^{BPP}\subseteq BPP$..
Can anyone help?
|
Consider the membership problem for a context-free language. An instance of this problem can be described as pair $(G,w)$, where $G$ is a context-free grammar and $w$ is a string.
Lets say I have a PRAM and I want it to decide in $\log^k n$ time and $n^c$ space complexity whether $w$ is in $L(G)$ ($c$ and $k$ are both... |
Revising for an exam and I'm trying to get to grips with operational semantics. Here's the exam question that prompted me posting this:
Exam Question:
We add to the language $\mathsf{SIMP}$ two new commands, with abstract syntax defined by the grammar rule:
$$C ::= \mathsf{assert}\ B\ \mathsf{before}\ C \mid \mathsf{ab... |
I'm trying to do this exercise but I have some doubts.
A binary memoryless source emits the symbols 0 and 1 with probability 0.8 and 0.2 respectively.
It encodes three blocks messages: 000 is encoded with 0; any other xyz block with 1xyz.
The obtained code is UD?
It is instantaneous?
Calculate the average length (b... |
My question deals with the algorithm of computing the convex hull in 2D by Preparata.
Let us assume we have two sets, $A$, $B$, of points in the plane. Let $CH(A)$ and $CH(B)$, denote the convex hulls of the two sets, A and B respectively. And suppose that $y(a) < y(b)$ for all $a \in A$ and $b \in B$.
Let $CH(A) = \... |
Typically, we use the notation $S = \{0, 1\}^n$ to denote the set of all $n$-bit strings. Suppose that I wanted to extract a subset of the strings where certain bits have some fixed values. For example, I could try defining $S' = \{s= s_n\ldots s_1 \in S : s_2 = 1, s_4=0, s_n = 1 \}$ to denote the set of $n$-bit string... |
I have been looking for the definition of ACTL, but Google has given me very little to go with.
So far, I know ACTL is another form of CTL model checking, and CTL includes the following operators:
Always
Exist
Global
Finally
Next
AND / OR
NOT
So what does ACTL include and how is it different from CTL?
Many thank... |
I have trying to understand graph algorithms from scratch and I have explored various resources but the most understandable for me was these lecture notes Algorithms. The way professor teaches seems very easy to grasp for me so, lets coming to the point there was this section on his notes where he tells:
Traversing co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.