instruction
stringlengths
35
29.1k
I am thinking about how to break an array into k parts using DP with the following requirement. Array A of size n divided into k parts All elements are positive integers and order is fixed. The maximum difference between the sum of elements in 2 groups is minimized. You may think of a scenario: there is a book with...
This question is distilled from an interview question. Given two arrays $a$ and $b$ containing $n$ integers each, change each integer in array $a$ into the corresponding integer in array $b$ by increasing or decreasing a single digit by $1$. What is the optimum algorithm? The number of digits in $a[i]$ are the same as ...
Given an array $arr$, element $arr[i]$ indicates its parent. If the element has no parent then $arr[i]=-1$. What is the optimal algorithm for finding the minimum number of groups such that no element in each group is a child node (whether directly or indirectly) of any other node in the same group.
While reading graph theory, I came across different definitions where they use partitions and divisions, I was wondering, are these terms same or different? Can anyone explain me their difference in Set Theory? I know this is a simple question but anyone hardly talk about it but they always make here a mistake.
I have two sets, let's call them C and T, of unpaired points, which could for example represent two types of cells. Hence, both points are drawn from the same underlying distribution, but the points in T underwent an additional process/function. Although biologically debatable, I want to find the most similar points in...
This problem is from Sipser's Theory of Computation 3rd Edition. 1.35 Prove that $A/B = \{\omega \ | \ \omega x \in A \ \mathrm{for\ some \ } x\in B\}$ is regular where $A$ is regular and $B$ is any language. I want to verify that my proof is correct. It is as follows: Let $A$ be a regular language. Then it has a DF...
Given admissible heuristics f(s), g(s), h(s). It is true that max(f(s), g(s), h(s)) is still admissible.. but is it still admissible if its max(f(s), g(s) + h(s)). I believe it is not admissible but I just want to make sure.
If $K$ is a context-free language, then $K$ is a decidable language. $\text{Acc}_{\text{CFL}} = \{〈G, w〉: G \text{ is a context-free grammar and G can generate } w\}$ is decidable. I am a bit confused. For me, showing that $K$ is dedicable is equivalent show that $Acc_{GNC}$ is decidable. Where am I wrong?
I'm trying to solve this the recurrence : $$ T(n)=\begin{cases} 1, & \text{ if } n = 1 \\ T(n-1) +n(n-1), & \text{ if } n \geq 2 \end{cases} $$
Is it true that $ 2^{O(3k)} = 2^{O(k)} $? But It should be different from $ O(2^{k}) = 2^{O(k)} $ ? I will be happy for simple explanation. Thanks.
It seems that $ \text{NV}_{\text{TM}} = \{〈N〉: N \text{ a Turing-Machine and } L(N) ≠ ∅\}$ is not decidable. Here is a proof: Suppose that $\text{NV}_{\text{TM}}$ is decidable with the Turing-Machine $R$. We can define for each Turing-Machine $M$ and each entry $w$ a Turing-Machine $S_{M,w}$ as follow: $S_{M,w} :=$ I...
Problem: Let $X=\{x_1, ..., x_N \}$ be a set of binary variables. Each variable can be assigned to either $0$ or $1$ so there are $2^N$ possible assignments. Input: We are given a positive integer $C$ and a set of binary functions $F=\{f_1,...,f_M\}$ where each function is defined as a simple conjunction of some subset...
Here’s the decision problem: Suppose I have N positive integers encoded in base-2 (as oppose to unary) Are these integers precisely the integers 1-N in some order? This is related to the Hamiltonian path problem which is NP-complete Given a graph with N vertices you can nondeterministically walk a path of length N If y...
When it times to decide the decidability or undecidability, sometimes I see that we can simulate a Turing-Machine on another Turing-Machine. I heard it is related to Universal Turing-Machine. Can you explain what it means that we can simulates a TM on another Turing-Machine? For me, if I have a deterministic automata $...
I found a task where you need to transform context free grammar to normal form. I'm a High Shcool student at this moment. But my Brother learning this at the university. He don't have much time to explan this, this is why I'm writting this question. This is the task description: A chainless G grammar equivalent to G' g...
So I have been going over Turing machines for my revision and came across an old worksheet with the question: Derive a Turing Machine using high level description with stages to decide on the following language {<,>| }. I thought I understood Turing machines and CNF until I came across this but I can't figu...
I can't understand this theorem: If both L and L complement are turing-recognized, both are turing-decidable Proof: w is M input if w ∈ L then M1 accepts w and M accepts w if w ∉ L then M2 accepts w and M rejects w M is a TM containing M1 and M2.
How can we show that the language $K = \{<M>: M \text{ is a finite automata and L(M) contains a word of form } a^ib^j\}$ is decidable?
I'm working on a proof for following question $L=\{(R,S)\mid \text{R,S are regular expressions and } L(R)\subset L(S)\}$. Show that this language is/isn't decidable. A language is decidable iff we have a Turing machine that halts for all input strings. If $L$ is regular, we can construct a DFA and therefore a Turing ...
I am confused. I know that compilers translate your code one time as a whole into intermediary code, but how come when I type in something improper, the IDE shoots out a compilation error immediately? What am I not understanding? I thought the whole difference between an interpreter and a compiler is that the former tr...
I just thought this up while walking after typing up a knapsack with repetition implementation in Python. I want to teach computer science so I talk to myself a lot pretending to talk to students. So in my imaginary lecture for merge sort, I used the example of an unshuffled deck of cards. But then it hit me that, "Wit...
I want to construct a PDA for $Σ^* -\{(a^nb) ^n, n>0\}$ where $Σ=\{a, b\}$. Here is my try: I know that context-free languages are closed under union operation. Also I know how to make a PDA for union. So I tried to decompose the given language to some parts. For example, the language of the strings starting by $b$, th...
I need to find a sorting algorithm to sort an array where the the $k$-th element appears $2^{k-1}$ times in $O(2^k)$. It also given there are $k$ distinct elements in the array, hence there are $1 + 2 + 2^2 + \dots + 2^{k-1}=2^k-1$ elements in the array. So I actually need to sort the array in $O(n)$ where $n$ is the a...
I will set this question in a very practical way. Let's say we have a web-form data received as JSON at the backend together with the schema (for instance, some version of JSON schema), something like: {"data": {...}, "schema": {...}}. An important thing is, that backend can validate the data according to the type defi...
Consider the following language: $$L=\{a^nb^n | n \ge 1\}$$ I constructed the following Turing Machine: \begin{eqnarray} T &=& (Q, \Sigma, \Gamma, \delta, q_0, B, F) \nonumber \\ Q &=& \{q_0, q_1, q_2, q_3, q_4\} \nonumber \\ \Sigma &=& \{a, b\} \nonumber \\ \Gamma &=& \{a, b, X, Y, B\} \nonumber \\ F &=& \{q_4\} \nonu...
This question states that the problem of Hyper-graph Isomorphism is equivalent to Graph isomorphism. I have not been able to find a description of the reduction so I am wondering how that might work and what is its complexity. If I understand the post in the link correctly, the reduction has to be polynomial in order f...
I have just proved that for every $\alpha, \beta>0 : (\log n)^\alpha=O(n^\beta)$. Now, given an array of $n$ elements, I want to find an efficient comparison based algorithm for finding the $\log n$ largest elements in the array, and returning them in sorted order. I will appreciate your help on what is the best way to...
In Formal Grammars course we have a task to implement an extended NPDA (a pushdown automata where taking any amount of symbols from the stack is allowed (including ε) and it can be in several configurations at the same time) in any programming language. It can be one that accepts with a state or an empty stack. I have ...
I would like to understand what role does Transactional memory plays in memory organization, I know that To allow for more efficient parallel programming with higher performance, processor implements a hardware transactional memory facility. But I would like to know what the processor do for memory management when ther...
Many problems that take a boolean circuit as input are NP hard to compute. Do we have examples of such problems that become polynomial time computable when only boolean formulas are allowed as input? In boolean circuit complexity, a circuit is just defined by a Directed Acyclic Graphs with designated input and output ...
I am having difficulty understanding the difference between PAC and Oracle Machines. I cannot compare these two in terms of uncertainty and physical effort. The degree of uncertainty we can tolerate in a system has been discussed ever since Turing. His oracle machines answer questions with maximal uncertainty, and zer...
Let $\Sigma_1 , \Sigma_2$ be alphabets. Let $L\subseteq \Sigma_1^*$ be a regular language, and let $ h:\Sigma_1^* \rightarrow \Sigma_2^* $ be a homomorphism. Proof $h(L)$ is regular. I have written a proof using induction over the number of operands in the regular expression $r$ such that $L = L(r)$, that there exists ...
Prove or disprove or this statement: The union of an infinite number of regular languages is regular. Can someone help?
On one of my previous courseworks, I was faced with the following problem, which I think is unrealistic when using a direct / straightforward approach that usually algorithms have by leveraging certain data structures like dictionaries, etc. Design an O(log n) algorithm whose input is a sorted list A. The algorithm sh...
What is the time complexity and space complexity of working out, in suitably generalised versions of the battle systems of both Paper Mario 64 and Paper Mario: The Thousand Year Door: The minimum number of turns that Mario can win in The minimum number of turns that Mario can guarantee a win in Of course, we could al...
How can we prove that in binary search $$\mathit{low} - \mathit{high} ≤ 1$$ Below is a sample algorithm for Binary Search. while (low<=high) { int mid = low + (high-low)/2; if (data[mid]<value) low = mid+1; else if (data[mid]>value) high = mid-1; else return &data[mid]; } return nullptr; A good stranger...
I'm a bit confused about the scale of heuristics for implementing A* search. $f(n)$ is the total cost of travelling to a node $n$. It is calculated by $f(n) = g(n) + h(n)$. $g(n)$ is the cost of the path to node $n$ from the source node. $h(n)$ is a heuristic function that estimates the cost of the cheapest path from n...
Prove that the following language is not a regular language: $L = \{ 0^x1^y | x, y \geq 1\text{ and } x \geq y\vee (x < y \wedge y \mod x = 0)\}$ Is there anyone to prove this ?
Let $a,b>0$. Prove $\left(\log\left(n\right)\right)^{a}=O\left(n^{b}\right)$. I'm supposed to find an algorithm to find the log(n) largest elements in an array and return them sorted and explain why it's bounded by $O(n^{b})$, but the thing is I'm having trouble proving the above and I'm kind of stuck.. Any tips?
Given a directed graph $G = (V, E)$ and a vertex $v \in V$, how to find all vertices $v'$ such that exists a simple cycle $v \to ... \to v' \to ... \to v$? That is, to find the set of vertices $$V' = \{v' : \exists c, \text{c is a simple cycle in G}, v \in c, v' \in c \}$$ I found this question related: Find all cycles...
I am studying Kruskal's algorithm. Is the only acceptable sorting criteria to sort edges from lowest weighted edge to greatest weighted edge? I ask this because I assume that if the algorithm used an alternative sorting criteria say, greatest to lowest, then it would not produce a MST. My reasoning is that edges with l...
For any computable-function, there may be multiple different algorithms (possibly countably infinite). For example, sort has many different implementations/algorithms, that we know of or that we have found so far. They all produce the same output for the same input. Given any specific computable-function or even a spec...
I was asked to find write a pseudocode of an algorithm that extracts the Log(N) largest elements in an array and return them in a sorted list, my attempt is largestLogn(Arr) n = Arr.length j = 0 ans = new array of size Log(n) Arr = Quicksort(Arr,1,a) for i=(a-log(n)) ➜ a ans[j] = Arr[i] j++ return ans From my limi...
Okay so we've been given an algorithm and asked to give an upper bound to its best and worst case weirdSort(A,r,p) if r < p q = (r+p)/2 BubbleSort(A,r,q) wierdSort(A,q+1,p) Merge(A,r,q,p) I'm not quiet sure how to do that.. this is my first time analysing time complexity and I'm quiet lost I know that an upper bound...
The problem: I have a list $\displaystyle S=\{s_{1} ,s_{2} ,\dotsc ,s_{n}\}$ places. Each unordered pair of places has cost and gain: $\displaystyle c\{s_{i} ,s_{j}\} \in \mathbb{N}$, $\displaystyle g\{s_{i} ,s_{j}\} \in \mathbb{N}$. Also the pairs are only for $\displaystyle i\neq j$. I have two numbers: $ $$\displays...
Given any regular language L, we define $$shrink(L) = \{ \sigma_{1}\sigma_{2}\sigma_{3}...\sigma_{n} : \sigma_{1}\sigma_{1}\sigma_{2}\sigma_{2}\sigma_{3}\sigma_{3}...\sigma_{n}\sigma_{n} \in L \} $$ The question is whether these languages are regular or not. The intuition says they are, and I was thinking about proving...
I was doing an assignment of Theory of automata but while doing this question I am stuck there is no such state that can be eliminated even from transition table. I am very confused and stuck please help me out
I'm studying the issue of FPT algorithms and came to the k-disjoint triangles problem as can be seen here on slide 60. The problem summary is given a graph G and variable k, are there k disjoint triangles in the graph. There are two methods, I want to focus on one of them. (Method 1) First I randomly color the graph in...
I am working on Problem 6-1 from MIT's Fall 2011 6.006 course. The problem reads as: Problem 6-1. [30 points] I Can Haz Moar Frendz? Alyssa P. Hacker is interning at RenBook (人书 / 人書 in Chinese), a burgeoning social network website. She needs to implement a new friend suggestion feature. For two friends u and v (fri...
The question is: Given a language $L$ (not necessarily regular), prove or disprove that $Eq(L) = Eq(\overline{L})$. Where $Eq(L)$ is the amount of equivalence classes the language L has, and $\overline{L}$ is the complement of $L$. My intuition says the statement is true, but I don't know how to prove it.
I managed to figure out how to double a unary format number however I have had no such success in tripling it. An input tape would be of the following format Λ111Λ and the output would be like Λ111Λ111111111Λ with the tripled number coming directly after the initial input tape. Any help would be greatly appreciated.
Is (A' + B') the same as (A + B)' ? Note: The apostrophe ( ' ) represents the complement
When I think about "compressing" outside computers I can think about a compressed car which has become a metal rectangle. It doesn't have less redundancy because it has everything it had before, just compressed and destroyed (data loss) It's not delivered more efficiently because it's destroyed and isn't restorable by...
Question: What is the difference between designing an algorithm that solves a problem and creating a Turing machine that decides a language? A turing machine "decides" the language if it "accepts" the language and enters a rejecting state for any input not in the language. Don't really know what the difference is
Change propagation in programming environments is an add-on at the framework level such as React. There was a lot of work on dataflow virtual machines in the wake of Backus's Turing Award Lecture on formal functional programming. This is because dataflow programming is one way of thinking about change propagation in f...
I have 10 data sets (lat and long) of the same path. I started from point A and stopped in point B and did this 10 times for a single route to get the data. While collecting the data, there were some fixed obstacles and some random obstacles. So, I avoided them. Doing this 10 times created a fixed curve in every datase...
What is the asymptotic rate of growth of the following recurrence? $$ T(n) = n + T(n - \sqrt{n}). $$ Since I cannot use the Master's Theorem here, I could not figure it out the answer. My initial guess is $n^{3/2}$, but I'm not sure. Can anyone help me? What are the big-O and big-Omega complexities here?
On an old worksheet I came across the question If L1 and L2 are two Turing decidable languages, then show that 1∪2 and 12 are Turing decidable languages (high-level description with stages is enough). How do I go about answering this without being given a language to work from?
I'm learning about the disparity calculations and want to calculate the distance for a known pixel. I have calibrated and rectified images already. Now I just want to calculate Z for some pixel x,y. the opencv tutorial says: "The depth of a point in a scene is inversely proportional to the difference in distance of co...
The SUBSET SUM decision problem consists of poitive integers a1,...,an; b. We wish to know if for some subset S of the indices, $\sum_{i \in S}a_i = b$ I want to prove that if b is given in unary(and the ai's are gives in binary), that this decision problem is in P
In a typical data structures class, we look at a variety of problems: finding an element in a list, sorting a list, balancing a binary search tree, finding the shortest paths in a graph, etc. Would these problems be decidable or undecidable? Wouldn't the answer to this question be both, because decidable means a clear ...
I'm specifically referring to this group of questions here: https://www.cs.rice.edu/~nakhleh/COMP481/final_review_sp06_sol.pdf So as I've learnt it, say we want to prove a new Language L is undecidable using a known undecidable language D, we use Oracle calls to L to solve an instance of D right? In none of these quest...
Assume that $L_1 \subseteq \Sigma^*$ is a CFL and that $y \in \Sigma^∗$ is a string. I need to prove that the language $L_2 = \{x \in L_1 \mid x \text{ does not contain $y$ as substring}\}$ is a CFL. I tried pumping lemma for CFLs, but it seems that is for disproving that languages are CFLs. I also tried to create a CF...
As far as I understand defragmentation: Removes spaces between objects by putting objects nearer one to the other reorganizes objects for better performance The first action feels to me as some kind of minification and the second action feels to me as some kind of compression.
Let $X_1, \cdots, X_n$ be $n$ independent geometric random variables with success probability parameter $p = 1/2$, where $X_i = j$ means it took $j$ trials to get the first success. Let $S_d = \sum_{i=1}^n X_i^d$ and $\mu_d = \mathbb{E}\left( S_d \right)$. Given $\delta > 0$, I am interested in finding an inequality of...
I'm having difficulty understanting how can i prove that L = { w | w0 is the representation of a turing machine M with input {0, 1} and M don't accept w } is not turing-recognizable The solution I have is by contradictio. Reduce w0 to w Suppose a TM M', L(M') = L Suppose that w' ∈ L w' is the representation of a turin...
I genuinely don't know if the following problem is NP-hard. I have never seen it mentioned online, but it's hard to even search for exact problems like this. I have been trying to find an efficient algorithm for a while and intuitively it feels very NP-complete to me, but I haven't been able to prove it. A solution wou...
Two numbers $x,y$ are 'connected' if $gcd(x,y)>g$. Here $gcd$ is the greatest common divisor. A path exists between two numbers $x,y$ if given $g$ and $n$ there is a sequence of numbers that connect $x$ to $y$ such that all numbers along the path are less than or equal to $n$. How do you find if there exists a path bet...
Parser-generators like nearleyjs can return a parse forest instead of a parse tree. Since not all input may result in a parse forest (eg, the input may exercise only a non-ambiguous subset of the grammar), how do you programmatically choose the 'correct' parse tree from the forest? One option is to always choose the fi...
So I'm trying to figure out why the worst case of Quicksort is $O(n^2)$. I know this a very well known problem, but the funny thing is where ever I look (even Wikipedia) gives the following explanation: "The worst case is the most unbalanced case where the problem splits to a problem of size $n-1$ and a problem of size...
I would appreciate some advise/mentoring on self-study of algorithms. Based on my several years of work as a software developer (non CS background), I have some good grip on standard data structures (linked lists, stacks etc.) and basic sorting and searching algorithm characteristics (time/space complexity). My goal of...
Suppose n students have preferences over n different notebooks. Their preferences can be represented with a square matrix of size n where each column is a different permutation of the vector [1:n], where the first entry in the column represents the most desirable notebook for student 1, and so on. We are interested in ...
I have this recursive formula $$T\left(n\right)=T\left(\frac{n}{2}\right)+O\left(n\right)+O\left(n\right)+2O\left(1\right) \ \ \ ➜ \ \ \ T\left(n\right)=T\left(\frac{n}{2}\right)+O\left(n\right)$$ $$T\left(n\right) =T\left(1\right)\ +\ c_{2}n\cdot\sum_{k=1}^{⌊\log n⌋}\frac{1}{2^{k}}=T\left(1\right)+c_{2}(n-1)$$ I've be...
I have a rather foolish question on an example explaining the idea behind Referential transparency Here is given an example i not understand: Consider a function that returns the input from some source. In pseudocode, a call to this function might be GetInput(Source) where Source might identify a particular disk file,...
I'm looking to model data inputs for an artificially intelligent system, which is affected by its internal parts and has feedback loops. I'd like to model it mathematically, using category theory or homotopy type theory. Is Agda or Idris the best choice for such modelling?
In Motwani and Raghavan's textbook, p38-39, they states: A sequence $C_1, C_2, C_3, \dots$ of circuits is a circuit family for function $f_n\colon {0,1}^n \rightarrow \{0,1\}$ if $C_n$ has $n$ inputs and computes $f_n(x_1, x_2, \dots, x_n)$ at its output for all n-bit inputs $(x_1, x_2, \dots, x_n)$. The family $C$ is...
Learning a policy from sparse reward information (a reward function where a positive reward is only generated at the goal state) is challenging due to the resulting sparse feedback. One solution is to shape the reward to enrich feedback during learning. Unfortunately, shaping the reward is challenging and often leads t...
The 0-1-INT-PROG problem is given an integer $m \times n$ matrix $A$ and an integer $m$-vector $b$, is there an integer $n$-vector $x$ with $A \cdot x \leq b$. I am trying to prove that 0-1-INT-PROG is NP-Hard by reducing SUBSET-SUM to it. My attempt: Given an instance of SUBSET-SUM $<\{a_1, a_2, \cdots, a_n\}, k>$ we ...
Consider a program P that enumerates possible proofs in some proof system and halts only if it finds a valid proof that P does not halt. Clearly no such proof exists, or the program would eventually find it, causing a contradiction. But that argument itself appears to constitute exactly such a proof. It seems like that...
For an array, I'm using a left pointer (pointing to 0) and a right pointer (pointing to end). For every iteration, if my search element is not found, I increment left and decrement right. This iteration continues until left <= right. Find the code snippet below left = 0 right = length - 1 while left <= right: // s...
Is a hash table a good data structure for storing data in an application that support partial search such as "select * from MyTable where name like 'John%'. If not, what is? I would have thought that hash table isnt ideal because there no way to make faster than O(n). Maybe a some kind of balanced binary tree best. Ho...
I've been working on an asymptotic proof and I want to start with saying that since $\log z=O(z)$ then $\log z\le\frac1 9z$ for $z\ge z_0$. In this example I'm picking $c=\frac1 9$ and hoping $z_0$ exists, but is $z_0$ guaranteed to exist if I pick $c$?
Consider a graph graph G with |V| vertices and more than |V|-1 edges, is it possible for an edge to be the 'heaviest' and also be unique, but still be part of the graph's MST? If so, in which cases is it applicable? From what I've been thinking so far, if the maximum edge is the only part that connects some vertex wit...
I am wondering if $\omega$-automata with the following acceptance condition are valid. An input string is accepted iff one of the final states occurs at least once. This differs from Buchi automata in that the final state only has to occur once, not infinitely often. Does this kind of automata have a name? Is it intere...
Consider the following problem: Given a weighted directed graph $G$, determine if $G$ has a cycle whose total weight is $k$. All edge weights are integer but might be negative. $k$ is not an inputted value. It's fixed and known beforehand to everyone. So $k$ is NOT an input to this algorithm. I want to show the problem...
I learned that Bottom up parsers use only synthesized attributes to evaluate semantics. Which makes sense considering that it would be very hard to evaluate an inherited attribute in bottom up parsing. So, can bottom up parser evaluate pretty much anything top down parsers do without using inherited attributes? Is tha...
The equation below is intuitively correct, but how do you show that this is actually the case? What is the working out needed? $$\sum_{i=1}^{n-1}O(\lg n)=O(n\lg n)$$
Consider an MDP where the transition model and the reward function are unknown. Consider an optimal policy $\pi^*$ generated from this MDP (say by some oracle who does know the transition model and reward function). How can one infer the reward function and transition model from an optimal policy? For such a question, ...
Let's say that we have computed a suffix tree in O(n) time, and wish to use this to create a suffix array. According to wikipedia: A suffix tree can be built in $O(n)$ and can be converted into a suffix array by traversing the tree depth-first also in $O(n)$, so there exist algorithms that can build a suffix array in ...
I am writing a hashing algorithm to be used in the key-value data store. That is for each key the location of the data is determined. The structure of the data store is given a key, a value needs to be retrieved OR given a key and value we determine a location to store the value. We want the keys to be designed/modifie...
Consider a variant of STCON, called 2STCON, which is defined like this: $$2STCON = \{\langle G,u,v \rangle \} \mid \text{$G$ is a graph with } \mathit{two} \text{ paths from $u$ to $v$} \} $$ This means the only difference to the "normal" STCON is that there are two paths instead of just one between $u$ and $v$. I need...
The k-disjoint triangles problem is as follows: Input: A graph $G=(V,E)$ and an integer $k\in \mathbb{N}$ Output: Are there $k$ vertex-disjoint triangles in $G$? An FPT algorithm is presented here (starting from slide 60). The algorithm uses color-coding and relies on dynamic programming to determine if a solution is...
I have an array of n elements. Smallest element that exists in the array is x and the largest element is x+n. None of the numbers between x to x + n is missing from the array. i need an algorithm to get the sum of all numbers in the array provided that x is already known. The time complexity of this algorithm should be...
I was wondering besides the typical matching of all bits in the presented address to the resulting page, is there another way of doing so? what are the benefits/ cons and how would one go about doing so?
While doing image filter, I was perplexed on a particular topic regarding it. I was wondering how to take the weighted average of the immediate neighboring elements of a 2D array. I am doing this by taking two matrices and multiplying the immediate neighbors of a first matrix with the elements of the second matrix, My ...
Stephen Cook presented his seminal paper "The complexity of theorem-proving procedures" at the 1971 STOC (Symposium on Theory of Computing) conference which was held May 3-5, 1971 at Case Western. How rapidly was this recognized as being revolutionary? The book "Computers and Intractability: A Guide to the Theory of NP...
I'm looking into computing the prime implicants of a Boolean function. I have found many different algorithms in the literature, many of them relying on SAT solvers. However, I have not been able to find a SAT solver that already provides this feature. Are there any? Similarly, are there any SAT solvers/SMT solvers/rel...
I am studying computational complexity using Papadimitrious's book: "Computational Complexity". I am trying to solve the final statement of Problem 8.4.9, but I am stuck and would like some hint on how to proceed. Problem 8.4.9: "Let $f(n)$ be a function from integers to integers. An $f(n)$-prover is an algorithm whic...
Does there exist a CFL L such that the language defined as $L' = \sqrt{L} = \{w | ww \in L\}$ is not CFL? I feel that there is no such $L$ but obviously, I am unable to prove it. I am sorry but I have not made any mentionable progress with my attempts on this problem. I would appreciate any hint to the proof or a langu...
As input, given two finite sets of integers $X = \{x_1,...,x_m\}$, $Y = \{y_1,...,y_n\} \subseteq Z$, and a non-negative integer $v ≥ 0$. The goal is to decide if there are non-empty subsets $S ⊆ [m]$ and $T ⊆ [n]$ such that $$ \left|\sum_{i\in S}x_i-\sum_{j\in T} y_j\right| \leq v$$ How to show this problem is NP-hard...