instruction
stringlengths
35
29.1k
When I was explaining the Baker-Gill-Solovay proof that there exists an oracle with which we can have, $\mathsf{P} = \mathsf{NP}$, and an oracle with which we can have $\mathsf{P} \neq \mathsf{NP}$ to a friend, a question came up as to why such techniques are ill-suited for proving the $\mathsf{P} \neq \mathsf{NP}$ pro...
(this is related to my other question, see here) I would like to write a function that scores a given arrangement of windows on a screen. The purpose of this function is to determine whether a particular layout is good and by going over other possible layouts, finding the one with the highest score. Here are some chara...
In Richard Gabriel's famous essay The Rise of Worse is Better, he contrasts caricatured versions of the MIT/Stanford (Lisp) and New Jersey (C/Unix) design philosophies along the axes of simplicity, correctness, consistency, and completeness. He gives the example of the "PC loser-ing problem" (discussed elsewhere by Jo...
I'm studying Bootstrapping from Red Dragon Book Compilers and found the T diagram for cross compiler pretty confusing. I can't understand what is meant by "Run compiler1 through compiler2". Can anyone provide some better explanation, analogy or an example to relate with some real world compiler? Some notation first. By...
We are given a set $F=\{f_1, f_2, f_3, …, f_N\}$ of $N$ Fruits. Each Fruit has price $P_i$ and vitamin content $V_i$; we associated fruit $f_i$ with the ordered pair $(P_i, V_i)$. Now we have to arrange these fruits in such a way that the sorted list contains prices in ascending order and vitamin contents in descending...
I am having a problem trying to solve a question on a past paper asking to design a security lattice. Here is the question: The AB model (Almost Biba) is a model for expressing integrity policies rather than confidentiality. It has the same setup as Bell-LaPadula, except that $L$ is now a set of integrity ...
Suppose I have an array of integers having length $N$. How can I output all longest decreasing sequences? (A subsequence consists of elements of the array that do not have to be consecustive, for example $(3,2,1)$ is a decreasing subsequence of $(7,3,5,2,0,1)$.) I know how to calculate the length of longest decreasing ...
What operations need to be performed in order to do any arbitrary analogue computation? Would addition, subtraction, multiplication and division be sufficient? Also, does anyone know exactly what problems are tractable using analogue computation, but not with digital?
This is the recursive formula for which I'm trying to find an asymptotic closed form by the master theorem: $$T(n)=9T(n/27)+(n \cdot \lg(n))^{1/2}$$ I started with $a=9,b=27$ and $f(n)=(n\cdot \lg n)^{1/2}$ for using the master theorem by $n^{\log_b(a)}$, and if so $n^{\log_{27}(9)}=n^{2/3}$ but I don't understand how...
I was reviewing some NP-complete problems on this site, and I meet one interesting problem from NP completeness proof of a spanning tree problem In this problem, I am interested in the original problem, which the leaf set is precisely $S$. The author said that he can prove this by reducing it to the Hamiltonian path. ...
I'm looking for a list of informed search algorithms, also known as heuristic search algorithms. I'm aware of: best-first search Greedy best-first search A* search Are there more best-first algorithm or other informed searches that are not best-first?
Let $M$ be a $(0, 1)$ matrix. We say two entries are neighbors if they are adjacent horizontal or vertically, and both entries are $1$'s. One wants to find minimum number of $1$'s to add, so every $1$ can reach another one through a sequence of neighbors. Example: 100 000 001 Here we need 3 $1$'s: 100 100 111 How ca...
I want to count the number of strings $s$ over a finite alphabet $A$, that contain no repeats, and by that I mean for any substring $t$ of $s$, $1< |t| < |s|$, there is no disjoint copy of $t$ in $s$. For exapmle, let $A=\{a,b\}$. Then $aaa$ is one of the strings I want to count, since for the substring $aa$, there a...
So, I encoutered this problem in examination: Consider the following marginal contribution net: $\{a \wedge b\} \to 5$ $\{b\} \to 2$ $\{c\} \to 4$ $\{b \wedge \neg c\} \to −2$ Let $v$ be the characteristic function defined by these rules. Give the values of the following: i) $v(\emptyset)$ ii) $v(\{a\})$ iii) $v(\{...
$L$ is a regular language over the alphabet $\Sigma = \{a,b\}$. The left quotient of $L$ regarding $w \in \Sigma^*$ is the language $$w^{-1} L := \{v \mid wv \in L\}$$ How can I prove that $w^{-1}L$ is regular?
So I thought this (though somewhat basic) question belonged here: Say I have a graph of size 100 nodes arrayed in a 10x10 pattern (think chessboard). The graph is undirected, and unweighted. Moving through the graph involves moving three spaces forward and one space to either right or left (similar to how a chess knigh...
There are many methods to prove that a language is not regular, but what do I need to do to prove that some language is regular? For instance, if I am given that $L$ is regular, how can I prove that the following $L'$ is regular, too? $\qquad \displaystyle L' := \{w \in L: uv = w \text{ for } u \in \Sigma^* \setminus ...
So, I'm trying to conceptualize something: Say we have a weighed graph of size N. A and B are nodes on the graph. You want to find the shortest path from A to B, given a few caveats: movements on the graph are regulated by a circular cycle of length 48, in such a manner that: cycle{ 0 <= L <= 24 movement IS pos...
The randomized selection algorithm is the following: Input: An array $A$ of $n$ (distinct, for simplicity) numbers and a number $k\in [n]$ Output: The the "rank $k$ element" of $A$ (i.e., the one in position $k$ if $A$ was sorted) Method: If there is one element in $A$, return it Select an element $p$ (the "pivot") un...
I am studying different approaches for the definition of computation with continuous dynamical systems. I have been trying to find a nice introduction to the theory of "State transition systems" but failed to do so. Does anybody know a modern introduction to the topic? Of particular interest would be something dealing...
I'm doing some exam (Java-based algorithmics) revision and have been given the question: Describe how you might extend your implementation [of a queue using a circular array] to support the expansion of the Queue to allow it to store more data items. The Queue started off implemented as an array with a fixed maximum ...
So I know that $\log^*$ means iterated logarithm, so $\log^*(3)$ = $(\log\log\log\log...)$ until $n \leq 1$. I'm trying to solve the following: is $\log^*(2^{2^n})$ little $o$, little $\omega$, or $\Theta$ of ${\log^*(n)}^2$ In terms of the interior functions, $\log^*(2^{2^n})$ is much bigger than $\log^*(n)$, but...
The usual simple algorithm for finding the median element in an array $A$ of $n$ numbers is: Sample $n^{3/4}$ elements from $A$ with replacement into $B$ Sort $B$ and find the rank $|B|\pm \sqrt{n}$ elements $l$ and $r$ of $B$ Check that $l$ and $r$ are on opposite sides of the median of $A$ and that there are at most...
This question is motivated by my answer to another question in which I stated the fact that both Betweeness and Non-Betweeness problems are $NP$-complete. In the former problem there is a total order such that the betweeness constraint of each triple is enforced while in the later problem there is a total order such th...
I am looking for algorithms to optimize a strictly monotonic function $f$ such that $f(x) < y$ $f : [a,b] \longrightarrow [c,d] \qquad \text{where } [a,b] \subset {\mathbb N}, [c,d] \subset {\mathbb N}$ such that $\arg\max{_x} f(x) < y$ My first idea was to use a variant of binary search, pick a point $x$ in $[a,b]$...
I have written a program to sort Linked Lists and I noticed that my insertion sort works much better than my quicksort algorithm. Does anyone have any idea why this is? Insertion sort has a complexity of $\Theta(n^2)$ and quicksort $O(n\log n)$ so therefore quicksort should be faster. I tried for random input size and...
Last year, I was reading a fantastic paper on “Quantum Mechanics for Kindergarden”. It was not easy paper. Now, I wonder how to explain quicksort in the simplest words possible. How can I prove (or at least handwave) that the average complexity is $O(n \log n)$, and what the best and the worst cases are, to a kindergar...
What does the notation co- mean when prefixing co-NP, co-RE (recursively enumerable), or co-CE (computably enumerable) ?
I'm really struggling with this property: Let $X,Y$ be coherence spaces and $f: Cl(X) \rightarrow Cl(Y)$ be a monotone function. $f$ is continuous if and only if $f(\bigcup_{x\in D} x)=\bigcup_{x \in D}f(x)$, for all $D \subseteq Cl(X)$ such that $D$ is a directed set. Directed set is defined thus: $D \subseteq $ POSE...
Why do you think it is that most C++ instructors teaching college level computer sciences discourage or even forbid using strings for text, instead requiring students to use character arrays? I am assuming this methodology is somehow intended to teach good programming habits, but in my experience I don't see anything w...
In many texts a lower bound for finding $k$th smallest element is derived making use of arguments using medians. How can I find one using an adversary argument? Wikipedia says that tournament algorithm runs in $O(n+k\log n)$, and $n - k + \sum_{j = n+2-k}^{n} \lceil{\operatorname{lg}\, j}\rceil$ is given as lower bound...
I would like to know whether a universally-quantified type $T_a$: $$T_a = \forall X: \left\{ a\in X,f:X→\{T, F\} \right\}$$ is a sub-type, or special case, of an existentially-quantified type $T_e$ with the same signature: $$T_e = \exists X: \left\{ a\in X,f:X→\{T, F\} \right\}$$ I'd say "yes": If something is true "fo...
I have a collection $P \subseteq \mathbb{R}^3$ of $N$ particles and there is a function $f : P^2 \to \mathbb{R}$. I want to find which configuration of the system minimizes the value of $f$. Can this problem (or similar ones) be reduced to TSP? Could you point me to literature on the topic? In my application, $f$ is t...
Suppose that we have a black-box $f$ which we can query and reset. When we reset $f$, the state $f_S$ of $f$ is set to an element chosen uniformly at random from the set $$\{0, 1, ..., n - 1\}$$ where $n$ is fixed and known for given $f$. To query $f$, an element $x$ (the guess) from $$\{0, 1, ..., n - 1\}$$ is provide...
I am given an exercise unfortunately I didn't succeed by myself. There is a set of rectangles $R_{1}..R_{n}$ and a rectangle $R_{0}$. Using plane sweeping algorithm determine if $R_{0}$ is completely covered by the set of $R_{1}..R_{n}$. For more details about the principle of sweep line algorithms see here. Let's st...
I'm trying to figure out a way I could represent a Facebook user as a vector. I decided to go with stacking the different attributes/parameters of the user into one big vector (i.e. age is a vector of size 100, where 100 is the maximum age you can have, if you are lets say 50, the first 50 values of the vector would be...
There are some documents to be indexed, that means I need to read the docs and extract the words and index them by storing at which document they appear and at which position. For each word initially I am creating a separate file. Consider 2 documents: document 1: “The Problem of Programming Communication with” docume...
I'm trying to use a color camera to track multiple objects in space. Each object will have a different color and in order to be able to distinguish well between each objects I'm trying to make sure that each color assigned to an object is as different from any color on any other object as possible. In RGB space, we hav...
On my old 256MB RAM, pc I get this message. (I guess it is quite common) Windows - Virtual Memory minimum too low Your system is low on virtual memory. Windows is increasing the size of your virtual memory paging file. During this process, memory requests for some applications may be denied. ... Please explain from...
Why are blocking artifacts serious when there is fast motion in MPEG? Here is the guess I made: In MPEG, each block in an encoding frame is matched with a block in the reference frame. If the difference of two blocks is small, only the difference is encoded using DCT. Is the reason blocking artifacts are serious that t...
In my computability class we were given a practice final to go over and I'm really struggling with one of the questions on it. Prove the following statement: If $L_1$ is a regular language, then so is $L_2 = \{ uv |$ $u$ is in $L_1$ or $v$ is in $L_1 \}$. You can't use the pumping lemma for regular languages (I think...
I was recently reading about algorithms for checking bisimilarity and read that the problem is P-complete. Furthermore, a consequence of this is that this problem, or any P-complete problem, is unlikely to have an efficient parallel algorithms. What is the intuition behind this last statement?
When are some (relatively) basic (think first year college level CS student) instances when one would use recursion instead of just a loop?
Suppose I am given $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$ such that their sum $a_1 + a_2 + \dots + a_n = S$ also fits in a register of width $w$. It seems to me that we can always permute the numbers to $b_1, b_2, \dots b_n$ such that each prefix sum $S_i = b_1 + b_2 ...
Suppose I am given an array of $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$. I want to compute the sum $S = a_1 + \ldots + a_n$ on a machine with 2's complement arithmetic, which performs additions modulo $2^w$ with wraparound semantics. That's easy — but the sum may overfl...
Let A and B be languages with A ⊆ B, and B is Turing-recognizable. Can A be not Turing-recognizable? If so, is there any example?
I am trying to learn Lambda calculus from here and while trying to solve some problems, I got stuck. I was trying to solve the following problem (page 14, excercise 2.6 part (i): Simplify $M \equiv (\lambda xyz.zyx) aa (\lambda pq. q)$. My evaluation using the beta rule reduces it to $(\lambda z. z)$ as follows: First ...
I have a logistic problem that can be seen as a variant of $\text{TSP}$. It is so natural, I'm sure it has been studied in Operations research or something similar. Here's one way of looking at the problem. I have $P$ warehouses on the Cartesian plane. There's a path from a warehouse to every other warehouse and the di...
Suppose I have the given data set of length 11 of scores: p=[2, 5, 1 ,2 ,4 ,1 ,6, 5, 2, 2, 1] I want to select scores 6, 5, 5, 4, 2, 2 from the data set. How many ways are there? For the above example answer is: 6 ways {p[1], p[2], p[4], p[5], p[7], p[8]} {p[10], p[2], p[4], p[5], p[7], p[8]} {p[1], p[2], p[10], p[5],...
I know that Euclid’s algorithm is the best algorithm for getting the GCD (great common divisor) of a list of positive integers. But in practice you can code this algorithm in various ways. (In my case, I decided to use Java, but C/C++ may be another option). I need to use the most efficient code possible in my program....
So I have a problem that I'm looking over for an exam that is coming up in my Theory of Computation class. I've had a lot of problems with the pumping lemma, so I was wondering if I might be able to get a comment on what I believe is a valid proof to this problem. From what I have seen online and in our review I don'...
I have been reading on security policies and the question wether Bell-LaPadula can be used to implement Chinese Wall. Does anyone know more about it?
I was asked to find the adversary arguments necessary for finding the lower bounds for selection and insertion sort. I could not find a reference to it anywhere. I have some doubts regarding this. I understand that adversary arguments are usually used for finding lower bounds for certain "problems" rather than "algorit...
I've been struggling with several Hamming code/error detection questions because the logic behind it doesn't seem to make sense. eg.1 eg.2 I don't really understand the above two examples and the calculations taking place. How were the conclusions reached concerning the categories of bin position (dec/bin), parity/da...
Is there any algorithm that works better than $\Theta(n^2)$ to verify whether a square matrix is a magic one? (E.g. such as sum of all the rows, cols and diagonally are equal to each other). I did see someone mention a $O(n)$ time on a website a few days ago but could not figure out how.
Unfortunately I am still not so strong in understanding Sweep Line Algorithm. All papers and textbooks on the topic are already read, however understanding is still far away. Just in order to make it clearer I try to solve as many exercises as I can. But, really interesting and important tasks are still a challenge for...
I have started to study non deterministic automata using the book of Hopcroft and Ullman. I'm stuck in a problem that I found very interesting: Give a non deterministic finite automaton accepting all the strings that have the same value when evaluated left to right as right to left by multiplying according to the ...
So I'm really struggling with the pumping lemma. I think most of my problems come from not understanding how you can and can't split the string in a pumping lemma question. Here is an example, take the problem prove that $L = \{w | w$ contains more $0$'s than $1$'s over the language $\{0,1\} \}$ is not regular via th...
I'm working on a ranking system that will rank entries based on votes that have been cast over a period of time. I'm looking for an algorithm that will calculate a score which is kinda like an average, however I would like it to favor newer scores over older ones. I was thinking of something along the line of: $$\fr...
Assume that I am a programmer and I have an NP-complete problem that I need to solve it. What methods are available to deal with NPC problems? Is there a survey or something similar on this topic?
I know that the 2D and 3D Knapsack problems are NPC, but is there any way to solve them in reasonable time if the instances are not very complicated? Would dynamic programming work? By 2D (3D) Knapsack I mean I have a square (cube) and a I have list of objects, all data are in centimeters and are at most 20m.
What follows is my algorithm for doing this in what I believe to be $O(n)$ time, and my proof for that. My professor disagrees that it runs in $O(n)$ and instead thinks that it runs in $\Omega(n^2)$ time. Any comments regarding the proof itself, or the style (i.e. my ideas may be clear but the presentation not). The or...
What are efficient and accurate techniques for monitoring the recoverability and integrity of files in very large preservation archives? In very large archives, the time taken to recompute checksums periodically (scrubbing) is substantial, perhaps taking more than all the available time depending on the read bandwidth ...
What are the complete specifications that must be documented in order to ensure the correct execution of a particular program written in Java? For instance, if one were archiving a program for long-term preservation, and no testing or porting would be done. I need to be able to compile and execute the Java program. Thu...
I have a tree (in the graph theory sense), such as the following example: This is a directed tree with one starting node (the root) and many ending nodes (the leaves). Each of the edge has a length assigned to it. My question is, how to find the longest path starting at the root and ending at any of the leaves? The br...
Do you know any algorithm that calculates the factorial after modulus efficiently? For example, I want to program: for(i=0; i<5; i++) sum += factorial(p-i) % p; But, p is a big number (prime) for applying factorial directly $(p \leq 10^ 8)$. In Python, this task is really easy, but i really want to know how to optim...
I'm implementing a class which provides arbitrary-precision arithmetic (also called "bignum", "BigInteger", etc.). My questions is about a practical implementation detail: I'm wondering if there is a significant difference in implementation and computational complexity between an implementation which stores the magnitu...
Consider a system of linear equations $Ax=0$, where $A$ is a $n\times n$ matrix with rational entries. Assume that the rank of $A$ is $<n$. What is the complexiy to check whether it has a solution $x$ such that all entries of $x$ are stricly greater than 0 (namely, $x$ is a positive vector)? Of course, one can use Gaus...
Assume I want to insert elements $1$ to $n$ into a data structure exactly once, and perform predecessor queries while inserting these elements (so insert(x) and pred(x) always come in pairs). The predecessor of $x$ is the largest number in the data structure that is smaller than $x$. The data structure is created by pr...
My goal is to solve the following problem, which I have described by its input and output: Input: A directed acyclic graph $G$ with $m$ nodes, $n$ sources, and $1$ sink ($m > n \geq 1$). Output: The VC-dimension (or an approximation of it) for the neural network with topology $G$. More specifics: Each node in $G$ is a...
We are given a set 2-dimensional points $|P| = n$ and an integer $k$. We must find a collection of $k$ circles that enclose all the $n$ points such that the radius of the largest circle is as small as possible. In other words, we must find a set $C = \{ c_1,c_2,\ldots,c_k\}$ of $k$ center points such that the cost func...
We know that $st\text{-}non\text{-}connectivity$ is in $\mathsf{NL}$ by Immerman–Szelepcsényi theorem theorem and since $st\text{-}connectivity$ is $\mathsf{NL\text{-}hard}$ therefore $st\text{-}non\text{-}connectivity$ is many-one log-space reducible to $st\text{-}connectivity$. But is there a direct/combinatorial red...
Here's a conjecture for regular expressions: For regular expression $R$, let the length $|R|$ be the number of symbols in it, ignoring parentheses and operators. E.g. $|0 \cup 1| = |(0 \cup 1)^*| = 2$ Conjecture: If $|R| > 1$ and $L(R)$ contains every string of length $|R|$ or less, then $L(R) = \Sigma^*$. That is,...
I want to create a digital time capsule which will remain unreadable for some period of time and then become readable. I do not want to rely on any outside service to, for instance, keep the key secret and then reveal it at the required time. Is this possible? If not, is some kind of proof possible that it is not? One ...
I have two problems related to paths in a directed graph. Let $G=(V,E)$ be a directed graph with source $s \in V$ and target $t \in V$. Let $v \in V \setminus \{s,t\}$ be another vertex in $G$. Find a simple directed path¹ from $s$ to $t$ through $v$. Find a simple directed path from $s$ to $t$ that goes through two...
I'm studying for my final in theory of computation, and I'm struggling with the proper way of answering whether this statement is true of false. By the definition of $\leq_m$ we can construct the following statement, $w \in A \iff f(w) \in B \rightarrow w \notin A \iff f(w) \notin B$ This is where I'm stuck, I want t...
I asked this question at generic stackoverflow and I was directed here. It will be great if some one can explain how to approach partial or fully dynamic graph problems in general. For example: Find Shortest Path between two vertices $(u,v)$ in a undirected weighted graph for $n$ instances, when an edge is removed at ...
I'd love your help with the following question: Let $G$ be context free grammar in the Chomksy normal form with $k$ variables. Is the language $B = \{ w \in L(G) : |w| >2^k \}$ regular ? What is it about the amount of variables and the Chomsky normal form that is supposed to help me solve this question? I tried to ...
My book states this If a decision problem B is in P and A reduces to B, then decision problem A is in P. A decision problem B is NP-complete if B is in NP and for every problem in A in NP, A reduces to B. A decision problem C is NP-complete if C is in NP and for some NP-complete problem B, B reduces to C....
I'm trying to solve a problem for class that is stated like so: A bipartite graph is an undirected graph in which every cycle has even length. We attempt to show that the Hamiltonian cycle (a cycle that passes through each node exactly once) problem polynomially reduces to the Hamiltonian cycle problem in bipar...
Logical Min Cut (LMC) problem definition Suppose that $G = (V, E)$ is an unweighted digraph, $s$ and $t$ are two vertices of $V$, and $t$ is reachable from $s$. The LMC Problem studies how we can make $t$ unreachable from $s$ by the removal of some edges of $G$ following the following constraints: The number of the re...
I would like your help with the following question: Let $L$ be a language, and operator $A(L)=\{\,ww^Rw \mid w \in L\ \wedge\ |w| \lt 2007\,\}$ where $x^R$ is the reversed string of $x$. Which of the following statements are correct? If $L$ is regular so $A(L)$ is regular. If $L$ is a CFL which is not regular then...
I'm working on problem H in the ACM ICPC 2004–2005 Northeastern European contest. The problem is basically to find the worst case that produces a maximal number of exchanges in the algorithm (sift down) to build the heap. Input: Input file contains $n$ ($1 \le n \le 50{,}000$). Output: Output the array containing $n$ ...
NOTE: Due to the fact that the trip does not end at the same place it started and also the fact that every point can be visited more than once as long as I still visit all of them, this is not really a TSP variant, but I put it due to lack of a better definition of the problem. This problem was originally posted on Sta...
I'd really love your help with the following: For any fixed $L_2$ I need to decide whether there is closure under the following operators: $A_r(L)=\{x \mid \exists y \in L_2 : xy \in L\}$ $A_l(L)=\{x \mid \exists y \in L : xy \in L_2\}$. The relevant options are: Regular languages are closed under $A_l$ resp. $A_r...
Are there techniques and/or software tools that can be used to construct hard instances of a simple puzzle game (or a simple planning problem)? With "hard" I mean that any solution of the instance is "long" with respect to the input size. What I have in mind: model the puzzle game using a constraint programming ...
Do there exist undecidable languages such that their union/intersection/concatenated language is decidable? What is the physical interpretation of such example because in general, undecidable languages are not closed under these operations? What can we say about the kleene closure? Do we have examples for it too? I.e....
I wonder whether the following language is a context free language: $$A = \{w \in \{a,b,c\}^* \mid \#_a(w) + 2\#_b(w) = 3\#c(w)\}$$ where $\#_x(w)$ is the number of occurrences of $x$ in $w$. I can't find any word that would be useful to refute by the pumping lemma, on the other hand I haven't been able to find a conte...
With reference to features in languages like ruby (and javascript), which allow a programmer to extend/override classes any time after defining it (including classes like String), is it theoretically feasible to design a language which can allow programs to later on extend its semantics. ex: Ruby does not allow multipl...
The question is whether the following statement is true or false: $A \leq_T B \implies A \leq_m B$ I know that if $A \leq_T B$ then there is an oracle which can decide A relative to B. I know that this is not enough to say that there is a computable function from A to B that can satisfy the reduction. I don't know how ...
I have developed two algorithms and now they are asking me to find their running time. The problem is to develop a singly linked list version for manipulating polynomials. The two main operations are addition and multiplication. In general for lists the running for these two operations are ($x,y$ are the lists lengths)...
I applied the Master theorem to a recurrence for a running time I encountered (this is a simplified version): $$T(n)=4T(n/2)+O(r)$$ $r$ is independent of $n$. Case 1 of the Master theorem applies and tells us that $T(n)=O(n^2)$. However, this hides a constant dependent on $r$ in the big-oh notation: our recurrence has ...
It's well known that monotone polygons play a crucial role in polygon triangulation. Definition: A polygon $P$ in the plane is called monotone with respect to a straight line $L$, if every line orthogonal to $L$ intersects $P$ at most twice. Given a line $L$ and a polygon $P$, is there an efficient algorithm to dete...
I'm reading through the RMIT course notes on state space search. Consider a state space $S$, a set of nodes in which we look for an element having a certain property. A heuristic function $h:S\to\mathbb{R}$ measures how promising a node is. $h_2$ is said to dominate (or to be more informed than) $h_1$ if $h_2(n) \ge h_...
I often hear people talking about parallel computing and distributed computing, but I'm under the impression that there is no clear boundary between the 2, and people tend to confuse that pretty easily, while I believe it is very different: Parallel computing is more tightly coupled to multi-threading, or how to make ...
One of the definitions of a computably enumerable (c.e., equivalent to recursively enumerable, equivalent to semidecidable) set is the following: $A \subseteq \Sigma^*$ is c.e. iff there is a decidable language $V\subseteq \Sigma^*$ (called verifier) s.t. for all $x\in \Sigma^*$, $x\in A$ iff there exists a $y\in\...
I'm trying to find the best algorithm for converting an “ordinary” linked list into an “ideal" skip list. The definition of an “ideal skip list” is that in the first level we'll have all the elements, half of them in the next level, a quarter of them in the level after that, and so on. I'm thinking about a $\mathcal{O...
I am trying to search for an algorithm that can tell me which node has the highest download (or upload) capacity given a weighted directed graph, where weights correspond to individual link bandwidths. I have looked at the maximal flow problem and at the Edmond-Karp algorithm. My questions are the following: Edmond-K...
How can I prove that the language that the operator $A$ defines for regular language $L$ is a context free language. $A(L)= \{ w_1w_2: |w_1|=|w_2|$ and $w_1, w_2^R \in L \}$, where $x^R$ is the reversed form of $x$. I understand that since $L$ is regular so does $L^R$.also on my way for a CFG I can reach $w_1$ by the ...
Will there be a need to change the definitions of security if we have quantum computers? What cryptographic constructions will break? Do you know a survey or an article that explains what will be needed to change?