instruction stringlengths 35 29.1k |
|---|
Given the language with alphabet: $\{a, b, c\}$
Draw an NFA or DFA for all the strings that have exactly twice substrings $ab$ and at least on $c$.
I'm stuck with "exactly twice $ab$". Can somebody give me some ideas. It's also very good if you can suggest me the regular expression of this statement.
|
I was reading about synchronization problems for cooperating processes and i learned that only hardware solutions like test_and_wait() and compare_and_set() are performed atomically at the hardware level and in all other software solutions like mutex, semaphore the code needs to be executed atomically and hence these h... |
I would like to show that Quadratic Programming is NP-hard.
I am currently reading a couple of papers which state that QP is NP-Hard and prove it by transforming SAT to QP, however I am finding the diction quite tough since I am just a beginner in the field. Would anyone happen to know the answer to this question who c... |
I have a question about preparing the dataset of positive samples for a cascaded classifier that will be used for object detection.
As positive samples, I have been given 3 sets of images:
a set of colored images in full size (about 1200x600) with a white background and with the object displayed at a different angles ... |
I am a professor at a university of applied sciences and will teach computer science next semester.
My question is if you know resources which use the R project as the basis, i.e. not using it primarily for statistics (I do this already in this semester) but for other topics in informatics, mentioned e.g. in this wikip... |
void Sort(int A[], int left, int right)
{
int p;
if (left < right)
{
p = (right + left + 2)/3;
Sort(A, left, left+p-1);
Sort(A, left+p, left+2*p-1);
MergeSort(A, left+2*p, right);
Merge3(A, left, left+p, left+2*p, right);
}
}
I need to convert this function i... |
While thinking about this question on a recurrence I checked out some stronger master theorems.
Unfortunately, they do not seem to apply because terms
$\qquad\displaystyle T(n) = \dots + T(n-1) + \dots$
are not covered.
Roura [1] investigates (in the discrete case) recurrences of the form
$\qquad\displaystyle T(n) = t... |
1-in-3 SAT is the set of 3CNF formulas with no negated variables such that
there is a satisfying assignment that makes exactly one variable in each clause true. Show 1-in-3 SAT is NP-complete
Plan on doing a reduction from 3SAT.
My confusion arises from the "no negated variables". You need some way of representing nega... |
Is it true that if A is a subset of B, and B is decidable, than A is guaranteed to be decidable?
I believe it would be true because all the subsets of B should also be decidable making A decidable. I'm not sure if my thought process is right or if there's a easier more intuitive way to explain this.
|
I know this has been a question but based on a past experience, i thought i would rewrite it so i can get input and ask questions faster.
Suppose we have
$$\text{NOT-SELF}=\{\langle M\rangle \mid M \text{ is a Turing machine that does not accept }\langle M\rangle\}$$
the set of all machines that don't accept their ow... |
So say we have a bipartite graph G=(X,Y,E). Let's make a game out of it.
I go first. I pick a node in X. You go next. You pick a node in Y that is connected by an edge to the node I picked. Next it's my turn. I pick another node in X (must be a new one that hasn't been used before) that is also connected to the node in... |
I wonder how I can go about proving that if a language L is decidable in o(nlog(n)) then L must be regular.
I should probably mention that by "decidable" I mean "being decidable by single-tape deterministic turing machine".
Thanks and regards
Guillermo
|
I've been thinking about how to show this but I'm stuck.
I'm required to prove this:
Show that the language $$\mathrm{TOT}= \{\langle M \rangle : M\text{ is a Turing Machine that halts with all inputs} \}$$ is not recursively enumerable nor its complement. ($\langle M \rangle$ is an encoded Turing Machine with only ze... |
Is it possible to modify Dijkstra´s algorithm in order to get the longest path from $s$ to $t$ ?.
My intuition says that I´ll need a different algorithm entirely. Finding the longest path is the same as finding the shortest path on a graph with negative weights. However, Dijkstra’s algorithm requires that the weights ... |
I have two large sets of integers $A$ and $B$. Each set has about a million entries, and each entry is a positive integer that is at most 10 digits long.
What is the best algorithm to compute $A\setminus B$ and $B\setminus A$? In other words, how can I efficiently compute the list of entries of $A$ that are not in $... |
I program in Python, which is a well-known dynamically typed language. I understand dynamic typing to mean mainly that "operations" (in a loose sense) in the language are either allowed or denied (raise an exception) based on the type of their operands, and that this type-checking is deferred as long as possible. My qu... |
I encountered these few recursive relations:
T(n) = (n/2)T(n/2) + O(n^2)
T(n) = T(n/2) + T(n/2-1) + ... + T(1) + O(n^2)
I do notice that these recursions can be solved faster by DP. I'm just curious as to:
What's the big-O of the running time of these relations, if we follow the resursive formula
How do you analysis r... |
I'm a little stuck on this question, any help would be appreciated!
Given that the Hamiltonian Path (HP) and the Hamiltonian Circuit/Cycles (HC) problems are known to be NP-complete, show that HCE is NP-complete.
HCE: Given an undirected graph G and an edge e of G, does G have a Hamiltonian circuit/cycle that uses e?
I... |
When we are trying to learn a new language without any help from native speakers, the first thing we need is something/someone to correct our grammatical mistakes/improper word selection.
So is there any research done on building tools to help critique our spoken language? I often hear people saying that the more you t... |
The following is my proof for $P$ being closed under union. I wish to know if my proof is correct in addition to what it means for the union of two problems.
Proof:
Let $p_1, p_2 \in P$ Then by definition of $P$ $p_1$ is solvable in $O(n^k)$ for some $k\in\mathbb{N}$. Similarly $p_2$ is solvable in $O(n^{k_2}$) for som... |
I have seen this question: Are regular expressions $LR(k)$? and my question is slightly related.
Suppose I have a regular expression:
RE=(aa)?(aa)
and I convert it to a grammar:
G ::= A B
A ::= C | (empty)
C ::= D D
D ::= aD | empty
B ::= D D
Can an LALR(1) parser such as Bison generate matches such that I can perform ... |
Situation: Alice has selected a positive integer $a$, and Bob has selected a positive integer $b$. Alice and Bob want to know whether $a > b$, $a = b$, or $a < b$, but neither wishes to reveal their chosen number to the other party.
How can Alice and Bob make this determination?
|
My aim is to classify types of cars (Sedans,SUV,Hatchbacks) and earlier I was using corner features for classification but it didn't work out very well so now I am trying Gabor features.
code from here
Now the features are extracted and suppose when I give an image as input then for 5 scales and 8 orientations I get 2 ... |
Is there an algorithm/systematic procedure to test whether a language is regular?
In other words, given a language specified in algebraic form (think of something like $L=\{a^n b^n : n \in \mathbb{N}\}$), test whether the language is regular or not. Imagine we are writing a web service to help students with all their ... |
Im designing a program to play Connect 6, a variation of connect 4. I have narrowed down my options to the following:
1) Minimax with Alpha-Beta Proning
2) A Neural Net
3) Machine Learning
My program has one second to make a move, so I can only branch out 2 moves ahead with Minimax. Which solution would best perform ... |
I am asked to check if a vector contains another vector as a subvector. For example:
$$v_1 = (4, \underline{3, 4}, 9, 10, 28, 5, 12, \underline{3, 4})$$
$$v_2 = (3, 4)$$
The answer here will be two, since there are two instances of $v_2$ in $v_1$.
I know I have to use "if" but I dont really know how to write it down (I... |
I know that for every $k$-tape DTM that runs in time $O(t(n))$, there exists a 1-tape DTM that runs in $O(t^2(n))$, no matter how large the $k$ (the $k$-part is a formulation from Wikipedia). But what if $k=\infty$?
If I understand it right, if $k=\infty$, then the alphabet of the $\infty$-tape DTM is infinite and ther... |
I use Google a lot for searching articles and publications. Occasionally, I find Google totally misses what I am looking for and I get completely unexpected results for some search queries.
What are the published or widely known failures of PageRank algorithm?
EDIT: Changed the post to address comments.
|
I am trying to solve a 25k clauses 5k variables SAT problem. As it has been running for an hour (precosat) and I'd like to solve bigger ones afterwards, I'm looking for a multi-core SAT-Solver.
As there seem to be many SAT-Solvers, I'm quite lost.
Could anyone point me out the best one for my case?
I'd also be happy if... |
Are there problems that are in NP class but not in #P class?
According to Wiki definition:
More formally, #P is the class of function problems of the form "compute ƒ(x)," where ƒ is the number of accepting paths of a nondeterministic Turing machine running in polynomial time"
So I am thinking, if you already have a... |
I have to estimate the computational complexity of some algorithm that does $\psi_q(m)$ iterations. Assume that all inputs $m$ are coprime to $q$.
So I need to know what growth the $\psi(m)$ has.
|
My Problem is like this:
I have a physical layout represented as a graph. The Nodes represents hooks/ducts where a wire can anchor and Edges are the possible connection between 2 nodes from where wire can go.
There are some special Nodes, called splitters, from where a single wire can be splitted to 2 or more up to k... |
This came up while I was trying to answer this question on Wiring Length Minimization. I was going to call this the "polygamous marriage" problem, but the internet, so kittens. Yay!
Suppose we have $M$ kittens that need to be adopted by $N$ people, $M > N$. For each kitten, $i$ and each person $j$ there is a cost $... |
I'm writing a context-free grammar that I hope will be in Chomsky Normal Form, and I have two questions:
Can I use a single variable (a non-terminal) on the left-hand side of multiple rules?
Can I use a single variable (a non-terminal) twice on the right-hand side of a single rule?
For instance, is the following gram... |
My Problem is: to define a "repeat until"-construct in terms of Denotational semantics. I made an attempt and now i need to know if i made it right.
The Conditions are: i used the language "While" as specified in "Semantics with Applications" by Nielson & Nielson (1992) (pdf) (WorldCat). I do not want to use the help o... |
Consider a standard feasibility problem. The goal is to examine the state of feasible solutions for $Ax=b$ to find an $x$ that satisfies some property. Does the dual of this problem tell us anything about the solution? Since there is no objective function that we're examining I think the dual looks like $A^Tx \leq 0$. ... |
I've been struggling with this problem for quite a while now and every explanation I have managed to find doesn't seem to correctly solve it.
We have the language L = {$ { a^{2^n} \ | \ n \ge 0 } $} and we need to prove that it is not regular by use of the pumping lemma.
(i.e. L is words whose length is a power of 2: a... |
Consider a certicate for 3SAT that lists an assignment for each occurrence of a variable in the order
of appearence,e.g. 100000 for ($x\bigvee$$y\bigvee$z)$\bigwedge$($\neg(w)$$\bigvee$$y\bigvee$z). This certicate is of polynomial length and can
be read once to check the satisability of the given formula. Does this pro... |
This sub-problem is motivated by Algorithm to test whether a language is regular.
Suppose we have two languages $L_1,L_2$ that are expressed in "algebraic" form, as formalized below. I want to determine whether $L_1 = L_2$.
Is this decidable? If yes, can anyone suggest an algorithm for this? If not, can anyone sugge... |
here is a competitive programming question:
You have a number of chores to do. You can only do one chore at a time and some of them depend on others.
Suppose you have four tasks to complete. For convenience, we assume the
tasks are numbered from 1 to 4. Suppose that task 4 depends on both task 2 and task
3, and task 2... |
I'm trying to create a PDA for $\{xy \mid |x|=|y| \text{ and } x \ne y\}$ over the alphabet $\Sigma = \{a, b\}$. But I don't know how the PDA will know if the two strings $x$ and $y$ are not equal. Please help me create this PDA step by step.
|
I will be given some kind of this graph as in the picture below. I've searched some algorithms but it seams as if it is something impossible for me to figure them out. In fact using Floyd–Warshall algorithm it is kinda of possible, but unfortunately I'm only allowed to use stacks (instead of matrices). I also looked fo... |
I know when we access elements in rows it will be much faster than if it is accessed column wise. In matrix multiplication one of the matrices must be accessed column wise.
In GPUs with CUDA/OpenCL I could resolve this issue by explicitly copying both matrices row-wise into user-managed shared(cache)-memory (or local... |
Sipser example 9.29
He says: "one way to do so (compute the parity function with O(n) gates. One way to do so is build a binary tree that computes the XOR function, where the XOR function is the same as parity on 2 variables, and then implement each XOR gate with two NOTs and two ANDs, and one OR. ... Let A be the lang... |
What makes neuromorphic architectures more efficient (less heat and power consumption) than von Neumann architecture for complex tasks? Except inspiration from biological systems, what are some formal results on this?
Any reference to books or articles is appreciated as well.
|
A natural number n represents the initial position in the game. When it is a players turn he/she is allowed to
I) Subtract 2 from n
II) Subtract 3 from n
III) Subtract 5 from n
We call the player who begin the game Adam and the other player Berta. The players alternate by applying on of the three rules to the num... |
When using resolution, if the empty set {Ø} is derived from a formula like {¬x,¬y} {x,y}, does that mean the formula is unsatisfiable?
If this is the case, why is {x,y},{¬x,¬y},{x,¬y} satisfiable, and
{x},{¬x},{x,y,z,w} is not satisfiable?
|
I have a question about simplifying O-notation. Specifically, why is $O(t(n)b^{t(n)}) = 2^{O(t(n))}$ where $t(n)$ is the running time of an algorithm?
|
Motivated by Efficiently sampling shortest s-t paths uniformly and independently at random,
The answers give methods of randomly sampling shortest $s\text{-}t$ paths. However, they use a lot of seemingly unnecessary random bits.
My question is:
Can the solution be improved to use a single random number in interval $[0... |
In section 3.2 of the book Computational Geometry: Algorithms and Applications (by Berg et al.), the authors describe a procedure to make a polygon y-monotone. The algorithm distinguishes vertices into $5$ different types: "start", "end", "regular", "split" and "merge" vertices.
A regular vertex is a vertex which has o... |
We know that deterministic TMs are countable (enumeration). Does the same hold for NTMs? Are TMs and NTMS equinumerous?
|
I need to implement TSP algorithm by brute force for learning purposes.
I've understood there's a set of cities, let's call it V and it's possible to get a matrix representation for the costs for going from a v1 city to a v2 city. I'll assume there are not cycles, so it's no possible to going from v1 back to v1
Then, ... |
I'm just trying to get my understanding of big O down. I know the concept and the basics but I'm a bit confused about what it means to be equal to big O of something.
For example, is $2^{2n} = O(2^{100n})$? From my understanding it is, since $2^{2n}$ is "faster" than $2^{100n}$, and so completes within the time $2^{100... |
Can I think this way:
We can convert a NFA to a RE using GFA.
We build a series of GFAs. At each step, one state (other than start or accept) is removed and replaced by transitions that have the same effect.
So, if we can convert k REs which have different forms but accept same language, then there must exists a string... |
In descriptive complexity, we have theorems that look like $\mathrm{ESO} = \mathrm{NP}$ or "on linearly ordered structures, $FO(LFP) = P$", but I don't really understand the proofs of those.
For the latter, the intuitive equality really means that the statement "$\mathcal A\models \varphi$" can be verified to be true o... |
I'm building a load test harness for a distributed system. Currently I'm using the "Cormode, Korn, Muthukrishnan, and Srivastava" method to estimate latency quantiles of system responses.
I'm now testing systems larger than can be adequately stressed using a single load generator. I'm looking for a method similar to th... |
I am trying to design a context-free grammar for the language $L = \{a^ib^jc^k \mid i\neq j+k\}$ over the alphabet $\Sigma = \{a,b,c\}$.
I know that I can split this up into the union of two cfg's $S_1$ and $S_2$,
where $S_1$ is the case where $\#_a \lt \#_b + \#_c$,
and $S_2$ is the case where $\#_a \gt \#_b + \#_c$.... |
I need some help understanding the problem statement in CLRS 11.3-4 pg 269. It says:
Consider a hash table of size $m = 1000$ and a corresponding hash function
$ h(k) =\left \lfloor m(kA \bmod 1) \right \rfloor $
for $A = (\sqrt5 - 1)/2$. Compute the locations to which the keys
61, 62, 63, 64, and 65 are mapp... |
consider a program that generates a random walk using a PRNG, as in following pseudocode. it uses arbitrary precision arithmetic such that there is no limit on variable values (ie no overflow).
srand(x)
z = 0
while (z >= 0)
{
r = rand(100)
if (r <= 50) z -= 1
else z += 1
}
the PRNG is inited with seed x (also ar... |
Here is a definition from the functions section in my discrete math textbook (Discrete Mathematics and its Applications 7e, Rosen 2012):
Let $f$ be a function from $A$ to $B$, and let $S$ be a subset of $A$. The image
of S under the function $f$ is the subset of $B$ that consists of the
images of the elements of $... |
I have asked this question in StackOverflow. I was asked to move in here. so here it is:
I need some clarifications and inputs regarding Dijkstra's algorithm vs breadth first search in directed graphs, if these are correct.
Dijkstra's algorithm finds the shortest path from Node A to Node F in a weighted graph regardles... |
Im in a functional languages computer science class and I have a question on the use of the kleene star and the Union in a context free grammar.
for the kleene star I have an idea of how I might do it.
for example
{0^n 1^n | n in the set of natural numbers}
I think it would look something like this.
S-> 0S1 | ... |
I'm given this problem:
Consider the following closest-point heuristic for building an approximate traveling-salesman tour. Begin with a trivial cycle consisting of a single arbitrarily chosen vertex. At each step, identify the vertex u that is not on the cycle but whose distance to any vertex on the cycle is minimum.... |
Consider the linear programs
\begin{array}{|ccc|}
\hline
Primal: & A\vec{x} \leq \vec{b} \hspace{.5cm} &
\max \vec{c}^T\vec{x} \\
\hline
\end{array}
\begin{array}{|ccc|}
\hline
Dual: & \vec{c} \leq \vec{y}^TA \hspace{.5cm} &
\min \vec{y}^T\vec{b} \\
\hline
\end{array}
The weak duality theorem states that
if $\vec{x}... |
I have basic background (at the level of Sipser's book),
but am looking to brush it up and get to the more advanced part via self-study.
I have two Computational Complexity books (Arora and Barak and Papadimitriou's).
I am looking for good lectures (online), exercises etc., possibly coursera style,
for a faster progre... |
I'm having trouble understanding the mechanics of the midpoint algorithm. I understand the gist of what it does; it keeps us within a half a pixel of where the actual line should be printed. It does this by updating this $d$ value for each pixel that we traverse.
However, even after drawing some samples and observing ... |
There are many solutions on the web showing that the subset-sum problem is polynomial time reducible to the set-partition problem. However, during my search, I came across the following powerpoint presentation (slide 12), where it says that the inverse is also true. i.e. the set-partition problem is polynomial time red... |
I have a distance to get to, and square tiles that have a cost and length. EX: a 1 unit block that costs 1 unit to purchase.
So if I was trying to get 10 units away. I would require 10 of the 1 unit blocks at that point for a total cost of 10.
So another example would be a distance of 10 units away except I have two ti... |
This question is a follow up to the question: Proving Equivalence of 1-dimensional Cellular Automaton and Turing Machines.
To simulate a CA with a TM, I used a construction which placed a marker on the ends of the input, and modeled each "step" with the transition function. Assuming that $\rho(\text{''blank''}, \text{'... |
I am trying to prove:
Let there be a constructible function $t: ~\mathcal{N} \to \mathcal{N}$. Then there exists a language $L$ where $L$ is decidable by an LBA in $O(t(n))$ time, but not $o\left(\frac{t(n)}{\log t(n)}\right)$ time. You may assume that LBAs have a fixed tape alphabet and have unique symbols marking th... |
Given a $n\times n$ matrix A[0...n-1][0....n-1] where all entries are non-negative integers, and a non-negative integer K, I want to find the number of submatrices whose entries sum to K.
The best solution I can find has $O(n^4)$ running time. Any ideas how to improve the running time?
|
I have a practice exam question that I don't know how to set up a recurrence for. It is dealing with a hash table. The question is as follows:
Suppose that a hashing strategy is designed so that it starts with an initial hash table size of $H= 8$. You may assume that only insertions are performed (no deletions).
Any t... |
Does the term schema, in the context of describing a structure, refer to the actual structure of the data, or the description of this structure? I.e. can I talk about the schema of an entity without a schema language?
For example, suppose I am writing documentation for some JSON API, that always returns a particular st... |
I want to prove that if P = NP, then there is a polynomial time algorithm for finding the largest clique in an undirected graph.
I understand how to use a verifier to find this but my issue is since P = NP it doesn't want me to use a verifier. I'm not sure how to approach this.
|
How to convert the below formula to CNF?
$\lnot(x \oplus y \oplus z\oplus a)$
|
I participated in one algorithmic competition. I got stuck in one problem, I am asking the same here.
Problem Statement
XOR-sum of a sub-array is to XOR all the numbers of that sub-array.
An array is given to you, you have to add all possible such XOR-sub-array.
Example
Input
Array :- 1 2
Output :- 6
Explanation
F(1, 1... |
If we consider polynomial-time (or log-space) computable reductions $<_p^m$ as transformations between computational problems, then the following definitions of known complexity classes suggest the conservation of information under "efficient" transformations. Assuming $P\ne NP$, it seems that information flows only f... |
Suppose one wants to use a μ-calculus model checker, but specify things in temporal logics, which is easier (more intuitive). Is there a technique (even better, a tool) that automatically translates formulae in any of these logics (CTL,CTL* or LTL) to the μ-calculus?
Thanks very much in advance!
|
It is well known that in Descriptive Complexity Theory FO is equivalent to AC0.
However, this accepts a couple of a theory and a string <T,s> iff the interpretation of s as a query is satisfied by the theory T.
My question now is if there is an interpretation of which is stronger than AC0. For example, is there an inte... |
I am wondering this statement above [the title] is true or not.
Here is what I've already had : non-recursive means undecidable.
I've read this Are all infinite languages undecidable?
which says:
If a Language is undecidable(non-recursive), there must be some strings make the TM fail to halt.SO IT MUST HAVE INFINITE OF... |
Symmetric/Metric TSP can be solved via the Held-Karp algorithm in $\mathcal O(n^2 2^n)$.
See A dynamic programming approach to sequencing problems by Michael Held and Richard M. Karp, 1962.
In Exact Algorithms for NP-Hard Problems: A Survey (PDF) Woeginger writes:
This result was published in 1962, and from nowadays p... |
First I apologize if I confused therms DFA and FSM, to me it seems that is the same thing. The question is simple: Are the flowcharts (sequence, branching and jumping) equivalent to DFA resp. FSM? I am a bit confused about this. There are classes where using logical synthesis, Karunaugh maps, state encodings, flip flop... |
Let $\{a_i\}$ and $\{b_i\}$ be non-decreasing sequences of non-negative integers.
How fast can one find
$$c_j=\max_{0 \leq i< j}\{a_i+b_{j-i-1}\}$$
for all $0\leq j\leq n-1$?
Naively, it takes $O(n^2)$ time, but I'm hoping monotonicity can help here.
It's easy to observe $\{c_i\}$ is also non-decreasing. If we conside... |
I'm working on some questions to bone up on my knowledge of DFA's for a computing class and I've run across the following problem that is giving me some issues. If we have some
DFA M = (Q, Σ, δ, q0, F) and some other DFA M' = (Q, Σ, δ, q0, F') where F is a proper subset of F', are the following relations possible or n... |
Given N finite subsets of the finite universe set E, it is necessary to find the intersection which contains maxumum number of subsets. Let call this problem MSI (Maximum Subset Intersetion).
Firstly I had thought that it is variation of well-known Maximum Clique Problem where vertices are subsets and edges are relatio... |
CS sometimes seems take for granted that $\mathcal O(\text{poly}(n))$ is "easy", while $\mathcal O\left(2^{poly(n)}\right)$ is "difficult". I am interested in research into "difficult" polynomial-time algorithms, where the best-case solution to the constructed problem runs in $\Theta(n^c)$, where $c$ can be chosen to b... |
I know how to figure out the start state, accepting state, input alphabet, and all that stuff. But how do you develop the transition relation of a PDA? For an FSM, (q0,a),q1) means if you start at q0 and get an a, you transition to q1. But what does (S,a,e),(S,a) mean? (S is start state and e is epsilon)
Here's a pictu... |
I came to know that the graphic processing unit have something called memory coalescing. On reading on it I was not clear on the topic. Is this any way related to Memory Level Parallelism.
I have searched in Google but was not able to obtain a satisfactory answer.
It would be helpful if someone gives a more comprehens... |
In order to prove a certain function to be partially computable, I need to show an $\mathbb S$-program that computes it. I could really use the predicate $X \in B$ in my program to draw my conclusion. To give you the idea of what I am dealing with here it is one of my problems:
Give an infinite set $B$ such that $\Phi... |
When using the pumping lemma for a context free language, if I write any $w \in L$ as $uvxyz$, is my goal to show that a string will not pump for ANY arrangement of $uvxyz$ that I choose, or is my goal to show that THERE EXISTS some arrangement of $uvxyz$ over $w$ that will pump?
|
I came across this question was I was browsing online
An operation OP has the following characteristics
OP Latency = 7 clocks
OP cycles/issue =2
Derive the minimum number of cycles required for the following computation:
X[0] OP X[1] OP X[2] OP ....... OP X[N-1]
The answer was written as 7 + 2(n-2). But I w... |
I've been told it is possible to find a solution to this optimization problem in $\Theta(n)$ but I still don't know how I could do it. I did find easily a solution in $n\lg (n)$ though. I only need to have a VALID solution, not the optimal.
This is the problem :
Let say you have n tasks that have a start time and a max... |
I am implementing a learner to learn a DAG model $G=\langle V,E\rangle$ where $V$ and $E$ represent both variables and dependencies respectively ( similar to Bayesian networks). Each variable $v\in V$ is associated with possible values (domain) $D_v$ and a function $\theta_v$.
I assume the learner knows the number of v... |
The syntax of dice notation follows the following grammar:
$$ Roll \rightarrow Dice | Dice'x'Int | More \quad Mod \quad More $$
$$ Dice \rightarrow Int_{1}'d'Int_2$$
$$ Mod \rightarrow '+'|'-'$$
$$ More \rightarrow Int | Roll$$
$$ Int \rightarrow <integer>$$
Give a leftmost derivation for the sample string:
$3d8 + 2d4x... |
One can, for example, represent 2d arrays such as:
[[1,2],[3,4],[4,5]]
as flat arrays:
[1,2,3,4,5,6]
as long as he transforms the indices before accessing:
index(x,y) = x + y*2 // because internal width=2
This is often faster. My question is: is it possible to use a similar approach of representing an structure as a... |
The typical and widely used PRNG, the linear congruential generator always has a finite (though possibly "long") period. Are there PRNGs that have no finite period?
For this question it is not necessary that it be practical or used in real-world implementations.
|
I'm trying to understand how LZW decodes a string.
For example suppose that we have a dictionary where:
a=0
b=1
and we have to encode the string "aabbabaabb", so the output of the encoding process (if I have not made mistakes) produces the string "0011324" and the dictionary became(using a tree representation):
(sou... |
I would like to determine interests or hobbies that people have given their Twitter timeline data. Their timeline is their historical collection of tweets.
The result I am trying to achieve is to automatically label a user with a collection of interests such as:
Finance
Photography
Android Development
I have tried ... |
Persistent data structures are immutable data structures. Operations on them return a new "copy" of the data structure, but altered by the operation; the old data structure remains unchanged though. Efficiency is generally accomplished by sharing some of the underlying data, and avoiding full copying of the data struct... |
During the process of deadlock detection, the wait-for graph can be obtained from the resource-allocation graph. To detect whether there is a deadlock using the wait-for graph, can topological sort be used?
By making a slight modification, i.e., instead of removing the source as done in usual topological sort, we can ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.