instruction stringlengths 35 29.1k |
|---|
I'm interested in finite state automata which have the capacity to require repetition. That is, the machine may be in a state in which the next character may be any character from set $S$, but, whatever character there is, it must be repeated 3 times. Or it may be in a different state, which requires a character from... |
What notation is used to discuss the coefficients of functions in big-O notation?
I have two functions:
$f(x) = 7x^2 + 4x +2$
$g(x) = 3x^2 + 5x +4$
Obviously, both functions are $O(x^2)$, indeed $\Theta(x^2)$, but that doesn't allow a comparison further than that. How do I discuss the the coefficients 7 and 3. Reduc... |
I've been stuck with this problem for 2 weeks. Any idea of how to aproach it?.
Let $L$ be a list of $n$ different integer numbers, assume that the elements of $L$ are in the range $[1,750]$. Design a linear ordering algorithm to order the elements of $L$.
I already tried with insertion sort. But I'm not sure if my ap... |
I have an Euclidean, undirected graph: each vertex is a point on the 2D plane, so the weight of each edge is the Euclidean distance between the vertices.
The number of vertices with no edges is small in comparison to the total number of vertices.
No vertex has more than two edges connected to it.
How can I convert t... |
I have read that the NFA size (i.e., the number of states) is linear in the number of characters in the regular expression. This holds even in the presence of character repetitions.
I would like to know why is it so?
If I have a pattern like this , [b-d]at then the number of states will be just 4 incase of NFA ? Size... |
Given two ordered sets of words $a_1, a_2, ..., a_k$, $b_1, b_2, ..., b_k$ taking values in some discrete alphabet $A$, a solution to the PCP problem is a sequence $i_1, ..., i_n$ taking values in $1, 2,..., k$ such that $a_{i_1}|a_{i_2}|...|a_{i_n}=b_{i_1}|b_{i_2}|...|b_{i_n}$ where $|$ means concatenation. $k$ can be... |
Let $C$ be an infinite set of characters. I'd like an abstract machine which can recognize sequences consisting of $k$ (constant) of repetitions of a char from $C$.
For example, if ${x,y,z} \subset C$, and $k = 3$, it should recognize $xxx$ but not $ddd$ or $xyz$. (The same char must be repeated.)
Since $C$ is infini... |
How can I show that this language is not regular?
$$
L = \{a^n (ca)^m b^{n+1} \mid m \ge 0 , n \ge 0 \}
$$
This is my attempted solution:
Assuming the pumping number to be $p$ and making $m=0$
the language reduces to $a^p b^{p+1}$ so $s=a^p b^{p+1}$
let $s=xyz$ where $y$ is not $\epsilon \\$
$y=a^k$; $0 \lt k<=p$
... |
I understood that we can apply FPTAS to the weak NP problems like 0-1 knapsack.
But why we cant apply the same principle to the strong NP problems like bin packing? I also checked wiki page about the same but understood very less.
|
For the following schema
Country ("countryID", cName)
CoffeeShop ("shopID", sName, countryID, city)
Product ("productID", size)
Serves ("shopID", "productID")
ProductNames ("productID", "countryID", pName)
where attributes in quotation marks are primary keys, I must write a relational algebra statement for the followi... |
Any CS class about caches will at some point address this classical formula (or a variant of it)
Effective_access_time = hit_time + miss_penalty * miss_rate
My question is simple: does this formula have a "name" ? (i.e. unambiguous, and ideally, well-accepted too). I found plenty of references to many variants of that... |
Does coNP-completeness imply NP-hardness? In particular, I have a problem that I have shown to be coNP-complete. Can I claim that it is NP-hard? I realize that I can claim coNP-hardness, but I am not sure if that terminology is standard.
I am comfortable with the claim that if an NP-complete problem belonged to coNP, t... |
I have a problem in understanding how to prove the following question.
Let $Q = \langle\max,f,L\rangle$ be an NPO-Problem, where $f$ only supports integers.
Define $$L_Q^* =\{(x_0,1^k) : \exists x . L(x_0,x) \land f(x_0,x) \geq k\}.$$
The instance of $x_0$ is binary coded, while the numerical parameter $k$ is unary co... |
Let:
$\left\{m_1, ~...~, m_k\right\}$ be a set of coprime natural numbers,
$M=\prod_{i=1}^{k} m_i$
$X$ be a natural integer, such that $X < M$
Then $X$ can be expressed in the Residue Number System as:
$$X={\left(x_1, ~...~, x_k\right)}_{RNS\left(m_1, ~...~, m_k\right)}~.$$
Where $\forall_{m_i} \left[\left(x_i \equiv... |
I have graphs $G_k$ and $H_k$ with $|\mathcal{V}(G_k)|=|\mathcal{V}(H_k)|^{2k}=n^{2k}$ with $k\in\Bbb N$ that pass sanity checks such as no-homomorphism lemma. Are there free and easy to use tools to test graph homomorphism from $G$ to $H$?
|
Ok, I must admit this a task from my studies but I'm stuck.
Rules of the game are on Wikipedia. However, we have a modified version: on input we have a board with x fields, there are y penguins on some fields, there may be gaps between fields. All penguins are the same, they can move only to the farthest possible locat... |
I'm interested in the question of how best to teach NP-completeness to computer science majors. In particular, should we teach it using Karp reductions or using Turing reductions?
I feel that the concepts of NP-completeness and reductions are something that every computer science major ought to learn. However, when t... |
So I have the question:
Prove that any directed cycle in the graph of a partial order must only involve one node.
So I know that a partial order must be transitive, antisymmetric, and reflective, but from there I am pretty lost. I also know that any path of one or more edges from a node to itself is a directed cycle, b... |
Consider the following problem:
There are $n$ points in the plane.
Starting from one of them I want to visit each of them once (except the starting node which has to be visited twice) but in a way that minimizes the cost of the total path.
The weight of each edge changes depending on the path followed.
For example imag... |
Is it possible to solve a parity game in polynomial time? If yes, how? If no, why not?
|
I have come across a question that is a bit hard to understand due to its wording, I may havecome up with a possible solution, but I don't know if it's correct. Can you please help me? Thanks in advance!
Question
Suppose we exchange elements $a[i]$ and $a[j]$, where $j > i$, which are originally out of order.
For examp... |
I want to know difference between propagation speed and bandwidth in digital communication.I know bandwidth is no of bits in one second and propagation speed of signal is distance traveled by signal is one second.Is there any relation between them or they are totally different.Can anyone tell me exact definition to dif... |
Is there a name for this infinite language?
$$L = \{ 0(,1)^*(,2)^*(,3)^*....(,n)^* \;\mid n \geq 1\}$$
A string $w \in L$ is simply an ordered list of increasing integers in which every integer $\geq 1$ can be repeated 0 or more times, for example "0", "0,1", "0,1,2,2", "0,1,2,3", "0,1,1,4,4,4,21,21".
Or perhaps a nam... |
I have $k$ lists that I would like to combine to a single list. Each list's elements are unique and are sorted in a particular order, but there is no notion of an absolute order, and different items across lists can only be compared if they are equal. To give a specific example (here I use $<$ to indicate the sorting i... |
The grammar is
$$ S\to aSb\ |\ bSa\ |\ SS\ |\ \epsilon. $$
I think this generates the set of strings with equal numbers of $a$'s and $b$'s based on examples I've done. Is this correct?
|
Consider the following problem:
Give an algorithm to find the $1^{st}, 2^{nd}, 3^{th}$ fastest horses from 25 horses. In each round, at most 5 horses can race and you can get the exact position of these horses. Analyze the lower bound of this problem using adversary argument. One race is considered as one critical ope... |
I have an Euclidean graph: each vertex is a point on the 2D plane, so the weight of each edge is the Euclidean distance between the vertices.
I am randomly creating a path thru all the vertices and I want to know if there is any efficient way to find all the intersections on my path.
|
Let $G$ be a graph on $|\mathcal{V}(G)|$ vertices. If $H$ is another graph that contains a clique of size $|\mathcal{V}(G)|$, then does it mean $G$ is subgraph isomorphic to $H$? Does this mean that all graphs with vertices less than $|\mathcal{V}(G)|$ are subgraph isomorphic to $H$?
If the above is not the case, is th... |
I think the Question is self sufficient. Is the syntax of C Language completely defined through Context Free Grammars or do we have Language Constructs which may require non-Context Free definitions in the course of parsing?
An example of non CFL construct i thought was the declaration of variables before their use. Bu... |
I am a microbiologist and I am currently self-studying machine learning from some open lecture videos. I am finding it pretty difficult to understand proofs that are somewhat "obvious", my poor mathematical knowledge is to blame for that. Can you please recommend a text-book that deals with the mathematical proofs of t... |
I have a table in which some values are repeated often as shown in the figure below. I want to encode that table such that it makes use of less memory. I have heard about run length encoding (RLE) but I would like to know if there are any other such encoding techniques or algorithms which can perform better than RLE or... |
Eagle, et al [1] discuss the notion of node entropy and this is captured in igraph via the diversity metric. I was wondering if there was any relationship between these node entropies and the idea of the entropy for the entire graph.
A related question: Does the concept of edge entropy make sense? The probability would... |
A ranking algorithm determines the position (or rank) of a combinatorial object among all the objects (with respect to a given order); an unranking algorithm finds the object having a specified rank. Thus, ranking and unranking can be considered as inverse operations.
The following lattice has 9 unique max length pat... |
I am taking an undergraduate CS Theory course and the material on finite automata and regular languages is being taught in a non-traditional manner. Instead of using regular expressions, the closure properties of regular languages, the pumping lemma etc, to show that a language is or is not regular, all of our proofs a... |
I have an Euclidean graph: each vertex is a point on the 2D plane, so the weight of each edge is the Euclidean distance between the vertices. I found a geometric proof that every optimal TSP solution contains no intersections.
How many non-intersecting routes could be there? Or in other words: what is the probability ... |
I'm having trouble understanding why it's easy to detect negative-weight cycles (Bellman Ford) but hard to find the maximum weight cycle in an undirected graph.
If we negate the weight of each edge, we can easily find if there are any cycles with total weight > 0. However it must not be easy to find if there are any c... |
Having the grammar G = (V,P,S) with variable V = {S,A} over the alphabet {a,b} with the rules:
S->aA
A->Sbb|b
How can i recognize which kind of grammar is this? I think that's not "regular expression" because in the second rule there are 2 letters (bb) instead of one, so i think it's a "context free" grammar. Am i ri... |
Construct a context-sensitive grammar that generates L:
L = {a^n b^m c^k|k>n, k>m}
I believe my productions should go along this lines:
S-> ABCC
A-> a|aBC|BC
B-> b|bBC
C-> c|Cc
CB->BC
The idea is to start with 2 c and keep always one more c, and then with C->c|Cc ad as much c as i want.
How can my production for C r... |
I'm looking for an actual definition of a stream processing unit (SPU), preferably sourced. The context is not specifically graphics cards.
I can find many, many articles explaining what they contain, or what they do in specific cases, but I need a definition for an informal class presentation. I have a general sense o... |
I have been looking for a quick and easy explanation on Quick Select and stumbled upon this. It's quick and easy to follow, but there's a part which I am not following quite well:
The uploader is sorting the following array using the 4th smallest element
2 6 5 1 4 9 3, pivot is 2 and last element is 3
We rearrange, the... |
In Types and Programming Languages, the family of sets of terms with de Bruijn indices in the untyped $\lambda$-calculus is defined in this way:
Let $T$ be the smallest family of sets $\{T_0, T_1, T_2, ...\}$ such that
$k \in T_n$ whenever $0 \le k \lt n$;
if $t_1 \in T_n$ and $n \gt 0$, then $\lambda. t_1 \in T_{n-1}... |
I can't answer this question. It seems simple but I really don't know how to approach it.
Here it is:
A priority queue is said to be stable if deletions of items with equal priority value occur in the order in which they were inserted. Which of the following priority queue structures are stable:
linked lists ordered ... |
Given a tree $T$ and a sequence of nodes $S$, with the only constraint on $S$ being that it's done through some type of recursion - that is, a node can only appear in $S$ if all of its ancestors have already appeared, what's a good algorithm to determine if $S$ is a breadth first visit, a depth first visit, or neither?... |
I am unclear about finding the memory complexity of an algorithm.
Some places refer memory complexity as what container would be carrying for instance:
for i = 1 to n-1
if d[i] == d[i + 1]
d[i] = (d[i] + 5) mod 13
Is considered as having $\theta(N)$ memory complexity.
At some other places how much data... |
In Theoretical Computer Science, which one is more important? Computability of a problem or Complexity of a problem?
|
How to reverse the order of elements in an array between indices $i$ and $j$.
Ex: For the array [A,B,C,D,E,F], calling the function reverse(array, 1,4) will modify the array to be [A,E,D,C,B,F].
I want to optimize the solution to work with multiple calls on the same array, so pre-computations allowed. What would be the... |
Given three numbers $m$, $n$ and $p$ in interleaved binary encoding1, it's obviously possible to check in $O(1)$ space whether $m+n=p$. It's less obvious2 that it isn't possible to check in $O(1)$ space whether $m\cdot n=p$. I wonder whether one can prove that it isn't possible to check in $O(\log N)$ space3 whether $... |
I need to prove by definition (show that for every $C$ there exists a $n_0$) that: $$5n^2+3n= o(n^3-4n)$$
By trying to simplify the expression I get to the point where I should prove that: $$ \frac{5n^2+3n}{n^3-4n} < C$$.
Now, showing that $\lim\limits_{x\to\infty} \frac{5n^2+3n}{n^3-4n} = 0$ isn't a tough mission, but... |
I am well aware of the DP solution to the traveling salesman problem; also known as the Held and Karp algorithm for TSP.
I have implemented it with bitmask, and it's something like this:
int TSP(int pos, int bitmask) {
if (bitmask == (1<<(K+1))-1)
return dist[pos][0]; // Completing the round tr... |
Why is it that Iterative-deepening A* is optimal, even without monotonicity? How can I be sure that the first goal reached is the optimal one?
|
I know how to use the pumping lemma to do so, but I don't think that can be used for this language:
$$L = \{x \in \{0,1\}^* : \text{no prefix of $x$ has more $1$'s than $0$'s}\}. $$
What other method can I use to prove this?
|
A quasi-monotone CNF formula is a formula where each variable appears at most once as a positive literal (and any number of times as a negative literal).
What is the complexity of deciding its satisfiability?
|
I'm currently studying compilers and am having some issues with understanding regular sets. For example, lets say I had a set of binary strings, (0, 1). Would all integers that are even and positive be considered part of a regular set? Lets say I have that same set, but instead of being even, they are divisible by 5, w... |
$\tau$ be a transformation that, applied to a word of $\Sigma_a^\star$, replaces each character with a word from a possibly different $\Sigma_b^\star$ and concatenates the resulting words. For instance, given a $\tau$ with the following translation table:
A -> AA
B -> AB
C -> BA
D -> BB
$\tau(ABC)=AAABBA$ and $\tau(DA... |
Let $\Sigma$ be a small, finite alphabet. Suppose we are given ${n\choose 2}$ sets $S_{i,j}$, where $S_{i,j} \subseteq \Sigma \times\Sigma$. I'd like to determine whether there exists a sequence $x_1,x_2,\dots,x_n \in \Sigma$ such that $(x_i,x_j) \in S_{i,j}$ for all $i,j$, and if so, find an example of such a sequen... |
I cannot really find a source that does not use the same examples provided by CLRS. I need a simpler example than MULTI-POP example. Could someone provide an example and explain me:
a) What is the difference between worst-case analysis and amortised analysis?
b) What is the difference between average-case analysis and ... |
I have read the following artice that defines the term "constructor anomaly":
Cohen, Tal, and Joseph Gil. "Better Construction with Factories." journal of object technology 6.6 (2007): 103-123.
http://www.jot.fm/issues/issue_2007_07/article3/
Where can I find examples and references on constructor anomalies? (also in t... |
Consider $\Pi$ to be the problem to decide if there is a subset of numbers that sum to $0$ in the given list of integers.
How does one construct a promise problem equivalent to $xSAT$ from this? $xSAT$ is in $NP\cap coNP$.
How is it possible that the original problem was NP complete and the transformed problem is in ... |
I asked this question on stackoverflow, but was suggested to post to same here. So here goes.
The following problem was asked in the recent October 20-20 Hack on Hackerrank :
Evil Nation A is angry and plans to launch N guided-missiles at the
peaceful Nation B in an attempt to wipe out all of Nation B’s people.
Na... |
I am interested in what sort of metrics are there that try to give a measure of how complex a given graph is, what are the corresponding algorithms, and what is their time complexity. A short description or list of relevant paper would be great.
It might help to say that I have two graphs and I want to somehow tell whi... |
The Monster M is the largest of the finite sporadic groups that arises in the classification of finite, simple groups in mathematics.
M can be realized as a (very large!) set of 196882 X 196882 matrices with nothing more than entries of 1's and 0's, so long as we compute arithmetic as follows:
1+1=0
1+0=1+0=1
1*1=1
0*... |
I've just began studying Artificial Intelligence and am wondering why the reachable state space of an 8-puzzle is $9!/2$. I see that the number of permutations of the tiles is $9!$ but it is not immediately obvious why half the possible states of the puzzle are unreachable at any given state. Can anyone elaborate?
An i... |
I understand that a pipe is a form of IPC where a process creates a link to communicate with some other process (a child maybe), taking each one a end of the pipe. File descriptors are created for read and write and they can use it in half-duplex or full-duplex. My question is if the implementation of this schema is so... |
After asking this question on stackoverflow, it has changed slightly. Is there a way to represent a grammar as a basis for a vector space and represent a program as an object that lives in that vector space?
I'm interested in the parallels between mathematical operators (like the Hamiltonian, ladder operators, momentu... |
I have a huge list of strings. The goal is to make a database of "relevant" words.
Of course in the context of what I work with, "relevance" is something akin to the organization I work with. For e.g. if it is a automobile manufacturing industry they'd buy products like
Automotive assembly equipment
Radial tyres
Etc
... |
Cutting problems are problems where a certain large object should be cut to several small objects. For example, imagine you have a factory that works with large sheets of raw glass, of width $W$ and length $L$. There are several buyers, each of which wants an unbounded number of small glass sheets. Buyer $i$ wants shee... |
I would like to measure what is the probability that given some data and it's CRC32 checksum there is some other data with the same checksum.
Running the simulation is not feasible because of the 2^32 possible values.
Running the simulation for the birthday problem is feasible (check if there is a collision among n che... |
Although this seems rather obvious, I couldn't prove it rigorously. Any ideas how to prove it? The graph is assumed to be simple and connected.
Explanation of the terms:
$k$-regular means that all vertices have degree $k$;
bipartite means that there are 2 sets of vertices $X, Y$, where vertices from $X$ only have edge... |
According to the wiki-article, http://en.wikipedia.org/wiki/Tf%E2%80%93idf the term frequency of term $t$ in document $d$ is given as follows:
$$
tf(t,d) = 0.5 + \frac{0.5 \times f(t,d)}{\max{\{f(w,d): w~\epsilon~d\}}}
$$
This is the augmented way of computation. But what does $w$ stand for?
|
What is the difference between a Neural Network, a Deep Learning System and a Deep Belief Network?
As I recall your basic neural network is a 3 layers kinda thing,
and I have had Deep Belief Systems described as being neural networks stacked on top of each other.
I've not til recently heard of a Deep Learning Systems, ... |
I need to detect whether a binary pattern P of length m occurs in a binary text T of length n where m
I want to state an algorithm that runs in time O(n) where we assume that arithmetic operations on O(log2n) bit numbers can be executed in constant time. The algorithm should accept with probability 1 whenever P is a s... |
The Adler32 algorithm has a shortcoming as noted on Wikipedia:
Jonathan Stone discovered in 2001 that Adler-32 has a weakness for very short messages. He wrote "Briefly, the problem is that, for very short packets, Adler-32 is guaranteed to give poor coverage of the available bits. Don't take my word for it, ask Mark ... |
I have this code fragment:
for( i=0; i<n; i++ )
for( j=0; j<i; j++ )
for( k=0; k<j; k++ )
S;
I need to find the number of times that S is executed in that code block. I plugged it into Wolfram Alpha but I am not sure if that is the right answer.
I want to be able to do the math in order to fig... |
Is the convention of dropping the leading 1 when storing the significand a given in all binary floating point representations or not necessarily?
|
What is proper terminology to distinguish between an array (ordered list) data structure in which each element is of identical type/class, and an array in which each element can be different?
|
Say you have a loop that iterates over an array,
for i in someArray:
//some code
This basic example would have a running time of $O(n)$. Say that you added a nested loop with equal number of operations, this then would be $O(n^2)$. My question is, is it safe to do this kind of simplication in general? For example... |
How to find hyperparameters (in Gaussian Process) by log marginal likelihood.
Suppose we have mean function as $m=ax^2 +bx + c$.
so we have $hyperparameters = \{a,b,c,sigma_y,sigma_n,l\}$;
How we calculate all these parameters by log marginal likelihood and by partial derivatives?
|
An independent set is a set of vertices in a graph, no two of which are adjacent.
A maximum independent set is a largest independent set for a given graph G.
Is there a standard term for the size of the largest independent set in a given graph?
If not, what short term can you suggest for this size? Maybe "independence ... |
I have an array of lines in 1D represented by coordination and weight, it can be only positive weight. I want to find all the lines that intersect a point in a given range.
Is there any efficient way of doing it?
|
Let L be the language of all arithmetic expressions written in Reverse Polish Notation, containing only binary operators. $\Sigma(L) = \{n, o\}$, n := number, o := operator.
Is there an LL grammar G so that L(G) = L?
|
In long-multiplication, you shift and add, once for each $1$ bit in the lower number.
Let $r = p \otimes q$ be an operation similar to multiplication, but slightly simpler: when expressed via long-multiplication, the addition does not carry. Essentially you bitwise-xor the shifted numbers.
Like so:
$$
\left[\begin{ma... |
The following is a homework assignment. I am looking for criticism / feedback on my solution, and I have a specific question.
Suppose $L$ is a language over $\Sigma$, and $x_1, x_2, ... , x_n$ are
strings that are pairwise $L$-distinguishable. How many distinct
strings are necessary in order to distinguish between the... |
Continuing in the same vein as Carry-free multiplication operation, a followup question is as follows (differences in bold):
Let $r = p \oplus q$ be an operation similar to multiplication, but slightly simpler: when expressed via long-multiplication the columns aren't summed up, but rather or'd (not xor) together. Noth... |
For the following function (not in particular coding style or programming languange)
f (N, y) // y is an integer such that 0 <= y < N
{
x = rand (N) // rand (N) returns a random integer x satisfying 0 <= x < N
if (y == rand (N))
return
else f (N, y)
}
I need to find bes... |
Say that you have a program with only total functions, or if that is impossible, consider a subset of the program with only total functions. Is it theoretically possible to statically determine the maximum size of the stack frame at runtime? The language may have other characteristics that are relevant/necessary (such ... |
I originally read that Alpha-Beta pruning has time complexity of $O(b\ ^{m/2}\ )$ with perfect ordering (where b = branching factor, m = maximum ply depth) but have recently come across claims that this can be reduced to $O(2\ ^{m/2}\ )$ with optimal ordering. Does anyone know of a proof for this claim?
|
From the book Computer organization and design by Patterson&Hennessy:
Parity is a function in which the output depends on the number of 1s in in the input. For an even parity function, the output is 1 if the input has an even number of ones. Suppose a ROM is used to implement an even parity function with a 4-bit input... |
I'm building a GUI Desktop application that will communicate with an API(http) in a webserver.
In the client side I have a GUI Desktop application and a GSM Modem(hardware). The GUI Desktop application will make requests to the API in the webserver and will get the SMS's to send.
My question here goes on how can I desi... |
It is known that the temporal logics LTL,CTL,CTL* can be translated/embedded into the $\mu$-calculus. In other words, the (modal) $\mu$-calculus subsumes these logics,
(i.e. it is more expressive.)
Could you please explain/point me to papers/books that elaborate on this matter.
In particular, are there concrete fairnes... |
Its is known that 3SAT (all clauses have size 3) is NP-complete.
But how about 1SAT (all clauses have size 1), is it also NP-complete? I tried searching for it a lot, but couldnt find any proofs or explanations for the same.
Like 3SAT has 3 clauses, what if I consider just one clause?
Thanks for the help in advance.
|
The question is to design a CFG for the language of words that have as many c's as the difference of numbers of a's and b's, that is
$\qquad\displaystyle L = \{(a^l)(b^m)(c^n) \mid l, m \in \mathbb{N}; n = |l-m|\}$.
I have so far go to create the cfg for $(a^l)(b^m)$ but don't know how to do the one for $(c^n)$. It loo... |
Some priority queues, like the height-based leftist tree (or here) support merging in $\mathcal O\left(\log n\right)$ time.
I am looking for a priority queue that merges in (expected|average|amortized|worst-case) sub-linear time, but also has the following properties:
Elements are unique
peek and pop should work in (e... |
I stumbled upon this wikipage that has got this proof :
I rechecked sum rule of differentiation.
And i can not understand where is this wrong.
Any Tips ?
I think that the second line
x^2 = x + x +... x times...
being used for differentiation is wrong. but i am not sure .
|
Consider the next problem. Given a large oriented graph find its diameter: maximal length over all shortest directed paths between every pair of vertices. Graph is strongly connected. It is allowed to give lower and upper bounds on the answer. Time complexity should be linear or close to it.
Suppose I solved the proble... |
I am using the Vlagrind lackey tool to examine the full memory reference string of a running computer program and wonder what the difference between a "store" and a "modify" might be - and do these differences reflect a real difference in category of memory manipulation, or are they merely a convenience for the user/pr... |
I know how a BIT works. But I was wondering if a BIT can be used to find the minimum/maximum element in the complete range, or more specifically, to find the minimum (or maximum) value after all the update processes have been completed. Now, I know that this can very well be achieved using Segment Trees, but is it poss... |
At the Wikipedia article on time complexity, only a PRAM example is given for polylogarithmic time.
Let $T(n)$ denote the largest number of steps used by a machine to reach a final state on any input with size $n$ bits.
Is there a program for a standard sequential model of computation (e.g. a Turing machine or a seque... |
(Before actually proceeding to the question, I want to confess that this is a homework question, please do consider it and help me in improving my understanding a bit more.)
I have recently started learning computer organisation and architecture. I have gained fair understanding for how caches are organised, how mappin... |
To continue this post, let us define the Monotone$(+, 2^-)$-SAT problem:
Given a monotone CNF formula $F^+$, where each variable appears exactly once (as a positive literal), and a monotone 2-CNF formula $F_2^-$ defined on the same variables as $F^+$, where all variables are negated. Is $F^+ \land F_2^-$ satisfiable ?... |
I've been trying to get a CFG for the language of all words with unequal numbers of a and b, i.e.
$$\{u \in \{a, b\}^* \mid \text{number of occurrences of $a$ and $b$ in $u$ are unequal} \},$$
but it seems that I keep getting specific cases instead of the general case.
Here are some that I have tried:
(S being the star... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.