instruction
stringlengths
35
29.1k
I have a set of nodes S where all the nodes of an arbitrary integer value. I Also have a set of pairs of nodes from S, indicating that those node cannot be in the same subset. Given a subset of S, how can I determine the largest possible Sum of that subset taking into account the exclusion pairs. Example: S = (x1:50,...
The setting An argument from a set of formulas $\Delta$ is a pair $\langle \Phi, \alpha \rangle$ such that $\Phi \subseteq \Delta$ $\Phi \nvdash \bot$ $\Phi \vdash \alpha$ (this is what I am wondering about) There is no $\Phi' \subset \Phi$ such that $\Phi' \vdash \alpha$. I am trying to think of how this undercut wo...
The algorithm that is used by gcc and llvm is that of Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy (page 9). We start with the immediate dominators of each control-flow graph node B already calculated and stored in idom[B]: for each B in all basic blocks if size of Predecessors(B) >= 2 for each P in...
The 1-D distinct closest pair of points problem is as follows: Given a set of n distinct integer points on real line, find a pair of points with the smallest distance between them, here the distance between two points p_i and p_j is absolute difference of their values, i.e, |p_i-p_j|. A naive way to solve this problem...
So both the 0/1 subset sum problem (find a subset of given numbers that add up to a target sum) and the subset sum problem with "multiplicities" (find non-negative integer coefficients for the set elements so that the linear combination of set elements equals a target sum) are NP-complete. Is there some fairly easy red...
A Bloom filter makes it possible to efficiently keep track of whether various values have already been encountered during processing. When there are many data items then a Bloom filter can result in a significant memory saving over a hash table. The main feature of a Bloom filter, which it shares with a hash table, i...
Consider a random $n$ dimensional vector $v$ where $v_i \in \{0,1\}$. For each $i$ we know $p_i = P(v_i = 1)$ and let us assume the $v_i$ are independent. Using these probabilities, is there an efficient way to iterate over all possible binary $n$ dimensional vectors in order from most likely to least likely (with ar...
You have a Turing machine that only processes input on the form $0^*$. If it is given an input without 0's, it will simply halt without accepting or do anything else. Is it Turing Complete? The set $0^*$ is countably infinite, since you can make the bijective function $f(x) : 0^* → \mathbb{N} $: $f(x) = length(x)$ Wher...
Given a set of $N$ $n \times n$ matrices $A_1,\ldots,A_N$, and two vectors $x,y$, the problem is to find a product of up to $K$ matrices $A = A_{j_1}A_{j_2}\cdots A_{j_k}$ so that $Ax$ is as close to $y$ as possible in terms of euclidean distance. The problem can be shown to be NP-hard e.g. by reduction from subset sum...
From Wikipedia: Operating systems schedule threads in one of two ways: Preemptive multitasking is generally considered the superior approach, as it allows the operating system to determine when a context switch should occur. The disadvantage of preemptive multithreading is that the system may make a context switch...
Is there a Context-free grammar for the following language: $L=\{ x\#1^m|x \in \{0,1\}^* \text{ and the $m^{\text{th}}$ char in $x$ is 1} \}$ If so what is it? Because i couldn't find any. I also tried to prove there isn't (by the Pumping lemma for context-free languages), but it's given that a Context-free grammar doe...
A problem is NP-complete if: It is in NP. All problems in NP can reduce to it. It's number 2 that I'm concerned with here. I would be highly surprised if we knew every problem in NP. Based on that assumption, how do we know for sure that any problem is NP-complete? For example, how do we know that there's not some p...
I am given the following command $C$: $y:=1;$ while $\neg (x=1)$ do $y:= y*x;$ $x:= x - 1$. I have to show that $[\![ C ]\!]_s(s) = \{x \mapsto 1, y \mapsto s(x)!\}$ if $s(x) \geq 1$ and undefined otherwise. Where $[\![ C ]\!]_s(s) = s'$ if $\langle C, s \rangle \rightarrow^* s'$ and undefined otherwise. The proof is b...
Let $X$ be an $m\times n$ ($m$: number of records, and $n$: number of attributes) dataset. When the number of attributes $n$ is large and the dataset $X$ is noisy, classification gets more complicated and the classification accuracy decreases. One way to over come this problem is to use linear transformation, i.e., pe...
While I was studying SAT problem and its different instances, in Algorithms for the Satisfiability (SAT) Problem: A Survey by J. Gu et. al PDF, I came up with this variant (not mentioned there, but I though of it) and searched, but could not find anything useful. Consider this variant: Suppose $f$ is a boolean functio...
I was studying the proof of Ackermann function being recursive, but not primitive recursive, and a question hit me: "So what?". Why does it matter? What is the significance of primitive recursive functions?
The question is whether this is recursive or not. I first thought that it wasn't but then I read this question which seems similar and is recursive. Is it decidable whether a TM reaches some position on the tape? I think it's a slightly different question though (?) and so I have tried to show that it isn't recursive b...
Let $G$ be a graph of diameter 2 ($\forall u,v\in V: d(u,v)\leq2$). Can we decide if $G$ has Hamiltonian path in poly time? What about digraphs? Perhaps some motivation is in place: the question arises from Dirac's theorem which states that if $\forall v\in V:d(v)\geq \frac{n}{2}$ then the graph is Hamiltonian, as w...
I recently came across with a question that asks for the greatest subset of a given set, which includes relatively prime elements.(Randomly selected item from a set is always relatively prime to all others.) My approach was eliminating the subsets depending on if the subset satisfies the rule. Which means testing one b...
How would one write code to find and add the prime numbers between 4 and 5 million? I need a code that can find all such numbers, and then add them together. I'm not too keen on computer science, so I wouldn't know even where to begin. (I'm a math major). Any help is appreciated. Also any advice on how to compile and r...
I have no source for this, but I've heard people offhandedly mention problems that are NP Complete under polylog reductions (I think SAT was one of them). This confuses me - it seems to me that this is a violation of the nondetermistic time hierarchy. If SAT (or whatever) can be solved in $NTIME(n^c)$ for some $c$, an...
The exercise says "Show that the grammar $G = \langle\{S\}, \{a, b\}, S, \{S \to \lambda, S \to aSb\}\rangle$ generates the language $L = \{a^i b^i \mid i = 0, 1, 2, \ldots\}$." Now, I'm new to this subject although I'm familiar with the theory of Turing machines and automata. I'm teaching myself (not in a class, com...
I am working on acyclic orientations of undirected graphs and have the following questions: Given connected undirected simple graph $G$, how to find all possible acyclic orientations of $G$ ? What is the number of acyclic orientations? It is known (from here) to be $(-1)^p\ \chi(G,-\lambda)$ for a graph $G$ with $p...
So when you are decrypting an encryption with modular arithmetic, I know the modulus operator (%) gives the remainder of a/b, but what if a is less than b? For example, 5%2 is 1, since the answer is 2 remainder 1. But for something like 2%9, how do you find the answer?
You have a description of a language that you have to prove is regular, context free, or other. In order to prove that it does not belong to a certain class of languages, you might think that it will be more convenient to prove it by using a subset of that language. The problem is that a subset of a language does not n...
I am going through some past exam paper questions on regular languages for some revision, and I am having a bit of trouble with converting general ideas into formal mathematical proofs. The question is: Given regular expression $S$, prove formally that $S^* = (S^*)^*$. My problem is expressing this in a formal proof....
How would I go about making a Turing machine to accept the following language L? $$L = \{ www \mid w = \{0,1\}^* \text{ and } w > 0\}$$ I was thinking counting the number of symbols in the input string and then dividing by three to find the beginning of each instance of w and then testing if each instance is the same, ...
I can't understand what my professor wrote about these inclusions concerning deterministic classes: $$ DTIME(f) \subseteq DSPACE(f) \subseteq \sum_{c\in\Bbb N}DTIME(2^{c(log+f)}) $$ I understood the first inclusion: The Turing Machine needs to do at least one step in order to check the next cell on tape I didn't ...
Why operator overloading was included in Python and not in Java? How does one decide to include or exclude operator overloading in a programming language? It is said here that operator overloading is excluded from Java to make the language simpler (for programmers, language and VM developers, etc.). I don't understan...
I get how to reduce 3-SAT to 3-COLOR, but I'm not sure how to do it the other way around. Does anyone have any hints or insight?
We have an n-ary tree used for searching that we'd like to keep balanced. It is currently mostly a B-tree without the balancing operations. The issue we have for implementing those is that each sub-tree has its own sorting criteria (chosen in a set of five, if that's important) and that the balancing algorithms we kno...
Please consider the following Divide-And-Conquer Problem: You’re consulting for a small computation-intensive investment company, and they have the following type of problem that they want to solve over and over. A typical instance of the problem is the following. They’re doing a simulation in which they look at...
I am trying to prove that the Acyclic Subgraph Problem (AS) is NP-hard by showing that the Independent Set Problem (IS) is polynomially reducible to AS. AS is as follows: Given a directed graph G = (V, E) and an integer k, does G contain a subset V' of k vertices such that the induced subgraph on V'is acyclic? IS is a...
Consider the hitting set problem with $n$ elements and $m$ sets. I gather from the linked page as well as this that 1) it is NP-hard to approximate the cost of the optimal solution to a multiplicative factor of $c \log n$ for some $c>0$. 2) it is NP-hard to approximate the cost of the optimal solution to a multiplica...
Let's say you have the following sentence: "This is my first cs question posted here". How would I go about inserting the sentence into a search tree. Do I assign each word a number value and perform the insertions based on those?
Wolfram alpha is able to compute this sum: $$ \sum_{j=1}^n \binom{j}{2} = \frac{1}{6}(n-1)n(n+1). $$ How can Wolfram alpha do it? What kind of algorithm does it use?
I was reading the Paxos notes from yale from the following link: http://pine.cs.yale.edu/pinewiki/Paxos Recall that Paxos is a distributed system algorithm with the goal that the processes participating in its protocol will reach consensus on one of the valid values. I was trying to better understand the revoting mecha...
I have a set of vertices $V$ and a set of segments $S$. I want to know whether a segment in the set $S$ is Delaunay against the vertices in $V$. I would like to state my assumed definition of a Delaunay edge: An edge is Delaunay, iff there exists a circumsphere of its endpoints not containing any other vertex inside it...
I've been playing around with a simple probabilistic data structure which is very similar to a Bloom filter. Where a Bloom filter would use $k$ independent hash functions to choose $k$ of the $m$ bits to set, this structure uses $m$ hash functions, and sets each bit with probability $p$. This structure doesn't produce ...
I just completed a detailed theoretical mathematical study about the PageRank algorithm, I want to make a sample implementation to make some tests and play with it, supposing that I have a local set/folder full of a several webpages, representing a mini Web, I want to make a small software where I can make searches by ...
While going through probabilistic/average analysis of an algorithm, I found written somewhere that average cost and expected cost are same. Can anyone please tell me what does exactly expected cost stands for.I think we take care of likelihood of an event while finding expected cost unlike average cost.
I know after some reading Amdahl law is a embarrassingly parallel programming model. Embarrassingly parallel means there is no communication and tasks work independently. Am I to assume a parallel and a non parallel aspect of the program is embarrassingly parallel? If not, what makes it embarrassingly parallel?
I have a problem that I would like to solve it. A robot have to move near an obstacle (e.g a wall) without colliding. He should also try to be always near the obstacle. The following picture can help you to understand what I need to do: In red is the wall Black dots is the robot moving The dashed line is the path of ...
I need help with this exercise. Indicate the regular expression for the following Languages. Explain your expression in one sentence and indicate the basis form of the alphabet. Indicate also every assumption you make. i) Sums of positive fixed-point decimal numbers. The following Strings should exist in the Language...
Given a fully connected graph $G$, suppose that we are searching for a simple path $P$ with a specific cost $c$. Is answering to that problem yes or no equivalent to subset-sum problem? What would be the complexity of finding such path? I have made a reduction from subset-sum problem: If each number in a set $S$ is a ...
Assume I have some positive numbers $a_1,\ldots,a_n$ and a number $k \in \mathbb{N}$. I want to partition these numbers into exactly $k$ sets $A_1,\ldots,A_k$ such that the weighted arithmetic mean $$\text{cost}(A_i,\ldots,A_k)=\sum_{i=1}^{k}\frac{|A_i|}{n}c(A_i)$$ is minimal, where $c(A_i)=\sum_{a \in A_i}a$ is simpl...
I need trees that have the following properties: Each node in the tree has two values associated with it - a key and an associated opaque data element. An internal node in the tree has unbounded number of children. The tree reflects a real world hierarchy that is in flux over time - hence the maximum number of childre...
I'm working on a paper and would like to review the origins of Kleene's closure. I am unable to find any article of Kleene's that has the original definition of the Kleene closure. Is there a paper by Kleene in which he first defines the Kleene closure?
I've been trying to construct an unrestricted grammar which has the language: L = {a^n b^m c^n d^m | n>0, m>0} But I can't seem to figure it out without making the derivations run an unreasonably long amount of time. Can anyone help me devise an elegant way to create this grammar? Edit: In order to clarify, I was tryi...
The $k$-bounded spanning tree problem is where you have an undirected graph $G(V,E)$ and you have to decide whether or not it has a spanning tree such that each vertex has a degree of at most $k$. I realize that for the case $k=2$, this is the Hamiltonian path problem. However I'm having trouble with cases where $k>2$....
One approach for clustering a high dimensional dataset is to use linear transformation, and the most common approaches are PCA and random projection (where random projection arises from the Johnson-Lindenstrauss Lemma). I was wondering why we can't use other random transformation s like when our transformation matrix ...
I have a binary min-heap, size n, and I want to delete a number of elements, identified by some predicate. Any algorithm needs at least n tests of the predicate (preferably, exactly n), so the interesting performance metrics are the number of moves of elements, and the number of additional tests of the predicate. One p...
Consider the following program: const int n = 50; int tally; void total() { int count; for (count = 1; count <= n; count++){ tally++; } } void main() { tally = 0; parbegin (total (), total ()); write (tally); } Determine the proper lower bound and upper bound on the final value of the shared vari...
I was wondering how can someone prove that one class of languages is of a certain complexity? For example, how could I show the Turing-recognizable languages are in P? Would I have to come up with an algorithm that runs in deterministic polynomial time?
Dynamic Software Product Lines (DSPLS) are software product lines (SPLs) where features can be bound and unbound during program execution time. Is there a feature model and code available of an DSPL? I.e., where the model and the implementation is freely available for research purposes? I mean for regular SPLs there i...
Is the class $\sf NP$ closed under complement or is it unknown? I have looked online, but I couldn't find anything.
I would like to know if this type of special set operator exists, and if yes what is it called and if it has any other special properties. Lets say I have this set $S$ of items. Like all sets, if the same item is added twice in the set, the set will not add it again. However, when adding an item, using this special op...
I have tried looking online, but I couldn't find any definitive statements. It would make sense to me that Union and Intersection of two NPC languages would produce a language not necessarily in NPC. Is it also true that NPC languages are not closed under the complement, concatenation, and kleene star operations?
This question is from a practice exam in my algorithms class. I'm posting the question and the answer listed in that practice exam: Let $W$ be an $n\times n$ matrix whose $(i,j)$-th entry is $\omega_n^{ij}$, where $\omega_n$ is a principal $n$th root of unity. Let $X=(X_0,\dots,X_{n-1})$ be an $n$-vector. The product ...
I'm presented with the question on the practice exam: Sketch the curve and control points for the cubic B-spline basis function N^3_2 over the knot sequence with 8 knots, full multiplicity at the ends, and simple knots in between. There is almost no information about it in the book. I understand what a cubic B-sp...
Assume that I have a set of coplanar points $P = \{p_1, p_2, ... , p_n\}$ The equation of the plane is unknown. $\forall p_i,p_j \in P$, pairwise euclidian distance $d(p_ip_j)$ is known. And I have a set of points of whose coordinates are known $Q = \{q_1, q_2, ..., q_m\}$ If I know some of the pairwise distances $d(...
I'm working on a graph representation of software for a static analysis project, and I'm finding a distinction that I have no name for between different types of variables. On one side of the division, we have local variables and parameters, which are not subject to modification by other threads during the execution of...
I understand Partition Problem is NP-complete. Given we have a magic black box that can answer Yes or No for the partition problem. I was wondering how to come up with a polynomial time algorithm to find the actual set using this black box. Thank you.
In Sutton and Barto's reinforcement learning book, in multi-armed bandit problem a phrase has been used. "finding an optimal action" using greedy/$\epsilon$-greedy algorithm. When it is said that an algorithm "finds the optimal action " ?
It's been a while since I had to solve a recurrence and I wanted to make sure I understood the iterative method of solving these problems. Given: $$T(n) = 3T(n-2)$$ My first step was to iteratively substitute terms to arrive at a general form: $$T(n-2) = 3T(n-2 -2) = 3T(n-4)$$ $$T(n) = 3 *3T(n-4)$$ leading to the gener...
I'm trying to write a regular expression for some particular license plates. They consist of one up to three capital letters, a hyphen, one up to two capitol letters and one up to four numbers. The license plate should not exceed the 8 symbols. Example: AA-AA123 What I have until now is the following: because there has...
I'm studying for my finals in algorithms and reading the part about flow networks. There's a certain section that has me completely stumped and it is as follows: Given a graph $G= \langle V_G, E_G \rangle$, we can construct the $H(G)=\langle V_H, E_H\rangle$ as follows: $$V_H = V_G\times\{0,1\}$$ $$E_H = \{((v,0),...
I am faced with this question. Let $G$ be a graph in which each vertex has degree at least $k$. Show that there is a path of length $k$ in $G$ - that is, a sequence of $k+1$ distinct vertices $v_0, v_1, ..., v_k$ such that for $0 ≤ i < k$, $v_i$ is connected to $v_{i+1}$ in $G$. I started attacking it this way: If ...
This circuit should be reasonably efficient in size and depth, but with priority on depth. If depth was not a concern, then I guess I could make a specialized adder for the least significant bit and then modelled the rest of the circuit as a ripple adder with only that initial, possible carry. The carry has to ripple ...
So suppose we have a functional inequality with polynomial arguments in $2$ variables, $\sum_i c_i f(p_i(x,y)) \geq 0$, where $c_i$ are say given integer constants and $p_i$ are given polynomials, say with integer coefficients. We want the inequality to hold for all $x,y \in \mathbb{R}$. Is it a decidable problem to de...
In computer science it is often assumed that a human mind can be reduced to a Turing machine. This is the assumption that underlies the field of artificial intelligence. However, it is an assumption, one that has neither been proven or disproven. Is there any kind of test within our current capabilities where we can p...
I found this problem: Evaluating all derivatives of a polynomial at a point Given a polynomial A(x) of degree-bound n, its tth derivative is defined by From the coefficient representation $(a_0, a_1, . . . , a_{n-1})$ of A(x) and a given point $x_0$, we wish to determine A(t) ($x_0$) for t = 0, 1, . . . , n - 1...
In my algorithms course I have learned about the binary search tree and its functions add, find and remove. I have also learned about how to find the successor and the predecessor in a balanced binary search tree, but they are both $O(\log n)$ I think. Now, I have been thinking, how can I change a given binary search t...
Problem: Input is an integer number $x$ that we know factors as $p_{i_1}\cdot p_{i_2}\ldots p_{i_n}$, where the $p_{i_j}$'s are distinct prime numbers. Output is the above factorization of $x$. Do you know any results/references for the time complexity of this factoring problem? Note: If the $p_{i_j}$'s are not assume...
I am trying to write a genetic algorithm for a program. Most examples for genetic algorithms use something like this as the input: aaaaaaaaaa and mutate/crossover until they get helloworld or similar. This requires however that you start with something of length N, but my search space doesn't have a fixed length. How...
People usually say Coq does not allow writing non-terminating functions. I have a question regarding that. Does Coq allow writing exactly all terminating functions? In other words, what are the completeness and soundness properties of Coq's procedure for checking well-foundness of fixpoint definitions?
The definition of the complexity class $\mathsf{NP}$ seems to ensure (as good as possible) that it is computably enumerable. It looks as if the class could be enumerated by enumerating all Turing machines, and for each Turing machine report for each $k\in\mathbb{N}$ the language generated by stopping each computation a...
I've recently begun studying reductions in my algorithms class. All the reductions I've seen have been from decision problem $\to$ decision problem. Is it possible to do reductions with non-decision problems? Can NP-hardness be shown in that way?
I am looking for a way to enumerate all the possible paths between a source and one or more sinks in a directed graph, with loops. Also, some edges must enforce a maximum number of traversals (n), so that if an entity passing through the graph has already traversed the edge n times it cannot traverse it again. Also, e...
I am learning about NLP, with an eye to starting some practical NLP projects. I see that many of the algorithms for relation extraction and named entity recognition require you to identify linguistic features like "word comes before a period" or "word is the last word in a verb phrase." This seems like it takes a lot o...
I have been assigned a fun project: design and implement a program that maintains the data of a simple social network. Each person in the network should have a profile that contains his name, current status, and a friends list. I think it is clear that the project calls for the use of the ADT graph. Each vertex represe...
The question is in the title, I suppose. I am studying complexity classes, and I understand that NP-Hard is the set of problems that are at least as hard as the hardest problems in NP. Therefore, it will naturally contain PSPACE problems. However, I was specifically wondering if there were any PSPACE problems that were...
Here's an final exam question for a Database Fundamentals class. I've read the book, stuff online.. I can't figure out if "serializable" also means that the schedule is lockable or not. What I mean is.. I understand that for the schedule to be isolated, you have to have non-conflicting reads & writes, but then it also ...
I want to develop one algorithm which can predict shortest time to be taken to go to a destination from a source in a road network based on traffic congestion data. Consider that I have a server which gives me real time traffic congestion data for all the path segments in a road network. Now I want to develop such an ...
Im trying to work out whether the following clause is satisfiable: {x, y},{x,¬y},{¬x, y},{¬x,¬y},{x, z},{x,¬z},{y, z},{y,¬z} My basic understanding is to work this out, you must give each literal a true or false assignment to work out if each clause is satisfiable so: x=1, y=1, z=1, {1,1}, {x,0}, {0,1}, {0,0}, {1,1}, ...
I have seen stated in various places that in order to allow an "increase in polymorphism," functional dependency analysis should be performed, and type inference should be used for every declaration group in topological order. It seems like a well-known fact... except that nobody provides any reference or example. In f...
Given an automaton and an alphabet $\{a, b\} $, and the language accepted by the automaton is $ab^*$. Such an automata can be found here: My question is: this automaton cannot process the word $ba$ for example. In general, do automata have to be able to process any word?
This Wikipedia example is very confusing. Its saying the max flow = min cut. But I see the max flow = 9 and the min cut = 7. If not, how does the capacity =min cut here? Which is the max flow min cut theorem.
What are the best arithmetic algorithms out there (addition, subtraction, multiplication, division, power, root)? I am looking for algorithms that could be easily extended to multiprecision and arbitrary precision settings.
I'm studying binomial heaps in anticipation for my finals and the CLRS book tells me that insertion in a binomial heap takes $\Theta(\log n)$ time. So given an array of numbers it would take $\Theta(n\log n)$ time to convert it a a binomial heap. To me that seems a bit pessimistic and like a naive implementation. Does ...
Denote $D$ a set of finite sequences of integers. In Papadimitriou's "Computational Complexity" in theorem 2.5 it is proved that if a RAM program $\Pi$ computes a function $\phi$ from $D$ to integers in time $f(n)$, then there is a $7$-string Turing machine $M$, which computes $\phi$ in time $O(f(n)^3)$. Consider the f...
Most Smalltalk dialects currently implement a naive inexact floating modulus (fmod/remainder). I just changed this to improve Squeak/Pharo and eventually other Smalltalk adherence to standards (IEEE 754, ISO/IEC 10967), as I already did for other state of the art floating point operations. However for adoption of those...
What is the definition of a "c-competitive" algorithm? For example what does it mean, if we say that there is a 2-competitive algorithm for packet routing?
I know Distributed Graph Coloring algorithm in O(log* n) which is given at P11: Vertex Coloring Same for Maximal Independent Set [MIS] they gave remark like algorithms exist in O(log* n) time at P70: Maximal Independetn Set How we can reduce Graph coloring problem to MIS in O(log* n) time?
Is C++ as a formal language recursively enumerable? If yes, is there any invalid C++ code that takes "infinite" time to compile?
I'M looking for an algorithm (preferably polynomial) for the following problem: Input: - an M x N grid, where each square can be either empty or occupied - a list of items - a list of constraints Output: the grid, such that all items are placed and the constraints aren't violated. Each item is a 1d block of length k....
I have this recurrence $p(n) = 2p(n-2) + n$, and I have guessed that the solution is $O(n^2)$, however, when I do the following calculations, I cannot get the inequality to hold $p(n-2) \leq c(n-2)^2$ (induction hypothesis) $2c(n-2)^2 + n \leq cn^2$ (substitution) $cn^2-8c + n \leq cn^2$ Can anyone see where I go wrong...
I have to cluster a movie dataset of 10000 movies. A movie has attributes like Genres, Actors, Directors, Year. Earlier I thought that we can use a simple clustering algorithm like k-medoids and the distance can be pre-computed between two movies by subtracting genres & actors. Initialise d(movie1, movie2) = 0 d(movie...
In Sipser's book there is a section describing how to decide $\qquad\displaystyle \mathrm{ALL}_\mathrm{NFA} = \{ \langle N \rangle \mid N \text{ is an NFA}, L(N) = \Sigma^*\}$ in polynomial space. To do so, it shows $\overline{\mathrm{ALL}_\mathrm{NFA} }$ is in NPSPACE. I don't understand this part: If $M$, the NTM ...
In terms of worst-case asymptotic runtime, which NP-complete problem has the fastest-known (exact) algorithm and what is the algorithm? Is there something known that is faster than $O(n^2*2^n)$?