instruction
stringlengths
35
29.1k
I have to train a SVM for a classification problem. I have some strings that are the paths in a deterministic finite automata (DFA). If the alphabet is -01- then possible strings are 011101110 or 0110 for example. The purpose of classifier (SVM) is the correct prediction (label) of unseen strings like accepting or r...
I'm trying to understand a paper (Tandem Networks of Universal Cells, Butler, 1978 1), but I can't make it past the first paragraph: Consider the $x_l … x_{k - 1} | x_k$ partition matrix of a function $f( x_1, x_2, …, x_k)$, as shown in Fig. 1, where $C_0$ and $C_1$ represent the $x_k = 0$ and $x_k = 1$ columns, res...
A question from chapter 3 of Michael Nielsen's [Neural Networks and Deep Learning]: It's tempting to use gradient descent to try to learn good values for hyper-parameters such as the regularization parameter $\lambda$ and the learning rate $\eta$. Can you think of an obstacle to using gradient descent to determine val...
I'm coding a program to calculate the value of $e^x$ by using the Taylor expansion, that is: $$ e^x =\sum_{k=0}^\infty \frac{x^k}{k!} $$ from math import factorial def e_x(x, n): return sum(pow(x, k)/factorial(k) for k in range(n)) Edit: Python seems to handle large integers pretty well so I'm more interested in t...
I've read in multiple articles and books that the computation of a cycle cover for a given graph is possible in polynomial time, since this problem can be viewed as the assignment problem, which is a special type of matching problem. It's written in the Algorithmic Aspects of Bioinformatics (Spring-2007) and in the Min...
I'm taking a fairly challenging Algorithm course, in which we are learning about algorithms such as Dijkstra, Bellman-Ford etc. as well as the algorithm design patterns such as recursions, DP and various graph construction techniques such as layering. Now I really have some trouble to design correct and efficient algor...
This is Exercise 2.11 of the book "Computational Complexity: A Modern Approach" by Arora and Barak. Mathematics can be axiomatized using for example the Zermelo-Frankel system, which has a finite description. Argue at a high level that the following language is $\text{NP}$-complete. (You don't need to know anything ab...
According to the polynomial-time-reduction definition "If problem $Y$ can be reduced to problem $X$ in polynomial time, we denote this by $Y \leq_p X$." If $X$ is one of already known NP-complete problem then we can say that $Y$ is NP-complete. From my understanding, $p$ should be always polynomial and this cannot be a...
Using dyadic intervals, I can build a binary tree for $\left[0,+\infty\right)$ by having a node the $i$-th at level $l$ representing the range $\left[i\cdot2^l,(i+1)\cdot2^l\right)$ and has the $(i)$- and $(i+1)$ at level $l-1$ as children. I would like to build a similar tree for $(-\infty,+\infty)$, but it is not cle...
I'm having some problems in understanding the two alternative definitions of NP. They're presented as equivalent, but to me they seem to define different class of problems. Intuitively, we can think of a non-deterministic TM as branching at every step to check all possible alternatives in parallel. Also, we can see it ...
There are many examples of trade-offs in computer science. The space-time trade-off is a well-known one. Often an increase in memory use can lead to faster execution time, and vice-versa. Caching results that are computed or fetched from some storage increases memory use but avoids repeating the same time-consuming tas...
Suppose we want to use a reduction of 3-colorability to a certain problem to prove said problem is NP-c. But to pull off the reduction, one needs to take a graph-class for which 3-coloring is NP-c and for a given input graph decompose its edges into as few independent groups as possible - basically edge-coloring the gr...
For a regular language $L$, is $\{xy^Rz:xyz\in L\}$ regular? [Where $w^R$ is the reverse of $w$] My intuition says it is, as for a regular $L$, the languages $L^*$, $\{y: xyz\in L\}$ and $L^R$ are all regular languages, but I wasn't able to build a DFA/NFA for it, as if I try and "guess" from where to reverse the wor...
An independence system is a collection $I$ of subsets of $\Omega$ such that if $A\in I$, then any subset of $A$ is in $I$. These sets are called independent. Suppose I have an oracle for testing independence. In particular I have an ambient set $\Omega$ and an independence system $I$ of subsets of $\Omega$. I pass a su...
Suppose I have a task to write an algorithm that runs through an array of strings and checks if each value in the array contains s character. The algorithm will have two nested loops, here is the pseudo code: for (let i=0; i < a.length; i++) for (let j=0; j < a[i].length; j++) if (a[i][j] === 'c') do s...
REGULARTM is defined as below: REGULARTM ={〈M〉| M is a TM and L(M)is a regular language}. I am trying to understand the proof of REGULARTM being undecidable from Sipser's book "Introduction to the Theory of Computation". The book says: We let R to be a TM that decides REGULARTM and construct TM S to decide ATM. Then S...
I'm trying to implement an SMA* graph search algorithm that I found in a paper here(Rong Zhou, Eric A. Hansen: Memory-Bounded A* Graph Search. FLAIRS-02 Proceedings 203-209) and I would like to clarify my understanding of the pseudo-code found in the appendices, specifically the set builder notation used: What I under...
I have a graph which looks something like below I am searching for a given string s going down such that at every node it makes a decision (either to visit the left node or right). The code goes something like this. String s=input; Node CurrentNode=start; int rightSubstringIndex=-1; int leftSubstringIndex=-1; while(...
I'm wondering if there are any useful functions asymptotically greater than a polylogarithmic function and less than a polynomial function. That is, a function $f(n)$ such that $f(n) = \omega(\log(n)^k)$ for some constant $k > 0$ and $f(n) = o(n^k)$ for some constant $k > 0$ What I mean by useful, is that it was used ...
Is it possible for an ordinary Turing Machine, for some input x, to run for an infinite number of steps but also halt? Or do we say that Turing Machine does not halt on x?
It's already known that size doesn't matter always (for SAT problems). But is there evidence (from real data from: benchmarks or real cases) on how many clauses an average SAT solver can handle nowadays? Another issue that derives is that once they find a solution, most don't stress the fact about finding alternative ...
From Sipser, Language A is mapping reducible to language B, written $A \leq_m B$, if there is a computable function $f : \Sigma^* \rightarrow \Sigma^*$, where for every $w$, $w ∈ A \Leftrightarrow f(w) \in B$. The function $f$ is called the reduction from A to B. A function is injective if every element in the co-domai...
Consider a partially observable Markov decision process (POMDP), see here for a complete definition. My question is in relation to the conditional observation probabilities (denoted by $O(o|s',a)$ in the above link). This represents the probability of seeing observation $o$ if the current state is $s'$ and the action w...
Suppose we have $n$ lines $L_1, L_2, \dots, L_n$, where $L_i$ has the equation $y = a_i x + b_i$. We call $L_i$ the highest line at $x_0$ if for each $j \in \{1, 2, \dots, n\}$ $$a_i x_0 + b_i \ge a_j x_0 + b_j.$$ Goal: Find an algorithm in $O(n \log n)$ time to return a set of lines that are the highest lines in at l...
I have a data set that uses a very simple modulo 10 checksum algorithm which ignores alphabetic characters entirely. Which wasn't a big deal, as the few alphabetic characters present weren't critical. Changes to the data format are upcoming, including characters which will now be critical to the interpretation of the...
In a an exercise I'm required to analyze the runtime of recursive function: foo(n) for i from 1 to n work() // O(1) foo(n-1) end for end foo The recurrence relation I understand from the code is: T(n) = n*T(n-1) + n But I'm failing trying to analyze it using the iterative method since I d...
The Calculus of Constructions is a very simple core functional language with dependent types. Per curry-howard isomorphism, it could, potentially, be very useful for writing programs and proofs. It, though, has a few problems: induction isn't derivable, it isn't possible to prove 0 != 1, and pattern matching on algebra...
Suppose that $G = (V,E)$ is a directed graph such that each vertex in $V$ is in at least one edge in $E$. We'd like to decide whether or not $w$ watchmen can be placed on $w$ distinct vertices in $G$ such that every vertex in $G$ is being "watched" by some watchman. More formally, we'd like to decide whether there exis...
I was looking https://stackoverflow.com/questions/16369714/transform-a-simple-directed-graph-to-a-simple-undirected-graph , but i couldnt really understand the thought process behind this. Please help me.
I have following grammar: $$A \to a A a \mid \varepsilon$$ This grammar is not ambiguous because it has no more than one parse tree from the any sentence generated by this grammar, but there is a shift-reduce conflict in LR(1) on this grammar. Why does there exist an conflict even though it is not ambiguous grammar?
I understand that Halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running or continue to run forever. That is, there are two options for HP: Halt (accept/reject) OR loop. With this definition of HP, I am unable to understa...
I am currently working on image classification methods. One group of preprocessing methods are color space transformations. While there are "traditional" color spaces like RGB (the raw data), HSV, LUV, XYZ, ..., I see any function $$f:[0, ..., 255]^3 \rightarrow [0, ..., 255]^3$$ as a transformation from one color spac...
i am trying to solve a graph based problem , this is the statement: i have to find shortest route from position marked (s) to position marked (S) [Note : i marked S and E just for ease of understanding]. here is the catch in problem i can go only through cells marked 0 and cells marked 1 represents walls which are impa...
Is the following problem NP-hard: Input: $A\subset\mathbb Z, k\in\mathbb N$ Question: is there a multiset of indices $I$, such that $|I|=k$ and $\sum_{i\in I} a_i=0$? For example, on the input $A=\{-1,2\}, k=3$ we can take $I=\{1,1,2\}$ and thus we get $|I|=3$ and $a_1+a_1+a_2=(-1)+(-1)+2=0$, as desired.
I'm studying the SIFT algorithm and I have some problem understanding its operation, in particular I don't understand how the results vary according to the parameters: number of octaves, number of levels and sigma0. I've read Lowe's original paper and I've done searches online but I still have doubts, I hope you can so...
This is a special case of the question: Counting permutations whose elements are not exactly their index ± M The $M=0$ case has already been solved, but no one was sure how to work out the non-zero cases. So I decided to try to just brute force some values and search the results for a recursion relation. As a test I ...
(Shortest Common Superstring: Input: A set S = {s1, . . . , sn} of strings over an alphabet Σ. Feasible solutions: Each superstring w of S, i.e., each string w that contains all strings $s_i$ ∈ S as substrings. ) I just finished implementing cycle cover superstring algorithm, but step 4 and 5 just doesn't make sense to...
Knowing that NFA-minimization has been proven to be P-SPACE complete, what if there is a polynomial-time algorithm to minimize NFA? Does that imply that P = PSPACE?
I was just looking into properties of languages and wondered about the cardinality of them are all recursive languages countable or can they also be uncountable (can u have a recursive language which is uncountable?) can r.e languages be countable and uncountable? (can u have a r.e but not recursive language which is ...
I've been struggling to understand why the interactive proof for #SAT stops after only $m$ rounds, where $m$ is the number of variables in the formula $\phi$. I understand that two polynomials of degree $d$ can agree for at most $d$ values. As the proof in the Sipser text goes (which I believe is the standard proof), t...
I need to design a turing machine that accepts $L=\{ww^Rw\mid w\in\{0,1\}^*\}$. $w^R$ is the reverse of $w$. I don't have a good idea yet how to do that, I know I should check: the length of the word must be equal $0\mod 3$ $ww^R$ is a palindrome the prefix $w$ equal to the suffix $w$. I thought maybe to divide ...
So I've got this so far to try and wrap my head around the abstract idea of a semaphore: A semaphore is a variable or abstract datatype (commonly an integer), used to control access to a common resource by multiple processes in a concurrent system. I'm not sure that this definition fully encompasses the full idea...
I am new to theory of computer science and I am currently reading about CTF grammars. In our lecture we defined that a Type 1 grammar is context-free if for $w_1 \to w_2$, $\vert w_1 \vert \leq \vert w_2 \vert$. I looked on the internet for an example and found this context-free grammar for palindromes: $G = \{\{P\},\{...
I'm implementing a Column Generation algorithm. The pricing problem, in general, find more than one column with negative reduced costs(the master is a min problem). If i add only the most negative reduced cost column per iteration, at the end i have a linear relaxation with $Z = 8240.3$. When i tried adding all the col...
In a question I had asked earlier, I was interested in knowing whether we could decide in polynomial time whether, for a directed graph $G$ with every one of its vertices belonging to an edge, a size-$w$ watch set, with $w$ at least half the number of vertices in $G$, exists (see the linked question). Several users sho...
I have one query, Operating system (In machine language) as I study is the combination of opcodes that executes, Now, the opcodes are dependent on the instruction set architecture like how and which opcodes are executes. There are number of architectures such as RISC, CISC, Intel x86 which by sure have different opcode...
If there is a transition with no input in the FA, when it is converted to a regular expression should it be accepted as ɛ transition? As an example picture shown below, should regular expression showing possible transitions between 1 and 3 (1-2-3 , 1-3) be accepted (ab+ɛ) or just ab?
Why does (if so) the seperator $\#$ is making a difference between the two languages ? Let say: $L=\{ws : |w|=|s|\, w,s\in \{0,1\}^{*}, w \neq s \}$ $L_{\#}=\{w\#s : |w|=|s|\, w,s\in \{0,1\}^{*}, w \neq s \}$ Here is a proof and a grammer representing $L$ as a $CFL$ And below Im adding a proof for $L_{\#} \notin CFL$ ...
Question : Are my Justifications Correct? Pumping Lemma $A = \{0^n1^n \mid n \geq 0\}$. Prove $A$ is not regular : Suppose $S = 0^p1^p$ and $p = 3$. Therefore, $S = 000111$. Breaking $S$ into $xyz$ Case 1 : $y$ is in the $0's$ part. Therefore, $xy^iz \notin A $ for $i = 3$, because if $i = 3$, then $S_i = 0 000 111$ T...
Carter and Wegman introduced in the paper Universal Classes of Hash Functions the $H_{1}$ universal class of hash function. This is essentially the function $h_{a,b}(x) = ((a\cdot x+b)\mod p)\mod m$. I am using here the more common notation from CLRS book respective description, and not from the paper. Some notation: ...
It seems that non-deterministic Nick's Class (NNC) would be the same as non-deterministic polynomial time, but I haven't been able to find anything on NNC.
let's consider that we already have constructed heap array. so from this, when we do heap sort, the number of elements that have to be sorted decreased. I mean heap decrease.(which also means heap tree level decreases -> downheap operation level decreases but nlogn means each n nodes has logn operation. But not all nod...
There are two commonly mentioned partition methods: algorithm lomuto_partition(A, lo, hi) is pivot := A[hi] i := lo - 1 for j := lo to hi - 1 do if A[j] ≤ pivot then i := i + 1 swap A[i] with A[j] swap A[i+1] with A[hi] return i + 1 algorithm hoare_partition(A, lo, hi) is pivot := A[lo] i := lo...
I read a commonly known proof of transitivity of logspace reduction: Lemma 6.: http://www.cs.au.dk/~arnsfelt/CT10/scribenotes/lecture5.pdf . In this proof it is used following trick: Let some turing machine $M_f$ for language $f$ compute only $j$-th bit of output. Ok, $M_f$ is logspace machine, however tape with outp...
Many (tensorflow) implementations of batch normalization seem to use moving statistics at its inference phase (R2RT, tf.contrib.layers.batch_norm). But in the algorithm from the original paper, they use population statistics in the batch normalization function. The thing is, pardon me, I don't understand why most of...
The PDA has to recognize the language $L = \{w\in \{a,b,c\}^* \mid |w|_a = |w|_b$ or $ |w|_a=|w|_b\}$. Currently I have an automaton which recognises that language if $|w_a|=|w|_b$ xor $|w_a|=|w|_c$. It looks like this: It is xor because it is going to empty the stack before it could check next letter's occurence. My...
Let $L \subseteq \Sigma^{\ast}$ with $\Sigma = \{0,1\}$ be the language such that two times the number of $1$'s in a word in $L$ plus the number of $0$'s is divisible by $3$, i.e. if we denote by $|w|_1$ the number the symbol $1$ occurs in $w$ and by $|w|_0$ the number the symbols $0$ occurs, then $$ L = \{ w \in \Sig...
Yo! This is probably a stupid question, however I've never seen it written down explicitly if, for instance, decidability of type-checking is equivalent to the strong normalization property. Therefore I'm asking this question to clarify all possible relations between type-checking, typability and strong normalization. ...
The eccentricity of a vertex v is the length of the shortest path from that vertex to the furthest vertex from v in an undirected graph. The diameter of an undirected graph is the maximum eccentricity of any vertex. The radius of an undirected graph is the smallest eccentricity of any vertex. A center is a vertex whos...
I was going through the questions in MIT quiz : Question 2 g and I found this How is $ n^{log(n)} > n^c $ always for any c ? what if c > log(n) ?
I am designing an algorithm that solves a linear system using the QR factorization, and the matrices I am dealing with are sparse and very large ($6000 \times 6000$). In order to improve the efficiency of the algorithm, I am trying to exploit the sparsity of the matrix by finding its bandwidth, but I have to run throug...
How to compute the run-time of distributed algorithms in message passing systems? I was reading across and found it very weird that any computation done in each node is considered to take $\mathcal{O}(1)$ time due to the unreliability in the time it takes to pass messages. Since this approach is not practical at all, I...
Does there exist an equivalent arithmetic circuit for each computable function? I've been trying to wrap my head around the statement above, but haven't found a counter example although I believe the statement to be false. What has made me curious is that I've read some theorems stating that a protocol (cryptograhy ...
I understand the rule says that overflow cannot happen for two's complement addition of numbers with different signs, but do not understand why this specific case does not cause overflow: 1001010 +0010101 -------- 1011111 Am I simply misunderstanding the actual rule or missing a step somewhere? Thanks in advance! ED...
I'm kind of new to automata theory and I'm dealing with the equivalence classes used for example in the Myhill-Nerode theorem right now; in other words aba* / a = ba*; aba* / b = ⌀, and such. In an exercise I'm asked to find a language defined by an infinite set of equivalence classes, but where each class is actually ...
I have the language $L = \{w ∈ \{0, 1, 2\}^∗ \mid \text{the number of 1s in $w$ is odd}\}$. I am stuck halfway through this process. I have $$ \begin{align*} &A \to 0A \mid \epsilon \\ &B \to 2B \mid \epsilon \\ &C \to AB \mid BA \end{align*} $$ This should take care of 0s and 2s. Now I have this, but I'm ...
I studied algorithm for converting grammars to GNF and was wondering about a proof that any CFG can be converted into GNF. I found this paper - ENGELFRIET, Joost. An Elementary Proof of Double Greibach Normal Form, 1992, but I do not understand the proof at all. Any CFG can be converted into CNF, so we try to prove t...
How can I encode an ascii string in base 15? In other words, I have the following characters available: 0123456789abcde I have no idea how to do this. What do you suggest I do? (If this is not on-topic, please migrate.)
Let $A$ and $B$ be NP-hard problems. For all tuples $(A, B)$ does there exist a polynomial time reduction from $A$ to $B$ and from $B$ to $A$? Context: I want to prove some problem is NP-hard. Can I pick any problem in NP-hard to reduce from?
Question: Given the alphabet $\{a, b, c\}$, how many words can we form with 4 letters? And how many words can we form with up to 4 letters? I was thinking about the logic behind this and came up with this: perhaps the number of words that can be formed with 4 letters is $4^3 = 64$ words. Is that correct? I could not th...
I have been doing dynamic programming problems, and I came across a palindromic substring question. I answered it quickly, and found an $O(n)$ dynamic programming solution, but when I check the actual solution, I find that I should be getting an $O(n^2)$ result. Can someone explain where I am going wrong/how this is...
I'm currently studying computer architectures module, and during the workshop I came a across a series of questions that I struggled to being to answer. The question goes; *You have an L1 data cache, L2 cache, and main memory. The hit rates and hit times for each are: 50% hit rate, 2 cycle hit time to L1. 70% hit rate,...
The center of a graph is the set of vertices with minimum eccentricity, so a $C_n$ have the minimum eccentricity equals to $n$ and a $K_n$ have the minimum eccentricity equals to $1$? Is valid that a center of a graph be the graph itself?
R-Trees can take several paths to retrieve an item because of overlaps in data being indexed or index structure. However, if we run the same search many times on the same unmodified structure, can we remember the correct path and avoid taking the wrong path? Maybe caching the correct path? But I'm not so sure that R-T...
According to the Wikipedia page on static-single assignment (SSA), SSA is used by large and well-known projects such as LLVM, GCC, MSVC, Mono, Dalvik, SpiderMonkey, and V8 while the page on projects using continuation-passing style (CPS) is a bit lacking in comparison. I have this notion that CPS is preferred by compil...
Given an $n \times m$ Boolean matrix $\mathrm X$, let $0$ entries represent the sea and $1$ entries represent land. Define an island as vertically or horizontally (but not diagonally) adjacent $1$ entries. The original question was to count the number of islands in a given matrix. The author described a recursive solu...
I have been trying to find the upper bound on the runtime of the 'Risch algorithm' used for finding the integral of mathematical functions, but have been unable to do so. https://en.wikipedia.org/wiki/Risch_algorithm Does anyone know where I would be able to find the runtime of the 'Risch Algorithm'?
I have a list of pairs like (regex, substitute) that take quite long to apply to some input text so I was thinking about optimizing them a bit. From my knowledge for each regular expression there is a deterministic finite automaton that accepts the same language, and as its possible to merge DFAs merging two regex shou...
We define $\mathbf P$ as the set of problems solvable in polynomial time. We define $\mathbf{NP}$ as the set of problems with a verifier $ \in \mathbf P$. Is there a name for problems whose verifiers are $\in \mathbf {NP}$ (e.g., $\mathbf{N(NP)}$)? I can't see this being a very useful complexity class, but, for example...
Considering that there no cycles in the graph. I have seen the posts where the negation of the weights is suggested and to use Bellman-ford. But I was wondering if the inverse is possible.
The following quote is from the book "The art of computer programming": (..) sentence would presumably be used only if either $j$ or $k$ (not both) has exterior significance. In most cases we will use notation (2) only when the sum is finite - that is, when only a finite number of values $j$ satisfy $R(j)$ and have $...
I'm looking at Wikipedia's pseudocode implementation of A* and found myself wondering about what they call openSet. That is, the neighbours we've seen, but not yet analyzed. The first part of the outer loop reads: current := the node in openSet having the lowest fScore[] value And this makes sense to me, as I intuiti...
I have a complex data structure DS that needs to be checked for validity against several rules. If invalid, the DS has to be corrected. The correction with respect to one rule could result in an invalid state of DS again. There are n rules to check the data structure. If DS is valid for all rules, DS is valid. If DS i...
I am writing some firmware for a display that will take measurements and present them in real time on an LCD screen. I would like for the measurements to display as smoothly as possible... What I mean is that I am looking for a smooth animation sequence on the display, such that values don't jump from say 15.1 to 15.8....
The keys 2, 4, 6, 7, and 8 have been inserted, one by one, in some unknown order, into an initially empty BST. The result is this BST: There are 120 different permutations of the five keys, but not all of these would lead to this particular BST being built. How many of the permutations will generate this particular ...
Let's say I have 2 graphs $g_1$ and $g_2$, each determined by a set of nodes and a set of non-oriented edges. I also have 2 operations that can be done on a graph: edge contraction and node split: Nodes have a position so it is possible to do the operation as specified on the figure, and we can assume that the neighbo...
I am trying to prove that there exists logspace deterministic Turing machine that check if exists path between first row and last row in grid graph. Grid graph is matrix of $0s$ and $1s$, the undirected edge exists between two $0s$ or $1s$ - one the left, right, up, down. Path can contains only $0s$ or only $1s$. ...
Is there a data structure that efficiently supports the following operations? Add set Query whether any subset of a set has been added. This could be implemented with linear overhead by testing every added set during every query. Can it be implemented more efficiently? Small probabilities of false positives/negatives...
Given an interval set $X = \{(s_1, e_1), \dotsc, (s_N, e_N)\}$ ordered such that $s_i \leq s_j$ and $e_i \leq e_j$ for all $i < j$ and an integer $b$, I would like to find a maximum sized subset $X' \subseteq X$ such that $\text{end}(X') - \text{start}(X') \leq b$. Here the $\text{start}, \text{end}$ functions are defi...
First, sorry if this post is off-topic. I consider it too analytic for stack overflow. In Numerical Analysis subject I must explain which one is better (has less error). The recursive implementation seems to be better with the inputs I have used, but I don't know the reason. Can someone explain to me which one is be...
I'm reading through a commentary on Milner's "The use of machines to assist in rigorous proof" by Mike Gordon. In this paper, he explains how LCF was born from the ideas of denotational semantics by Dana Scott and Strachey. It seems to me that Floyd-Hoare logic wasn't enough for developing LCF, but I'm not sure why th...
Given an unsorted set of tuples $(c, w)$ and a threshold value $W$, I want to select $k$ tuples such that: $$ maximize\sum_{i=1}^k c_i \\ \sum_{i=1}^k w_i \ge W $$ It seems pretty simple at first. Without the weighting constraint, you can use any selection algorithm to select the $k$ elements with largest $c$. But with...
Help me demonstrate this or there is a counterexample? Let $T(V,E)$ be a tree with $|T| \geq 2$ and a path $P{(u_0,u_1,u_2,...,u_n)}$. The longest path in a tree has $d(u_0) = d(u_n) = 1$.
Suppose Bob has a messaging network (which is a graph), where a message travels from a vertex V to its adjacent vertex U. However, the messaging network is very unreliable, and the probability that the message sent from vertex V will fail to reach an adjacent vertex U is PROBABILITY(U, V). How to find a path where ther...
I am trying to generate random sentences from a context-free grammar. During each step, the next non-terminal to be generated is determined according to some probabilistic criteria irrelevant to this question. Where I am stuck is, given a grammar and the partial sentence generated so far, how do I determine the set of ...
The seminal work by Viola-Jones had the most impact in face detection. It used Haar-Feature, which is fast to compute with the help of integral image method. Is there a feature method that is more efficient (computationally) than Haar-Feature? For example, for a $24 \times 24$ window, the computational complexity is ...
How to prove that Set Cover can be polynomial-time reduced to CNF-SAT?
I'm puzzled by a short paragraph found in the article on Stochastic Processing in Wikipedia. There it says: Bundle Processing involves sending a fixed number of bits instead of a stream. One of the advantages of this approach is that the precision is improved. To see why, suppose we transmit $s$ bits. In regular stoch...
Let $L$ be the language of all the words with the shape $<M_1,M_2,w>$ such that $M_1,M_2$ are turing machines that accepts $w$, show that $L$ isn't decidable. I thought to use reduction from $L_{TM}=\{<M,w>\mid M \text{ accepts } w\}$ how can I defined the function $f$ ?
I have a predictor method that takes differential equations for 214 biological species and integrates them in time using positive time steps. Right now it is able to successfully integrate the differential equations when the time step is positive, so it can integrate forwards in time and I was looking to see if it cou...