instruction
stringlengths
35
29.1k
I got interested in one problem. I have $N$ rocks, where rock with minimum weight have number equal to $1$, the next heaviest stone has a number equal to 2, etc.. So a rock with maximum weight have a number equal to $N$. And I have $N$ requests, each of N request contains two integers: $R$ $(1≤R≤N)$ and $S$ $(1≤S≤2)$....
Let P be the complexity class of languages decidable by Turing machines running in polynomial time. Say a prefix $s$ of a string $x$ is a long prefix (or an L prefix) if $|s|\ge |x|/2$. For a language $A$, let $LP(A)$ be the language of all L prefixes of strings in $A$. Show that $P$ is not closed under $LP(\cdot )$ u...
Huffman coding follows a bottom-up approach where as Shannon-Fano coding is top-down. Is that contrast similar to dynamic programming versus greedy algorithm (dynamic programming always give optimal solution whereas greedy algorithm is sub-optimal)? If yes why is Huffman called greedy? Why greedy algorithm can also be ...
Given a typical popular programming language, its native type theory is a dependent type theory which describes invariants, preconditions, predicates, and other generalizations of typical type-system features. The title says it all: what are some strong examples of popular languages which have a type system that can't ...
Input: A TM $M$ and an integer $k$. Output: Yes if $M$ halts within $2\uparrow\uparrow k$ steps (where $\uparrow\uparrow$ is tetration (iterated exponentiation)). Intuitively, it seems like this has to be NONELEMENTARY (and its decidability is immediate) from the undecidability of the halting problem. I'm asking becau...
I know the circuit depth (i.e. amount of sequential operations on the longest path) for long multiplication can easily be made $O(\log(n))$ (possibly at the cost of increasing the computational complexity by a small constant factor), and I’m pretty sure the same applies to Karatsuba and Toom-Cook. However, I don’t unde...
The concept of brain computer implants assumes that there's some net positive for either a machine or the brain when it comes to calculating or computing things. Usually there is a focus on what the computer can do for the human brain, but this takes the reverse. Essentially what exactly can the human brain do for a co...
Consider the decision LWE setting, where we have to distinguish between $(A, As + e)$ and $(A, u)$, for a randomly chosen $m \times n$ matrix $A$, an $n \times 1$ secret vector $s$, an $m \times 1$ Gaussian secret vector $e$, and a randomly chosen $m \times 1$ vector $u$. In many places, a "lossy version" of the settin...
So if someone proves with an algorithm that SAT can be solved in deterministic polynomial time, then P = NP and that's it?
The "Hack CPU" (Wikipedia/Hack_computer) is a theoretical computer design created by Noam Nisan and Shimon Schocken and described in their book and also used in their Coursera course Nand2Tetris, and in the game https://nandgame.com. Their CPU only has two registers, A and D. Both registers are loaded via the output of...
Consider this "generalized halting problem": $$ GHP = \{<M>| \mbox{ there are infinitely many inputs that $M$ halts on}\}. $$ I'd like to prove that $GHP\notin RE$, but it doesn't seem straightforward easy. Any ideas? My first thought was to try the opposite: suppose that there were at most $k$ halting inputs. Then we...
I assume that computers make many mistakes (like errors, bugs, glitches, etc.), which can be observed from the amount of questions asked everyday on different communities (like Stack Overflow) showing people trying to fix such issues. If computers really make many errors (as I assumed earlier) then critical tasks (like...
The complexity class $\mathsf{BPP}$ is typically defined as the class of all problems for which: Running an algorithm once takes polynomial time at most. The answer is correct with the probability at least $2/3$. The complexity class $\mathsf{PP}$, on the other hand, has $1/2$ instead of $2/3$ in the second constrain...
I've got a bit of a puzzle here that sits at the intersection of mathematics and technology. Hopefully this doesn't fall into brainteaser territory - I'm not sure a neat solution is possible! I have two devices. Each one has a short token they would like to share. I am happy for either device to get the other's token; ...
Let Q be a symmetric transition probability matrix on states 1 , . . . , n; that is $q_{i,j} = q_{j,i}$ for all i , j. Consider a markov chain defined as follows. Whenever the chain is in state i, the value of a random variable $X_i$ with probability mass function $P(X_i = j)= q_{i,j}$ is generated; if $X_i = j,$ then ...
There is a list of 3-dimensional points $(x_1,y_1,z_1),\ldots,(x_m, y_m,z_m)$, where all coordinates are non-zero integers. I would like to decide whether there exist positive real weights $w_x, w_y, w_z$ such that, for all $i$ in $1,\ldots,m$, $$ (*) ~~~~~~~~~~~~~~ w_x x_i + w_y y_i + w_z z_i \geq 0. $$ Here is an ...
Suppose I have the following code and I'd like to compute running time as function of $\ n$: sum = 0 i = n while i >= 1: y = 1 while y < i: y = y * 2 i = i-1 I think the y loop is running from $\ 1 $ to $\ \lceil \log_2(i) \rceil +1 $ and the outsider loop is from $\ n $ to $\ 1 $ so it should be...
If we add backspace to the output alphabet, are all the languages produced still context-free? (If not, then what are they?) The word (a, b, c, Backspace, Backspace), for example, gets interpreted as a.
I have been wanting to learn more about how computers work. Getting way ahead of myself, but as in would it be possible to build a computer from scratch by myself? I mean build the individual parts and everything that goes into it. I understand that this question is more on the side of computer engineering but I though...
Suppose we have a 6 vertices graph. We also have 6 gates. Each gate is attributed a path. For example, Gate 'A' will have to go to 'B'- 'C' - 'D' and 'E' Gate 'B' will have to go to 'D' Gate 'C' will have to go to 'A' and 'B' Gate 'D' will have to go to 'E' - 'A' and 'B' Gate 'E' will have to go to 'C' - 'E' and 'A' Ga...
The concept of reducibility in computability theory is very confusing for me. For example, as described in Micheal Sipser's Introduction to the theory of computation, I understand that if language A is reducible to B, then solving A cannot be harder than solving B, or in other words, solving B gives a solution to A. Th...
The lowest time complexity of search algorithms for sorted lists is $$O(n)=logn$$. The lowest time complexity of sorting algorithms is $$O(n) = nlogn$$ So in order to be able to use a search algorithm for sorted lists we first must sort the list which takes min of $$nlogn$$ time complexity.Since the brute force search...
I would like to generate helpful parser errors, telling the user how to fix their program. Specifically I have a deterministic context-free language $L$, given in the form of an $LR(1)$ grammar. I have a syntactically invalid string $w$ (i.e. $w \not\in L$). I would like to find some $w^* \in L$ which minimizes the edi...
This is about memory, not files or filesystems. So in a typical process, imagine you have a string "Hello world" that later gets changed to "Hello". Or a list of 100 objects later gets reduced to 50. Or a dynamic array, or other datastructures. This produces wasted space in memory. It's not solved with virtual memory b...
I needed to implement a priority queue for a project I'm working on and had this idea. In a priority queue BST implementation wouldn't it be more efficient if the poll node pointed to its parent since it's guaranteed to not have a left child? This would make polling faster since we don't have to traverse the tree to fi...
What is the difference between this two pseudocode and which one should i implement? function A*(start,goal) closedset := the empty set % The set of nodes already evaluated. openset := set containing the initial node % The set of tentative nodes to be evaluated. g_score[start] := 0 ...
When we use a set for doing Dijkstra's Algorithm, we use a pair of {distance,node} which we insert in a set. Most of the articles say that the first element of pair should be the distance , else we need to use a custom comparator, but why in the case of set if we use pair of {node, distance} the code still works. Anoth...
Note: I had posted this question on Stack Overflow, and got a suggestion to post it to CS Stack Exchange. The original question: You are given a list A of N integers. Here, N is an even number. These integers must be distributed into N/2 pairs and the power of each of the pairs is added. The power of a pair P(i,j) co...
I have been reading AIMA by Russell and Norvig, where they talk about different types of environments an agent may encounter. Here, they have described stochastic and non-deterministic environments being different types of environments. One final note: our use of the word "stochastic" generally implies that uncertaint...
I've seen a lot of mechanical computers based on gears and rigid rods, but none so far that consequently use belts (not chains) for transmission of information. Belts allow for easy negation (by crossed belts), simple logic gates (using different contact pressures of the belt on the green wheel or shaft), and even one ...
Is it true that simulating classical physical systems is in P, i.e. can be done efficiently on Turing machines or are there known exceptions? I'm thinking of chaotic systems but I'm also curious more generally whether there are theorems or counterexamples.
I have been studying the Branch and Bound paradigm. I came across an approach to solve the Travelling Salesman Problem using branch and bound where a specific kind of bounding function was used. I've been wondering why this bounding function (which performs a kind of reduction on the adjacency matrix of the graph under...
I'm reading this slides from a MIT course on parallel software performance. They introduced the concepts of Work $T_1$, Span $T_\infty$ and Parallelism (ratio $T_1/T_\infty$). What is called ''Parallelism'' here can be interpreted, according to the same authors, as the maximum possible speedup that can be achieved on a...
I have a problem that can be reduced to an assignment problem. (this is related to some cryptography problems) Which means we have a set $A$ of $n$ agents and an equal size set $T$ of tasks as well as a cost function $c(i,j)$, and one wants to find a bijection $\sigma: A\to T$ that maximizes the satisfaction of the age...
I've been working with Bresenham’s Algorithm in 2D and understand it is derived from the following logic: y = mx+c To get the slope error at a given point, the following equation is used: d2 is the distance from value Y to the whole integer above. d1 is the distance from value Y to the whole integer below. d1 - d2 = [m...
According to the Wiki article on NP-Completeness, NP-Complete problems can be solved in $O(c^{n^k})$ time (I'll call this EXP-POLY time). However, shouldn't the bound on all their run times be the tighter $O(c^n)$ time (I'll call this simply EXP time)? I ask because, for example, for the Traveling Salesman Problem, we ...
Suppose, for the sake of argument, that it was proved that $P \not= NP$. Then, this would imply that for every $NP$-complete problem, there is a "hardest instance" of the problem that cannot be solved in polynomiall time. Then, if $P$ were to not equal $NP$, what properties would be known about the hardest instances ...
Basically, I need to solve the multivariate case of the "closest subsequence sum to a given value K" problem, which is solved with dynamic programming as far as I understand. Let's say I have M rows of integer data. A = [ [a11, a12, .., a1n], ... [ai1, ai2, .., ain], ... [am1, am2, .., amn] ] And I have a target vect...
Prove that the unique language $A\subseteq \Sigma^*$ such that $AB$ is context free for all languages $\subseteq \Sigma^*$ is the empty set. If $A$ is not the empty set, there should be a way to construct a language $B$ so that $AB$ is not context-free. I'm not sure how to generalize this for arbitrary nonempty langu...
I have learnt about both articulation points and bridges and I have understood the algorithm used to find the number of bridges in O(n) time which is Tarjan's algorithm. But now, can I simply say that the vertices connecting the bridges are the articulation points with the additional condition that they should have deg...
Let $G$ be a vertex-labeled directed graph with unique labels $L$. Let $G_P$ be a path graph with the same vertex labels and the same number of vertices as $G$. I know that in the general case computing the Graph Edit Distance is NP-hard (if approximations are excluded) and APX-hard to approximate. I'm interested in a ...
I am trying to understand the reason as given in this answer If an ε-free grammar is not LR(0), then there is some state with both a shift and a reduce action. Since the grammar is ε-free, that state was reached by way of a shift or a goto. The previous state must then have had two different productions with the same ...
I am reading the book "Cracking the coding interview". In Chapter 4 they cover basic tree concepts. It says there that a complete binary tree is a binary tree in which every level of the tree is fully filled, except for perhaps the last level. To the extent that the last level is filled, it is filled left to right. Thu...
I'm learning about computability problems e.g. reducing the general halting problem to the halting problem on a blank tape. But before I can understand this problem I first have to understand what exactly $M_w$, $M_w[\epsilon]$, and $M_w[w]$ are. I know the concept of encoding a Turing machine $M$ e.g. by generating a ...
You are playing with boxes on a $K_{1, n}$-$\textbf{subdivision}$ graph $G:=(V, E)$ whose number of vertices is odd, i.e., $|V| \equiv 1$ (mod $2$) with a given central point $C$ such that $\forall v \in V - \{C\}, deg(v) \leq 2$. Actually, $C$ is the center of the star graph $G$. Your goal is to move $n:= (|V| - 1)/2$...
Problem This is a HW problem from CMU 15-455 (hw10, p1(a)), spring 17 by Ryan O'Donnell. Assume $L \in {\sf RP \backslash ZPP}$. Define $$ L' = \left\{ (x, y) : \text{either $x \in L$ and $y \notin L$, or vice versa} \right\}, $$ Prove that $L' \notin {\sf RP} \cap {\sf coRP}$. My Thoughts The path of this proof is cle...
I have an operation that is performed many times and is thus performance sensitive where I need to calculate product of a matrix and inverse of a matrix as below. Both matrices are 4x4 and consist of floats. M3 = Inverse(M1)*M2 Now in this specific scenario M1 and M2 very often equal each other. Let's say 75% of the ...
This is a purely theoretical question: among the known flood fill algorithms, there is one which does not require any dynamically-sized data structures, explicit or implicit: the so-called Walk-based filling, expressed there in structured English, e.g. ... while front-pixel is empty do move forward end while jump ...
A Markov chain $\{ X_n, n \geqslant 0\}$ with states 0, 1, 2 has the transition probability matrix $$P= \begin{bmatrix} \frac12 & \frac13 & \frac16 \\ 0 & \frac12 & \frac23 \\ \frac12 & 0 & \frac12 \end{bmatrix}$$ If $P\{X_0 =0 \} = P\{X_0=1\}=\frac14$ find $E[X_3]$ How to answer this question?
I'm looking for good introductory resources (books, articles, notes, websites, videos, e.t.c.) on polyhedral compilation. I'm especially interested in applications related to deep learning / GPU computation acceleration. Thanks in advance.
I have searched for a bit eventually arriving at well known websites like codeforces, atcoder, codewars, codinggame or the various OJs. They mostly involve solving tasks where usually the main focus is elementary discrete maths + data structures and algorithms. However, I cannot find any that target the more theoretica...
How does one formally prove that, given a DFA $M=\langle Q,T,\delta,q_0,F\rangle$, the following NFA $M^R = \langle Q_R, T, \delta_R, q_R, F_R\rangle$ recognizes the reverse of M's language? We build $M^R$ like this: $Q_R = Q \cup \{q_R\}$, where $q_R$ is a new state which will be the start state of $M_R$ $F_R = \{q_0...
Suppose that $P \not= NP$. Then my understanding is not all instances of NP-complete problems can be solved in polynomial time. That is for every NP-complete problem, there are a colleciton of instances of that problem where the solution (correct certificate) cannot be determined in polynomial time (I do not mean that ...
In linguistics, the word 'statement' means something that is true or false, closer to a declarative sentence, but in programming, the meaning is closer to an imperative sentence. What is the reason for this difference?
In our class the following exercises/examples were given: Compute/find $n_0$ and c from the formal definition of each Landau symbol to show that: $n^{2/3} \in \Omega(log^8(n))$. Then in the Solution the following was done: $n_0=1$ and $c=(\frac{1}{12})^8$. Show: for each $n>n_0: n^{2/3} \ge c \cdot log^8(n)$. $n^{2/3}=...
If $RA$ is context-free for a regular language R, is $A$ context-free? I think this statement is true. Let G be the CFG given by the rules $S_0\mapsto LA_1, S\mapsto LA_1, A_1\mapsto SA_2 | RS | 1, A_2\mapsto RS | 1, L\mapsto 0, R\mapsto 1$, where $S_0$ is the start symbol. How would one modify G to get a CFG that ge...
I was wondering how to determine (with proof) whether the context-free language generated by the following context-free grammar $G$ is regular, where $S$ is the start variable and $a$, $b$ are the non-terminals. $G:\ S\to aABb,\ A\to BAS \mid\epsilon,\ B\to a \mid b.$ It doesn't seem easy to determine exactly what se...
if two vectors are used for ex, vector<vector> temp; vector temp2; then what will be the space complexity, will it be O(n) or O(n^2)?
I'm designing an expression language that's trying to (a) be maximally compatible with a different ambiguous language; and (b) be LR(1). I'm facing the current fragment of the language: $$ \begin{align} S & → T \quad | \quad \texttt{prefix} \quad T \quad S \\ T & → F \quad | \quad T \texttt{-} F \quad | \quad \texttt{-...
I have just learnt about some typical result of fine-grained hardness in 15-455 by Prof Ryan: CNF-SETH implies ${\sf DIAMETER} \notin {\sf TIME}(mn^{1-\epsilon})$. (Here DIAMETER stands for the graph diameter problem). To prove fine-grained hardness, we construct reductions from $A$ to $B$, then "perturbation" on $A$'s...
Consider the following scenario. Let $x_1,...,x_n$ be a group of cars that all drive from some point A to some point B. Each car starts driving in index order. i.e. $x_1$ starts driving strictly before $x_2$ and so on. i.e. Each $x_i$ starts driving strictly before $x_j$ for any $j > i$. We also have a set of facts $Y$...
While I understand the process of considering/observing an algorithm and finding an average time, necessary to perform an operation that happens in this algorithm, I still cannot quite gasp the idea, or rather the expression: "The Algorithm has an amortized time complexity which is cost./linear etc". What to understand...
Are there any NP-complete problems where the fastest known algorithm solves the problem in superexponential time (like $O(n!)$ time)? Every NP-complete problem that I am aware of has fastest known algorithms that are all exponential time, but it is not obvious to me whether there is anything preventing such problems f...
I am a student who is currently finishing second year of university mathematics. This summer I have to choose a topic for my diploma. Because I am particularly interested in computer science I am seriously considering choosing a topic about programming language theory. But I have one problem - I will be taking a course...
Can anyone help me figure out the error in my approach to this problem from Sipser 1.18 (1.6f)? Write a regular expression for the language L = {w | w does not contain 110} So, the answer I get is: $(0 \cup 10)^* (1 \cup 111^* \cup \epsilon)$ And the answer given is: $(0 \cup (10)^*)^*1^*$
Consider two finite languages, $L_A$ over alphabet $A$ and $L_B$ over alphabet $B$. $A$ might be the same as $B$. Since $L_A$ and $L_B$ are finite languages, there exist minimal acyclic deterministic finite-state automata to decide them: $M_A$ and $M_B$ respectively. So $x \in L_A$ iff $M_A$ accepts $x$, and $y \in L_B...
I get that the argument for this set $\{ w \in \Sigma^* : M_w[\epsilon]\downarrow \land |w| \leq 7\}$ to be decidable is that $|w|\leq7$ meaning it is a finite set and therefore it can be decided. But my problem is that for each of the $w$ it could be the case that one has to wait an infinite amount of time in order t...
Why there is no final state for a transition system? And why do NFA and DFA have final states? The transition system may or may not have any terminal states, but NFA/DFA has at least one final state (for describing its language). I just want to know about the basics. Can I call a DFA a transition system (because DFA is...
In Robert Lafore's book "Object Oriented Programming in C++, Fourth Edition", on page 450, he has a section on the bubble sort. The way he describes it is as follows: Here's how it works, assuming we want to arrange the numbers in the array in ascending order. First the first element of the array (arr[0]) is compared ...
The complexity book by Arora and Barak mentions that "branching programs of constant width (reminiscent of a TM with O(1) bits of memory) seem inherently weak." I am not able to figure out how both are connected. Can anyone here shed a light on this?
Consider a 2-dimensional version of generating points in the circumference of a unit radius circle, independently generate each coordinate uniformly at random from the interval [-1,1]. How to generate a random point in a higher dimension? High level idea is also welcomed. If we try to extend the above idea (2-dimension...
I have read this question on compile time gc and what I understand from it is that the compiler wouldn't know if a variable is referenced or not by some other object due to conditional statements (because they are computed at runtime), and that is why runtime GCs are used, as they can dynamically check if a variable is...
I have a pubsub channel where an event is fired every time a user logs in, and I want to be able to query the unique users in a date range. Solutions I thought: Put the data in bigquery, and then use APPROX_COUNT_DISTINCT, but it's too expensive Same as above, plus a cache. Past data doesn't change, so it's a good app...
Prove that there does not exist a Turing machine M such that for every Turing machine K that halts on all inputs, $M$ accepts $\langle K\rangle$ if and only if $L(K)$ is infinite. The above question came from a set of final practice problems for a computability course. Suppose such a Turing machine M exists. Maybe ...
I know that whenever click on .exe, it will be moved into RAM so cpu can execute machine code line by line. But what if .exe is bigger than RAM? for eg: I play games which take up more space than my RAM. My RAM is 8gb, but i can still play them. How's that possible
In the chapter on space complexity in "Computational Complexity: A conceptual perspective" by Goldreich, it is stated (ch 5.1.2, p 146): It is tempting to say that sub-logarithmic space machines are not more useful than constant space machines, because it seems impossible to allocate a sub-logarithmic amount of space....
I'm searching for the generic name of an algorithm/method that would allow me to solve this type of problem efficiently. I have a continuous line which I traverse, from one side to the other. Along that line are buckets, placed at various positions which have a given size. Along the line are also items that I have to p...
Is it true that if a given DFA $M = \langle Q, \Sigma, \delta, q_0, F\rangle$ with $|Q| = n$ accepts all strings $w \in \Sigma^*$ such that $|w|\leq 2n$ then it accepts any $w \in \Sigma^*$ ?
I am reading a research paper in which following equation is given: $\underset{\small{X}\\\text{s.t}\sum_{(i,k)\in \mathcal{A}}x_{ik}=1, \forall i\in \mathcal{M}}{\operatorname{max}} u$ where $\small{X}$ is a binary variable that collects all $x_{i,k}$ $\mathcal{M}$ is a set of clients and say its elements are $\mathca...
If I'm given a minimum spanning tree, my understanding is that it is a structure that connects all nodes to each other through some path, and that the overall weight of the tree is smallest. However, does this necessarily imply that for any 2 nodes V1 and V2 in the MST, that the path between V1 and V2 is definitely the...
In a Talk by Herb Sutter C++ and Beyond 2012: Herb Sutter - atomic Weapons 1 of 2 at 46:30 the point is made that only around 15% of the physical space (or the transistors) on a CPU do actual processing while the rest is basically just caches. Further it is mentioned that of those 15%, only around 1% account for actual...
How many page faults are there in the following accesses of pages in case of FIFO mechanism where page frame size is 8? $$11,21,23,53,8,7,10,3,3,38,3,37,7$$ Soln: This question appeared in one of my the entrance tests for a company and I am pretty sure I got it right but there was no option matching what I had thought....
Source: https://oj.vnoi.info/problem/cryptkey (problem statements are in Vietnamese, so here it is translated). There is a set $S$ of positive integers. If $A$ and $B$ are in $S$, then $\gcd(A, B)$ and $\text{lcm}(A, B)$ are also in $S$. You are given $n$ positive integers $a_1$, $a_2$, ..., $a_n$, which are elements...
Background: I'm working on a data structure benchmark tool to benchmark insert and search time and I am trying to improve my own implementation of a BST to support parallelism. I have implemented a Binary Search Tree, it is a very basic (naive) tree structure: class Node: Node? right; Node? left; long value; ...
A sparse 1D array of integers is commonly encoded as pairs of [index, value], which consumes 2 memory spots per value. A dense 1D array is commonly encoded as a linear array of values [value1, value2, ..., valueN], consecutive in memory. If an array is encoded as a sparse array, but grows in density, until it becomes d...
I'm trying to sort the elements of a set of "goal" stacks to minimize the number of pushes/pops to reach each state. The inputs and outputs can be some other structure rather than stacks, they just represent a target state of the stack. Each goal must be reached in the order given in the input. For example, given this ...
I was reading a textbook on COA, it says If the processor is going to ignore the interrupt request line till the execution of the first instruction of the ISR, how will it know which device to service? I mean the processor is ignoring the interrupt requests so how does it acknowledge the request in the first place?
I want to find the maximum possible value of an unknown function on a rectangle. What is the optimal method of doing this? Do I need to use simulated annealing?
I am interested in understanding what we mean by a von Neumann architecture and need something at a very introductory level. Does anyone know of any good and readable references or notes that will introduce me to this topic?
Are there systems in computer science where we have several logic systems working all at once and without isolation? I am thinking there are system where subsystem A uses Paraconsistent logic, subsystem B uses Four-valued logic, and subsystem C uses ordinary logic, but the elements inside those subsystem don't interact...
I'm trying to identify an algorithm to solve this computational problem Input: Bipartite graph (V, W, E), with E ⊆ V×W A fixed order for both V and W: V = (v1, ..., vn) and W = (w1, ..., wm) Output: The subset of E of maximum cardinality in which there are no crossing edges. The mental image is that the two vertex ...
I have to make an application as my Parallel Computing university course project. The application should make use of parallel processing. Any ideas or examples for these kinds of applications ??
Preparing for my finals in my "advances algorithms" course. Usually there is a question to prove one of the theorems that was given over the course. I'm currently trying to write a full proof of the following statement: Self-organizing list that uses Move-to-Front is 2-Competitive. For the completeness of the questio...
I have a project to match two groups of people. Under insurance, if the initial sales agent leaves the insurer, their customers will become so-called “orphan customers”. I've given a big data set containing 100,000 customers with matched agencies (13k agencies in total), for each customer and each agency, it provides ...
Let $T$ be a hexagonal tiling of the plane and assume we are given a simple polygon $P$ (we define $P$ as the union of the points on its boundary and its interior). The task is to find the subset of $T$ that intersects $P$ as fast as possible. We can assume that the diameter of the hexagons are some fixed constant $c$,...
I am working through Sipser, and have come accross the following claim, "any $f(n)$ space bounded Turing machine also runs in time $2^{O(f(n))}$", which can be proven by looking at the upper bound on the number of configurations a Turing machine that uses space $f(n)$ can take. An implication of this claim is that a $...
First Few Iterations of the Algorithm We have an algorithm in which a squirrel visits the nodes of a directed graph. Our graph has two colors of edges: black and white. Initially, the graph has black edges only, and no white edges. The squirrel never changes the color of an edge from black to white. The squirrel simply...
I have a problem that consists of finding a good solution for a graph that has vertex weights (and this cost is the highest priority), but also has edge costs.
Various computational hierarchies describes the relative expressivity of different classes of languages, machines, or other models of computing, with the classic progression for Automata Theory [0] being: Deterministic Finite Automata (DFA) < Push-Down Automata (PDA) < Turing Machines (TM). These correspond to the foll...
From what I understand, LL and LR parsing require a grammar to be in "canonical form", i.e. only productions of the form A -> b1 b2 ... bn, where b1, ..., bn are either a terminal or a nonterminal. To express alternation, one would add multiple productions with the same LHS. However, some EBNF expressions would require...