instruction
stringlengths
35
29.1k
Suppose a problem: Given $n$ pigeons and $m$ holes of sizes $b_{i\le m}$ decide if you can put all pigeons in given holes. It's possible to find a refutation of size $\mathcal O(n^2\log^2 n)$ of this principle when it's encoded as a conjunction of threshold functions, therefore there must exist a polynomial size Freg...
I have been wracking my head around the understanding on how to calculate $N_{1}(f)$ and $N_{0}(f)$ from the communication matrix. Definitions: $N_{1}(f)$ = least cost of non-deterministic protocol that accepts $f^{-1}(1) = \{(x,y) : f(x,y) = 1 \}$ $N_{1}(f)$ = ceiling( log(number of monochromatic rectangles needed to ...
Let me first specify my question. I am looking for decision problems with polynomial algorithms but such that the simpliest or fastests verifiers do many computations. Here by verifiers I mean both YES and NO verifiers. It might be the case that this is too specific. By "verifiers with many computations" I mean verifie...
Problem: given a set of classes and classrooms, then given a set M of pairs (a,b), which means it is valid assignment from class a to classroom b(ex:(c,2), (c,3), (d,2), means class c can be assigned to classroom 2 or 3, class d can only be assigned to classroom 2), each class can only be assign to a classroom at the ...
I'm working with sparse vectors represented as index (array of unsigned integers) and coefficient (array of floats with the same dimension). Suppose I have many vectors of different length, and I want to add them all, summing the corresponding coefficients for each unique index. I need to calculate it the fastest possi...
The Short Version of my Question The following two regular expressions represent two sets of strings. REGEX EXAMPLES OF STRINGS OF TEXT THAT MATCH THE REGEX I?D?A?H?O? “IDAHO”“ID”“IDH”“IDAHO” I?L?L?I?N?O?I?S? “ILLINOIS”“IL”“ILINOI”“ILLN” What regular expression (regex) represents the intersection of the t...
Historically, processors often increase in bit-size by powers of 2, such as 8-bit, then 16-bit, 32-bit, 64-bit. Although this has not always been the case, it is a well known trend. One benefit is backwards compatibility. Another is that components can be scaled by combining two 8-bit components into a 16-bit, and so o...
I recently asked a question on Stack Overflow and found that I need to solve a 0/1 knapsack problem. However, the problem has evolved to one where the knapsack problem is only part of it. The problem is as follows: I have a variable named num_items which determines the number of items in the knapsack. Each item has a v...
If I understand CHC correctly, simply typed lambda calculus corresponds to propositional logic. As HM allows polymorphic definitions by let-expressions, my guess is that it would correspond to a version of propositional logic where universal quantification over variables is allowed. But as polymorphism in HM is only al...
Let $L$ be a language for which there exists some turing machine deciding it in at most $n^2$ steps. Is it decidable whether a given turing machine $M$ decides $L$ and runs in at most $n^2$ steps? I expect the answer to always be "No", regardless of $L$, but I fail to see exactly how.
I had a discussion with a C++ developer on whether aborting a thread causes memory leaks. His opinion on how aborting a thread works was all destructors of the stack objects of the thread to abort are executed by the C++ runtime the C++ runtime calls the OS method to abort the thread the kernel gets rid of the stack m...
Here is the explanation in Sipser's. For step 3, why should we accept only when none of the markers lie on an accept state? If the alphabet of the language is $\Sigma = \{a,b,c\}$, and after the first iteration, let's say $a$ and $b$ lie on the accept state while $c$ doesn't (meaning that c is not in the language). Thu...
What is the parameterized complexity of Weighted-CNF-SAT, when parameterized by the number of clauses? Input: A CNF formula $\phi$ with $m$ clauses and $n$ variables, and an integer $k$. Parameter: $m$ Output: Does there exist an assignment to $\phi$ with hamming weight $k$? When this problem is parameterized by $k$ it...
The class $\mathsf{NPO}$ is defined as optimization problems such that the corresponding decision problems defined with a threshold are in $\mathsf{NP}$. Let $A$ be an optimization problem and $B$ a decision problem associated to $A$ with a threshold. If we can solve $B$ in polynomial time, is it the same for $A$? I ha...
There are some $n$ people and $2 n$ items. Each person assigns a positive value to each item. The items should be allocated to the people, giving exactly 2 items to each person. The value of a person is the sum of values of the two allocated items. The goal is to maximize the minimum value of a person. For example, sup...
I am writing a program where I need to have a circle animation that grows from a start value to a end value and back to the starting value. I was able to come up with a semi-solution. double radiusFromProgress(double progress, double maxValue) { // Ensure progress is in the range [0, 1] progress = progress.clamp(0....
In the classical set cover problem, we are given the set $U$ of elements $\{1, \dots, n\}$ and a collection $C$ of some subsets such that their union is the whole set. Now, I will introduce the first small twist: instead of searching for one cover, we have a target number $t$ and we need to find $t$ disjoint covers. F...
How to create a structure which acts as union of ranges. In that structure new ranges can be inserted beforehand and then some queries are asked to find out if the given point is covered by any of the ranges. What are different approaches and space/time complexity tradeoff?
My wife has a small workshop where she fixes dolls. She works alone without any external help. She has N orders from her clients, she estimates each order and she has deadline for each order. She asks me to make a program which will create a schedule for her. She wants to minimize a number of overdues. Also the progra...
I am looking for some greatest references that could help me understand the theorem $MIP^* = RE$ ($MIP*=RE$) step by step. The paper (The Connes Embedding Problem: A guided tour) covers various topics related to this problem, but it is very brief. As a student with bacgrouds on operator algebras (von Neumann algebras,...
Any $\mathsf{NC}$ circuit could be presented in SAT form via Tseytin transform. This applies in the reverse too: an arbitrary SAT instance could encode any $\mathsf{NC}$ circuit. Now, Frege proof system is said to be limited with $\mathsf{NC_1}$ circuits. In that case, does it mean that $\mathsf{NP=coNP}$ iff there exi...
Of course, it isn't possible to construct them directly since we hasn't these type constructors, but only function constructor (arrow). But suppose there are 2 types $A$ and $B$, from which we need to create a product (or tuple) type $A*B$ and also sum type $A+B$. Let's remember the algebra of types: functional type $A...
I am trying to understand why the above is not the case. In my understanding, if $P = NP$ I can replace a deterministic machine with a non-deterministic and vice-versa. Hence, I will always have the exact same computational tool ...
For simplicity, let's assume all Turing machines print 0 or 1 on the tape. Consider an algorithm $A$, which, given any Turing machine $T$ as the input, outputs $x\in \{0,1\}$, satisfying the condition that if $T$ halts, then the last symbol printed by $T$ is $x.$ When $T$ does not halt, it does not matter what the outp...
Consider an $n \times n$ matrix of integers. Define a boundary in the matrix to be a sequence of cells, one per x-coordinate, where the y-coordinates of the boundary either stay the same or go up/down by one for successive values on the x-axis. I would like to find a boundary that maximizes the sum of the cell values o...
I have a set cover problem in the real world, it is a unicost set cover problem, with many subsets(around 10~30 million subsets, yes, no mistake here). Due to the nature of the problem in real world, it is kind of easy to find all the exact covers of the problem. I am trying very hard to find a better set-cover solutio...
Let $B$ and $C$ be two languages on $A = \{a,b\}$: $B = \{ w \mid w \text{ has the same number of }a\text{ and }b\text{ symbols}\}$ $C = \{ a^n b^m \mid n,m \ge 0\}$ Describe $B \cap C$ and determine whether $B$ is regular or not using only the closure property of regular languages. I reasoned like this: $B$ is not r...
Let us say I have an empty graph G and a list of nodes N to add to the graph one-by-one. Let us say that I will have a node X that I do not yet know, but will know after I construct my graph G. My ultimate goal is to find the shortest distance from each node N to X, in the weighted graph G (For some context on why I ne...
My 1st question ever on stackexchange, please be nice to me if it's too naive :) I read the map reduce paper and i discover distributed system is expensive. As an example in the paper, roughly speaking, approx. 1700 machines with 30000 mb/s throughput compares to non distributed single machine with 500mb/s ssd, it's 60...
From Cook & Levin's theorem we know that all Problems in NP are polynomially reducible to SAT: $ \forall_{L\in NP}: L \leq_{p}SAT$. Is the opposite also true? That is if we know that a language L is reducible to SAT in polynomial time, can it be also stated that it must be in NP? $L \leq_{p}SAT \Rightarrow L \in NP$ I ...
Similar to the classic 2D strip packing problem, we want to put N blocks into a 2d strip and minimize the height of the strip. Each block has to be put at the fixed x-coordinate. The width and height of all blocks are integer. Below is an example of 4 blocks: you can only move every block up and down to reduce the ove...
Following this blog post about the Arc Consistency algorithms. Namely, the explanation on AC4. Consider the following example: If I understand AC problems correctly. Then: We have two known variables {X,Y}. domain(X) = {1,2,3} and domain(Y) = {2,3,4,5} The constraint table can be defined as (X,Y)=[(1,2),(1,3),(1,5),(...
I am currently reading 'Designing Data Intensive Applications' by Kleppman. In the SSTables and LSM Trees section, it is mentioned that one of the advantage of SSTables is: "Since read requests need to scan over several key-value pairs in the requested range anyway, it is possible to group those records into a block an...
Given an Oracle Turing machine ($OTM$) that solves Problem π in max. 2n space, so $O(n)$ space and $O(n^2)$ time. Is there a DTM that can solve $π$ in $O(n)$ space if time doesn't matter? (The length of an instance $I$ of $π$ is n) I would say the answer is yes. Construction: We already have a DTM M', which can verify ...
Suppose we have a finite set of programs, say, something like every Turing machine with 2 states and 7 symbols. After running all of them for a very long time, we've narrowed it down to a small subset thereof. Of those remaining, let's suppose that at least one will run forever and at least one will eventually halt, an...
In other words: If $A \leq_{p} B$ and $A \in NP \Rightarrow B \in NP$ From my deduction this is has to be false. We know that if $A$ is NP Complete $\Rightarrow A$ NP-Hard and $A \in NP$, then $B$ is NP-Hard but we can't say for sure that $B \in NP$. I struggle to understand why though.
I believe I learned (and later forgot) a term for two (or more) objects/dictionaries, with the same property schema. Googling has not helped. For example, these objects are TERMs because they have all the same properties.
Is the time complexity of for(int i=0;i<n;i++){i*=k;} $O(\log_k n)$? The problem is number 8 from GeeksForGeeks: https://www.geeksforgeeks.org/practice-questions-time-complexity-analysis/ I trace the program by hand and got stuck. I could not prove that the answer is $O(\log_k n)$. I made a mistake somewhere. Assume $...
From Natual Proofs Specifically, natural proofs prove lower bounds on the circuit complexity of boolean functions. A natural proof shows, either directly or indirectly, that a boolean function has a certain natural combinatorial property. I haven't read the mentioned paper. Can somebody explain what is meant by "natu...
I am asking this in the context of the following question: Let N be a non-deterministic Turing Machine. We say that N faces a dilemma if at some point in its working, it encounters a situation where the finite control is in the state p, the head scans the tape a, and $\delta (p, a)$ offers multiple (two or more) possi...
Consider our alphabet set is $\Sigma$. Suppose $L\subseteq\Sigma^*$. I want to show $L \cap L\Sigma^+=\emptyset$ as one of the bellow options: $x,xy\in L\implies y=\lambda$ $x,xy^2\in L\implies y=\lambda$ I think the first is true but I have no idea to show that the second is false.
i'm trying to write an algorithm to reconstruct the original array from the sorted one. considering input value is a string of 1s and 2s which 1 means in merging part of merge sort, element from left subarray is chosen and 2 means element from right subarray is chosen. how can i do it? specially i have problem on that ...
This is a self-study inspired by the trivial https://leetcode.com/problems/buy-two-chocolates/. Basically the question is as follows: if you have a value of money m and a list of prices, imagine you are a hungry child who wants to spend all of their money on two chocolates. Return the two prices that leave the least am...
The algorithm developed by Keith D. Cooper, Timothy J. Harvey, and Ken Kennedy is widely used in industry for building dominator tree, but I cannot follow the proof in the “Engineering the data structure” section. Specifically, the claim of with this order, if $\operatorname{Dom}(a) ∩ \operatorname{Dom}(b) \neq ∅$, th...
Linear Search has O(n) T.C and Binary Search have O(logn) T.C. But how come Linear Search generates fewer page faults? Is there another searching technique that causes a lesser number of page faults than linear search?
Suppose $L$ is a regular language. Let $R\subseteq L$ be a language with maximal size such that for each $x,y\in R$ neither $x$ be a substring of $y$ after removing a substring from $y$ nor $y$ become a substring of $x$ after removing a substring from $x$. Could we conclude that $R$ is finite? My thoughts are as follo...
The original paper of Bully algorithm [1] does not make any assumption of a synchronous processing. But I see few lectures explicitly call it suitable for synchronous processing. I am not sure why do we need to make an assumption of lock-step global iteration (aka synchronous processing)! First, I see that each ELECTIO...
To begin with, if I understand correctly, in a simply typed lambda calculus, typing, type checking and type inference are always decidable. In the "full-fledged" polymorphic (terms depend on types) lambda calculus, type inference is undecidable. The same is true for types depending on terms. Now I have 3 questions: Wh...
While the shortest path can be calculated with $O(V+E)$ time over a weighted directed acyclic graph using topological sort, I wonder about the running time of the following BFS type algorithm I thought of. BFS_requeue(v): Initialization() push(s) //push the source node while the queue contains at least one vertex: ...
I've been exploring the Least Recently Used (LRU) page replacement strategy, and I've come across a point of confusion that I would appreciate some clarification on. As I understand it, in LRU, the page with the lowest (oldest) last access time is considered the least recently used and is a candidate for replacement. H...
Consider the following problem: For $k \le n$, what is the smallest number of edges in the graph with $n$ vertices so that the maximum independent set has size at most $k$? I.e., given an empty graph on $n$ vertices, I want to add the smallest number of edges so that the maximum independent set has size $k$. Let's de...
I'm reading Hopcroft's book about computation theory and wondering about how fast can u find all nullable symbols in CFG.
Given an $n \times n$ grid of integers, I would like to compute the circular area which gives the maximum sum of integers within the area. For example: In this picture, the integers 1, 0, 1, 2, 3, 1, 2, 1, -3, -2, 2, -3, 1, 3, -2, 0, 2, -1 etc are all within the circular area. If we restrict the circular area to be ce...
While reading CLRS (4th ed.) regarding the analysis of the expected time for QuickSort, I encountered an alternative approach. The analysis involves the following steps: Given an array of size $n$, the probability of choosing any particular element as a pivot is $1/n$. To formalize this, an indicator random variable $...
How would you build a fully connected neural network that learns eigenvalue decomposition efficiently? I wanted to build NNs that can predict certain properties about matrices which are NP-hard to compute but might require eigenvalue decomposition. However, I am not sure if hardcode-calculating eigenvalues at any speci...
Suppose we are given a $n\times n$ matrix that is sorted row-wise and column-wise. We want to find the median in $\mathcal{O}(n\log{n})$. This is my approach: We know median is such element that is greater than exactly $\lfloor\frac{n^2-1}{2}\rfloor$ elements. In such matrix, we always know that minimum value is the fi...
I've read the stable matching chapter in Kleinberg and Tardos's Algorithm Design and was wondering how one can show whether a stable matching under a given set of constraints exists. K&T introduce a modified algorithm that generalizes Gale-Shapely with forbidden pairs. They write We will show that there is always a st...
Suppose we are given a $n$-vector $A$ of real numbers. We need to find the longest sequence of symmetrical numbers. The numbers $a_i$ and $a_j$ are symmetrical if they are located at the same distance from element $a_k$ and $|a_i-a_j|< \epsilon$, $\forall i < j$. Question Can it be done in less than $O(n^2)$ comparison...
Considering Deutsch–Jozsa algorithm problem statement, of not being able to recognize "constant functions" from "balanced functions" on single call conventionally is clear to me... Now quantum part, slightly modifies the "problem" function, from being a function (due to how quantum circuits work on gate based quantum c...
So I was doing this problem, but it led me to a different solution. The actual solution is this: Problem - Farmer John has N hills on his farm (1 <= N <= 1,000), each with an integer elevation in the range 0 .. 100. In the winter, since there is abundant snow on these hills, FJ routinely operates a ski training camp. U...
I am reading some notes on parameterized complexity located here. Under the topic of "Kernalization" (section 3, page 4) they state: When faced with the task of solving an NP-Hard problem, almost every practical computer implementation performs preprocessing steps or data reduction steps. The goal of such a subroutine...
I'm struggling to grasp the intuition behind the concept of an index set. By definition, a set $I$ is called an index set if $\forall i,j: i \in I$, $\phi_i = \phi_j \implies j \in I$. This implies that if we have a program with indices $i \in I$ and a different program $j$, both computing the same function, then $j$ i...
I don't know if the title of the question is accurated or not, but I was thinking of the following problem: I have a set of numbers, let's call them identifiers. Each identifier is stored on a 64-bit long integer; but in practice I only have, let's say, never more than 4 million different identifiers at any time. I wa...
An in-order traversal of a binary search tree (BST) produces a sorted sequence. I wonder, if we perform an in-order traversal of a binary tree and obtain a sorted sequence, does that imply that the tree was a BST? (Is it a necessary and sufficient condition?) I was looking for an algorithm to check if a given binary tr...
Consider the following problem in 2-party communication complexity, where Alice sends a single message to Bob who must compute the output. Alice gets as input a bit vector $X=(x_1,...,x_N)$, for some integer N. Bob gets as input an index $i \in [N]$ and gets $x_1,\dots,x_{i-1},x_{i+1},\dots,x_N$. Goal: Bob must outpu...
I currently study well known dependency testing for automatic loop parallization from parallel compilers (ZIV, SIV, MIV, Single Variable Constraint, Multiple Variable Constraint, Acyclic Test, Fourier - Motzkin variable elimination, Delta test, Lambda test, Range test, Omega test, power test and Constraint Matrix Test)...
Assuming that the input $n$ is given as a decimal number. I was asked to prove whether the function $f: \mathbb{N} \rightarrow \mathbb{N}$ where $f(n) = 2^n$ is computable in polynomial time using TM or not. My guess is that the function cannot be computed in polynomial time but I can't figure out how I can prove it. S...
I'm just getting started with lambda calculus and I see that the fixed-point $Y$ combinator is defined as: $Y = \lambda f . (\lambda x . f(x x))(\lambda x . f(x x))$ (*) I read here that something like $t s$ (where $t, s$ are both terms) represents an application of a function $t$ to the input $s$, so in (*) I suppose ...
The following picture is a block diagram of an arithmetic unit dedicated to IEEE 754 floating-point addition from Computer Organization and Design RISC-V Edition: The Hardware Software Interface 2nd Edition book. My questions are: Why are in the sketch, the sign of the numbers ignored, while the final result has a sig...
This is my dynamic programming solution in Python to the problem of finding the cost of the optimal binary search tree: def optBST(freqs): """C(i,j) = min(C(i,k) + C(k+1, j)) + sum(freqs[i:j])""" # i references the rows in the 2D array, representing the starting element. # j references the columns in the 2D...
I find the Russian Elbrus CPU fascinating. It seems that it is fairly decent at performing calculations, and security. This is likely as it is heavily specific for military and financial industries, within Russia. Less focus was put on end user desktop computers. However, I am confused about the decision to use the VLI...
I work with big integers that I need to convert to and from strings, and to and from different bases. In JavaScript, BigInt allows to convert an integer to a string in a chosen base by doing: 12345n.toString(9) Unfortunately, when parsing a string to convert it to an integer, BigInt only accepts bases 2, 8, 10, and 16...
The Ackermann function is the textbook example of a function which is total recursive but not primitive recursive. If we want to implement it in some programming language we will need to use a priori unbounded loops (generally using while or goto). I am looking for an algorithm used in real situations (e.g. in computat...
I was thinking about an efficient binary search for unsorted arrays with $n$ entirely unique elements, and came up with something that probably already exists. Here's how it works: At each level of recursion (starting with $k=1$), you have $2^{k-1}$ pairs of searchers, taking up some $O(1)$ memory each. In each pair, t...
Section 1.9 Binary Strings of the textbook Introduction to Lattices and Order, second edition, by Davey and Priestley, says the following: Let $\Sigma^\ast$ be the set of all finite binary strings, that is, all finite sequences of zeros and ones; the empty string is included. Adding the infinite sequences, we get the ...
$L_1$ and $L_2$ are two languages that have a finite deterministic automaton. $Σ = \{0,1\}$ for the two languages. Let $L=\{x∈L_1\mid \text{there exists } y∈L_2,\text{such that } \#_0(x)=\#_0(y)\}$, here $\#_0(x)$ means the number of times $0$ appears in $x$. This means we keep every word in $L_1$ if there is a word in...
Consider the figure in Exercise 2. If the current machine code that executes is 0x214bfffd and the values of the registers in the processor are as shown below, what is then the value of the input WD3 ? Answer as a 32-bit hexadecimal value. at = 0x00011021 v0 = 0x5234f1a0 v1 = 0x1114f111 a0 = 0xff001231 a1 = 0xffffffff ...
Could someone help me understand why in the below proof, if $k > log_{2}n$, then $P(N_i=1)< \frac{1}{n}$?
Let's say a Language L is NON-semi decidable and undecidable. Let's also take the Halting problem H, which is a semi decidable and undecidable language. Is it possible to reduce L to H in a many-one reduction? I know that both are undecidable languages, and we can reduce an undecidable language to another undecidable ...
I've been working on the following challenge on LeetCode: Problem: Given a string s, check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. During my exploration, I stumbled upon an interesting solution: def repeatedSubstringPattern(s: str) -> bool: ret...
Compared to "vectors addition" which can naturally work independently for the summation of each of its corresponding elements, it allows parallel work by processors. Example: [1 2 3] + [4 5 6] = [5 7 9] Which only requires 1 iteration. How to make the "cumulative sum" operation algorithm work in parallel on a vector? ...
I read the wikipedia article: https://en.m.wikipedia.org/wiki/Peterson%27s_algorithm What I don't understand is how the algorithm is guaranteed to work when the processor or processors are switching between threads. What stops simultaneous advancement?
The following is from lecture notes for Concepts in Mathematics from CMU (William Gunther): I am confused about the bolded sentence in the last line quoted here: Theorem 4 (Ramsey's Theorem). For any k, l, there is some N such that for any edge two coloring of $K_N$ with colors 0 and 1 there is either a monochromatic k...
Suppose we are given an arbitrary rooted tree. We want to find two nodes that have the maximum distance among all pairs of nodes. I am looking for an algorithm with time complexity $\mathcal{O}(n)$, where $n$ is the number of nodes in the tree. Note that there may be more than one pair of nodes that satisfy this condit...
How does this data structure work and what is its application? class X: def __init__(self): self.x = 0 def plus_one(self): self.x = self.x + flip(self.x) def get(self): return 2**self.x #2 raised to the power of x The flip() function is a random function that returns $1$ with prob...
The square-root sum problem is: given positive integers $a_1,\ldots,a_k$ and $b_1,\ldots,b_k$, decide if $\sum_i \sqrt{a_i} > \sum_i \sqrt{b_i}$. The exact run-time complexity of this problem is an open problem, as far as I know. Can this problem be solved approximately using convex programming? I thought of the follow...
Is lock conversion (upgradation) from $Shared$ to $Exclusive$ allowed in Basic Conservative Strict Rigorous types of 2PL techniques. Following is an example of disallowed attempt of lock conversion for a non serial order of transactions $T1$ and $T2$:
I spent the last couple of days trying to understand the different asymptotic notations but it seems I'm hitting some conflicting information. For context, I believe I've understood the formal definition of different notations, as they are fairly similar to the definition of limit I've learned before. It also seems to ...
I don't know complexity class theory well so I might make some categorical errors, but I will try to ask this question anyways. Suppose you have written a function in some programming language which solves an NP-complete problem. There must exist an algorithm which can verify the correctness of an (input, output) pair ...
In the text of my book it says that this language is context-free so I tried to prove that the conditions of the Pumping Lemma are fulfilled. If, for example, I take the word $aaabbbc$ I can divide it like this: $u = ε, v = a, x = a, y = ab, z = bbc$ So the conditions: $|vy| > 0$ $|vxy| <= p$ (if I consider p = 3) are ...
I've tried quite a large amount of examples, starting from 1 bit all the way up to 5 bits yet I couldn't put my finger on any recurring pattern of words that are accepted. the DFA is as such: The only language I could come up with that sort of covers this, is: $L=\{w: \#_1(w)\geq 1 \; \& \; ends\;with\;even\;no.\;of\;...
Finite automaton is a well-known topic which finds applications in software engineering (e.g. pattern matching or regular expressions in general). ω-automaton are another kind of automaton, defined similarly to finite automaton except that they are designed to be run on infinite words (which can be thought of as stream...
Id say this is the first case of Master Theorem, but when I try to prove that the limit of f(n)/ n ^ (1-E) is 0, I cannot do it. Does anyone have a solution?
I was looking at the proof of if $NP \subseteq BPP$ then $NP = RP$ here. At the end of the proof the author states: "Note that if $M$ always gives correct answers on calls to $M$, then when $\phi$ is satisfiable, $N$ (the newly constructed TM) constructs a satisfying assignment to $\phi$ and hence accepts. The probabil...
Using the CGAL library, I am working on a 2D layout graph which contains an array of 2D polygons with holes. The aim is to generate random points (based on some conditions) and only keep the points inside the area of 2D polygons but not in their holes. The function I use for this is CGAL::bounded_side_2. Please see the...
as the title says, I am wondering why this exercise doesn't show a data forwarding from the "ex" stage of 2nd instruction to "ex" stage of 3rd instruction. P.S. the architecture is MIPS (with simplified 5 stage cycle). Thank you in advance
I am studying the approximation algorithm. I have a question as follows. For an approximation algorithm for maximization problem, if I have $sol \ge \alpha opt - c$, where $c$ is a positive constant and $0 < \alpha < 1$, can i say that this algorithm is $\alpha$-apx? Why?
I am trying to solve the following problem. I've tried to find the name of this problem, but could not really find what I was looking for. I assume there should be some graph-theory that covers it, but it's been a while since my last algorithms class. I do not need the global best solution, a "pretty good" solution sho...
I have a colored image 1024x1024 whose rows and columns were randomly shifted, how would I unscramble it without having any information about the original image?
The following is a real world problem, for which I adjusted the explanation, such that it is easier to understand. In a very abstract form, the challenge is to find a group-sorting algorithm, that is only allowed to use queues. Instance of the problem Let’s assume we have people arriving in cars at the entrance of some...