instruction
stringlengths
35
29.1k
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)$?
I'm currently working on a problem that I came across: You are given a set $B$ of $n$ points in the plane, and a set $R$ of $n$ points in the plane. Each point is given by its coordinates. I have to Suggest an $O(n^{3})$ time algorithm for determining if there is a perfect matching between them, with the constraint th...
StackOverflow pointed me here, so the question might be a bit in a layman's terms. Wikipedia defines pure functions as In computer programming, a function may be described as a pure function if both these statements about the function hold: The function always evaluates the same result value given the same argume...
I'm quite confused about the exact relationship between the expansion of a graph and its conductance. My first question is: Could someone point me to a reference that discusses both of these notions? (I've found various lecture notes on related topics but these seem to focus either on expansion or on conductance...) ...
If you are unfamiliar with multi-Paxos or paxos, the following link might be a good refresher on it: http://amberonrails.com/paxosmulti-paxos-algorithm/ or the paper by Leslie Lamport: http://research.microsoft.com/en-us/um/people/lamport/pubs/paxos-simple.pdf I was thinking about multi-Paxos and what one should do to ...
I know what regular and context free language are and how regular language needs finite memory and other stuff. What concerns me is that I think if $a^nb^m$ such that $n$ and $m$ have some relation between them then they can not be regular. But I can't find any such thing written anywhere. Am I correct to state so?
I made a recurrence tree and guessed that solution to $T(n)=2T(n-2)+n$ is $O(2^{n/2})$ and I am now trying to prove this through substitution. These are my steps so far, but I can't get it to pass for some reason: \begin{align} T(n-2) &\leq c2^{(n-2)/2}\\ T(n) &= 2(c2^{(n-2)/2})+n\\ &\leq c2^{n/2} \quad (?) \end{align}...
In Sipser's book of Theory of Computation, related to Reducibility, it's written if A is undecidable and reducible to B, B is undecidable. The confusion is, only a solution to B determines a solution to A, if i'm not wrong. So, for instance if B is decidable and A is undecidable, what does it mean? Here B isn't unde...
Are all pseudo-random number generators ultimately periodic? Or are they periodic at all in the end? By periodic I mean that, like rational numbers, they in the end generate a periodic subsequence... And pseudo-random means algorithmic/mathematical generation of random numbers...
I am trying to understand the proof of the following using tableaux: $$ \exists x\forall y.r(x,y) \to \forall x \exists y . r(x,y) $$ This is how it works out: $$ (1) \space \exists x \forall y .r(x,y) \\ (2) \space \lnot(\forall x \exists y . r(x,y)) \\ | \\ (3) \space \forall y.r(a,y) \\ (4) \space \lnot \exists y.r...
In the Reducibility chapter of Sipser's Theory of Computation book, an example is: We reduce A(TM) to HALT(TM). And then we claim that if H decides HALT(TM), then A decides A(TM), but since A(TM) is undecidable, so is HALT(TM) My question is, if we already know that A(TM) is undecidable, what is the need for deciding ...
I have a local search problem. The set of valid solutions are all the simple paths (i.e. without repeated nodes) from a node $S$ to a node $T$ in a directed graph. The question is: given a current solution (an $S$-$T$-path), how can I generate a set of neighbour solutions? To elaborate, I have an optimization (minimiza...
Let $L$ be a language with every string of the form $(w_i\#)^*$ with $w_i\in\{0,1\}^*$. Set $w'\sim w$ if there is a permutation $\pi_1$ such that $w_i=w'_{\pi_1(i)}$ for all $i$. If additionally $\mid w_i\mid=n$ for all $i$, then set $w'\approx w$ if also $\mid w'_i\mid=n$ for all $i$ and there are permutations $\pi_1...
Given a tree, find a path on which every vertex has at most 4 leaves (can have 0 as well) and is the "biggest" (has the maximum amount of vertices possible - including the leaves). Time complexity: $O(n)$. I'm getting nowhere with this problem. I have tried BFS/DFS (seemed like such an obvious method), but even if I co...
I've read multiple times (for example in some of the answers to this question https://stackoverflow.com/questions/8869563/how-much-memory-can-be-accessed-by-a-32-bit-machine) that a CPU with 32 bit address bus can support at most 4GB worth of memory (2^32) excluding any extensions such as PAE. But doesn't that depend ...
I'm just starting a course on Computational Number Theory and have very little Computer Science background but definitely know enough about the big-O notation. I currently have an assignment to work on: An algorithm reads in the binary digits of a positive integer $N$ and determines whether $N$ is a multiple of 3. Sho...
That is, can you build a Turing Machine that, if given a Turing Machine as input, can decide (or at least recognize) if the inputted Turing Machine has an infinite number of strings in its language? Similarly, can you recognize or decide if a Turing Machine has an uncountably-infinite language?
I am to come up with a function based on these premise: Give an example of a function which is $o(\log^k n)$ for any fixed $k$, but which is also $\omega(1)$. The answer is the iterative logarithm $\log^* n$, and I want to show each of these steps. 1) show that $\log^* n \leq \log^{k+1} n$ 2) show that $\log^{k+1} n = ...
As part of a homework assignment covering implementation of introsort I'm asked why heapsort is used rather than mergesort (or other $O(n\log(n))$ algorithms for that matter). Introsort is a hybrid sorting algorithm that provides both fast average performance and (asymptotically) optimal worst-case performance. It b...
I have started reading on algorithmic complexity for my thesis work. Already have studied on Polynomial time reducibility, NP-Complete, NP-Hard. Now trying to prove NP completeness of some of the classical problems. I have started with 3-SAT problem. 3-SAT problem — was shown to be NP-complete: Input: A boolean Formul...
Imagine a Binary Erasure Channel as depicted on Wikipedia. One equation describing the mutual information is: $$ \begin{align*}I(x;y) &= H(x) - H(x|y) \\ &= H(x) - p(y=0) \cdot 0 - p(y=?) \cdot H(x) -p(y=1)\cdot 0\end{align*}$$ Why is it "$p(y=?) \cdot H(x)$" and not "$p(y=?) \cdot H(x|y=?)$"?
Given the following two functions, prove that the build_heap function, which transforms an array A into a max-heap-sorted array A' runs in $O(n)$. heapify(A, i): Input: array A of length n, index i left = 2i + 1 (left child node) right = 2i + 2 (right child node) largest = i if left < n and A[left] > A[i] then ...
I'm wondering how a set of keys could be assigned to nodes in a 2-3-4 tree in order to minimize the height of the tree? Does the sequence of insertion matter with 2-3-4 trees?
This is a sort of edit-distance question, and is very easy. I am just quite brain dead on this subject and can't figure it out so far. Given a series of numbers, e.g. [3, 1, 1, 1] How would one most efficiently turn all of the numbers into the same number, with the minimum number of "moves"? By "move" is meant adding...
If a language $A$ is reducible to some language $B$, does it follow that $B$ is reducible to $A$? My guess is no, it having something to do with the function $f$ in the definition of $A$ reducing to $B$ needing to be invertible.
I'm trying to show that PARTITION is NP-hard. I'm not sure if what I have is correct so I'll write what I have. I tried to reduce it from SUBSET_SUM: $$PART= \{S\subset\mathbb{Z}|\exists C \subset S: \sum_{x\in C} x=\sum_{x\in S-C}x\} $$ $$SUBSET SUM = \{\langle T,u\rangle| T\subset \mathbb{N}, u \in \mathbb{Z}\quad\ex...
In Sipser's book there is a proof that an emptiness of LBA is undecidable, with the help of reduction to A_$_{\text{TM}}$. The reduction is proposed in the following manner: we receive a TM $M$ and a word $w$, and build an LBA $B$ that accepts if is fed an accepting computation history of $M$ on $w$. At page 224, it de...
I can not understand why the dynamic programming algorithm for the Subset Sum, is not polynomial. Even though the sum to find 'T' is greater than the total sum of the 'n' elements of the set , the number of iterations is always (T * n) and not exponential I'm not understanding it. The algorithm always do 'n*T' compar...
I am trying to learn how to build parse trees. I have watched videos and tried to do some on my own, but am a little lost. In this example, I am given the following: $$ \begin{align*} &S\to(L) \\ &S\to a \\ &L\to L,S \\ &L\to S \end{align*} $$ and then I am told to draw a parse tree for the expression $(a,(a,a))$. I k...
I'm trying to give a meaningful definition for NFAs with more than one initial state. I know from the formal definition in Wikipedia that it is possible to have more than one initial state, it mentions that "There is an easy construction that translates a NFA with multiple initial states to a NFA with single initial st...
I'm currently taking a class in Automata Theory and it's kicking my butt. I have an assignment that my teacher gave me that consists of three questions. I have no idea where to start. My teacher and I have a language barrier that I can't seem to break. If anyone could help me understand how to solve the following probl...
Let's say there is a vector of length $n$: Require Import Vector. Variable T:Type. Variable n:nat. Variable v:t T n. "list" gives a function "nth" that demands a default result that is returned when the list is longer than the index requested. This is convenient, and the definition is readable. Now vector uses a defin...
I'm trying to complete a problem where I have to design and implement a dynamic programming solution to the following problem You have to cut a metal pipe into several pieces. To do so, you bring it to a company that charges money according to the length of the pipe being cut. Their cutting method means that only one ...
I understand that ECC checks for errors and corrects them automatically without the knowledge of the operating system or user. I don't understand however why servers often use ECC memory?
I know that a disadvantage of the index block system is that it can be wasteful of space if the files involved are mostly small in size, as index blocks are allocated from free space as required and at least one index block is needed for each file regardless of size. On average there is ½ block wastage per file in the ...
There is a complete binary tree with its leaves as components of some system The values from one node to another gives propagation time for a signal to propagate from one junction to another For the signal to arrive at the leaves at exact same time starting from the root we must add delays to some wires. The cost of ...
The question is pretty much in the title. Is there ever a time where some language $L$ can be accepted by a minimal DFA with $n$ states, but $L^R$, the reversal of $L$, can be accepted by a DFA with $m$ states, where $m<n$?
Given two regular expressions of bit strings $B_1$ and $B_2$ of the same length (stated mathematically, $B_1,B_2 \in \{0,1\}^m$) that use only grouping and repetition, what is the optimal running time of performing a bitwise AND operation on $B_1$ and $B_2$? For example, given two regular expressions, $B_1 = ((10)^2(01...
I have some biological data (ECG), which are quite chaotic in nature, and and some other data; that are not chaotic but related in some way, like fatigue. I want to find out how the time series, chaotic, data are related to each of these other time series. My undergrad thesis was on string "emotion" classification and ...
why recursive languages does not come under Chomsky hierarchy ? why Chomsky did not classified it? any real life resemblance of recursive language something that i can connect it with like regular language are ones which needs finite memory or context free languages are those which can be parsed using single stack .s...
I basically have this homework question that needs me to support the below statement. Any suggestions on how i could go around proving it ? the Exact Question was : "The KISS principle is frequently applied in the implementation of security." I was thinking on the line of KISS being applied on Android Pattern lock-sc...
See the example algorithm below from my course notes, I don't follow the operation counting in the inner loop. Can someone walk me through this step-by-step? Here's the algorithm: Algorithm PrefixAverages1(A, n): Input: An integer array A of size n. Output: An array X of size n such that X[j] is the average of...
Given an alphabet $\Sigma = \{ a,b \}$, how many different regular languages are there that can be accepted by an $n$-state non-deterministic finite automaton? As an example, let us consider $n=3$. We then have $2^{18}$ different transition configurations and $2^3$ different start- and end state configurations, so we h...
The Ramer-Douglas-Peucker algorithm for line simplification has worst-case $O(n^2)$ runtime. For suitably distributed random inputs, it has expected $O(n \log n)$ runtime complexity. In 2D, there are other algorithms with worst case $O(n \log n)$ runtime complexity, which compute exactly the same result as the Ramer-Do...
There is something I don't understand. In the Subset Sum problem, in the Dynamic Programming solution, because of binary representation of the sum T, we say it is pseudo-polynomial in run time; we must sum in the worst case from 1 to T. So I don't understand why the Addition algorithm is not pseudo-polynomial, when w...