instruction
stringlengths
35
29.1k
In Computational Complexity by Papadimitriou, there is an exercise about Blum's axioms where it asks to prove that several measures for the complexity of a Turing machine satisfy them. 7.4.12 Blum complexity. Time and space are only two examples of "complexity measures" for computations. In general, suppose that we ha...
Prove that each property below characterizes forests... a. every induced subgraph has a vertex of degree at most one. When proving a characterization, do we have to prove both directions, like an if and only if, or does it suffice to prove only one direction?
A probability distribution $P$ over $X \times \{0, 1\}$. $P$ can be defined in term of its marginal distribution over $X$ , which we will denote by $P_X$ and the conditional labeling distribution, which is defined by the regression function $$ \mu(x) = P_{ (x,y) \sim P} [y = 1 \mid x] $$ Consider a 2-dimensional Euclid...
I never learned a lot of mathematics (generally only arithmetic) and never learned computer science in a formal frame. I emphasize that I don't mean to ask about a "function" in programming ("procedure"/"method"), rather only about the difference between the formal definition of function in mathematics to the formal de...
I'm looking to make a comparison of regularity in languages - specifically orthogonality. If I were to say Java is weak in terms of orthogonality and Haskell stronger, where would C++ sit and why?
Given a simple connected undirected graph. with V vertices and E edges. Let e be some edge from E. If I perform |V| different BFS runs - meaning started each time from a different vertex - and in every run e is part of the Spanning tree produced from the run. Can it be belonging to some cycle? The multiple answers I ha...
DAG specifies the relationship of one node must appear after another. What if I add an additional constraint where one node cannot appear before another on top of the DAG? Is there an algorithm for generating topological sequence from DAG with such constraint? Or maybe I can transform the DAG with this constraint?
There are some theorems that go along the lines of "all reasonable properties of <math subject> are computationally undecidable." Here are two examples: Rice's Theorem: "all reasonable semantic properties of programs are undecidable." Adian–Rabin Theorem: "all reasonable properties of finitely presented groups are und...
Q: Standard input consists of exactly four integers, first x1 and y1, the coordinates of the bottom-left corner of a rectangle, then x2 and y2, the coordinates of the top-right corner. Write a Python script named area-of-rectangle.py which outputs the rectangle’s area. I'm SO stuck and have no clue what I'm doing. I wr...
I remember about 10+ years ago there was a mathematical symbol used to represent population sustainability. It resembled a downward or upward angled arrow but in dot form...if remember it was represented in a 4x4 grid but maybe have been larger. It is the result of population seed eventuality, with no additional varia...
The Wikipedia article on LCS has an algorithm that backtracks all the LCS strings. This link redirects to the desired bulletin in the article. The C table in the backtrackAll function is pre-calculated, if you go up a tad bit. C[i][j] stores the LCSLength for given str1[1...i], str2[1...j]. (screenshot, for a quicker ...
Calculate the complexity of the algorithm as follows O (n ^ 2) Would it be correct? int Smming(int n) { int i, j, sum = 0; for (i=n; i>0; i=i-1 { for (j=1; j<n; j*=2){ sum+=i+2*j; } } return sum; } And in the code below I calculated it to be O (n^2), wo...
For example, in real life, you're working with real time data that is constantly appended to. Computer science assumes a static problem, like traveling salesman. In reality you would start with a set of cities and add and remove them over time, so the solution at the individual step is trivial, and it's easier to store...
I was reading about the Long term scheduler, when I read that when memory is not enough and load on the CPU due to multiprogramming is too high, a process might be moved to secondary storage space (namely swap space). I am slightly confused as too what exactly happens when a process is moved out of memory. Is its "PCB(...
Sell (Bar, Beer) I want a table in which the first column has the name of the beer and the second has the total number of bars which sell that beer, but I have no idea how to use count () in the right way to obtain this. Could it be Beer G count(Bar) as count_bar (Sell) ? And later that, how could I set a table with th...
This is a somewhat soft question. Given two reproducing kernel Hilbert spaces (RKHSs) $H_1$ and $H_2$, if their RKHS norms only differ by a constant, i.e., $C_1\|f\|_{H_1}\le \|f\|_{H_2} \le C_2\|f\|_{H_1}$, where $C_1,C_2>0$. What can we say about the sample complexity or other learning theory properties? Thank you!
For a table to satisfy the Fourth Normal Form, it should satisfy the following two conditions: It should be in the Boyce-Codd Normal Form. And, the table should not have any Multi-valued Dependency. The table should have at least 3 attributes and B and C should be independent for $A \twoheadrightarrow B$ multivalued de...
In CLRS (Intro to algorithms) on page 362, it says equation (1): $$ r_n = \max(p_n, r_1+r_{n-1},r_2+r_{n-2},\dots,r_{n-1}+r_1) $$ can be simplified to this equation (2): $$ r_n = \max_{1 \leq i \leq n} (p_i + r_{n-i}) $$ I would like to know how this simplification was arrived at. It shouldn't necessarily be a formal p...
Here is a question from Computational Complexity by Arora and Barak: Show that representing OR of $n$ variables $x_1,x_2,\dots,x_n$ exactly over a polynomial in $GF(q)$ requires degree exactly $n$. (This is Exercise 6 in the chapter on circuit lower bounds.) How do I approach this problem?
So, for the sake of simplicity, I am going to use English characters for this example. Let's say I have a set of strings of characters in English ranked by difficulty: Easy, Intermediate, Advanced. So it would look like: Easy 1. APQ 2. DL 3. RTE Intermediate 1. FSMG 2. NDA 3. LOXCW Advanced 1. GEW 2. ZAY 3. IVK My q...
If a computer science graduate is presented with a device that has a spyware which anti spywares cannot yet detect, can he find it? Or presented with website that is possibly malicious, can he prove whether it is safe or not? If not then people of what computer field can do the the tasks mentioned above? I am asking ...
In his paper, "Finding a Maximum Clique" from 1972 Robert Tarjan introduced an algorithm that finds maximum cliques in $O(1.286^n)$. You can find a link to his paper here. In the second page of the introduction he states the following lemma. Let $G = (V,E)$ be a graph and $S \subseteq V.$ Then $$ ||G|| = \max_{\text{cl...
I wish to sort $n^2$ numbers which all come from the set $\{1,2,3,...,n\}$, i.e duplications are allowed. I know I can just use merge sort which has complexity $\mathcal{O}(n^2\log (n))$, but I was wondering if it was possible to do better since I know all the numbers will be coming out of $\{1,2,3,...,n\}$. If there i...
Prove or disprove the following statement: If $f(n)\in \Omega(n^2)$ and $T(n) = 2T(n/2) + f(n)$ then $T(n) \in O(f(n))$. I think that the statement is false. Do you know any counterexamples?
Regular language of (a+b)* and (ab)* are: (a+b)* = { ε, a, b, aa , ab , bb , ba, aaa, ...} (ab)* = { ε, a, b, aa, ab, ba, bb, aaa, ... } I am new to Finite automata and this simple notion is confusing me! I didn't find (a+b)* = (ab)* in rules of regular expressions.
I am trying to solve this recurrence relation - $T(n)=n^{1/5}T(n^{4/5})+5n/4$. I can't use the master's method and the recursion tree method because of that $n^{1/5}$ term. We can write $$\frac{T(n)}n=\frac{T(n^{4/5})}{n^{4/5}}+\frac54$$ Now we can change variable $S(n)=\frac{T(n)}{n}$. So, we get $$S(n)=S(n^{4/5})+\fr...
The node of a binary tree is called a single child if it has a parent but does not have a sibling. The root is by definition not considered a single child. Let $T$ be a binary tree of size $n$, and let $k$ be the number of vertices in $T$ that are single children. Is it true that if $\frac{k}{n}\leq \frac{1}{2}$ then ...
i need to say : Where can be a maximum element in a min heap when all the elements are different?
Is there an efficient algorithm that takes in a list (multiset) of integer rectangle areas and finds all possible integer rectangle tilings? Every integer rectangle area in the list (multiset) must be used exactly once (corresponds to exactly one rectangle). For example, if we were given $$(2, 1, 2, 1, 1, 4, 1, 1, 6,...
I'm trying to find an algorithm that solves the maximum vertex biclique problem. I know that that algorithm can be solved in polynomial time (in contrast with the maximum edge biclique problem, which is NP-hard), and it's related somehow to transform the problem to a network flow problem, but I'm having a hard time fin...
I have been writing code for a paper and I'm reading an image in RGB space in OpenCV which means that its read as a 3D matrix (HEIGHT x WIDTH x 3 (RGB) ). I'm reshaping the image into a 2D matrix ( NB_PIXELS x 3 (RGB) ) using this code : image = image.reshape(len(image) * len(image[0]), len(image[0][0])) This reshapi...
I want to find subgraphs in a graph that are only connected to the rest of the graph by two nodes; for example, node A is connected to the rest of the graph, as well as node F, but nodes B-E are only connected to each other and A and F (don't have to be fully connected). Is there a name for this? And is there an algori...
[Problem Description]: Given an array of size $N \times N$, the task is to find the rectangle with maximum perimeter weight in the array. The perimeter is defined as the number of cells on the sides. The perimeter weight of a rectangle is defined as the sum of all the values lying on the sides of the rectangle. For ex...
I was thinking in the following approach for solving a problem that is believe to be a NP-hard problems today in polynomial time, assuming the following: There exists a believed-today NP-hard problem called $X$, where its whole input space can be divided into a finite set of groups such that there exists a correspondi...
I'm solving a differential equation on the form $\ddot x = f( \dot x, x)$ on a microchip within a limited (real world) time frame, hence I want to use an adaptive step size to get as good of a result as possible. However, I only have a limited number of iterations, $N$, to solve the system. If I use the "regular" adapt...
While converting CFG to CNF sometimes it is suggested to add extra step. Add new start symbol S0 and add new derivation S0 -> S. Book Hopcroft Ullman does not suggest this step but many other articles suggest to add this step. What is purpose of adding this extra derivation?
The max-flow algorithm finds the maximum flow through a graph given edge capacities. However, if there is an option between flowing through two edges, it will typically just leverage one of those edges fully and ignore the other. One can influence which of the edges should be preferred by using "min_cost_max_flow" and ...
I am wondering how you could possibly define the implementation of an imperative function as a type. Is it possible? Currently I only see the input parameters and output result used in the definition of a function type, but how could you also include the implementation in the type definition?
I am writing a compiler in CPP using Flex and Bison and having trouble understanding passing values up the syntax tree in bison. I have grammar like this below, 'exp' would evaluate to any number. args_list: exp | args_list comma exp; array_list: datatype identifier '[' number']' equal '{' args_list'}'{$$ = new array...
I'm having difficulty proving undecidability of "is this CFG prefix-free?". (this proof is given as problem 5.32b in Sipser 3rd edition). Another thread has the very different question "is this regular language prefix-free". One of the answers in that thread claims to prove undecidability for CFLs (even though that did...
I am studying regular express. I understand how to proof a xa ya. However, I don't know how to proof the below problem. Please help me. L = { xa yb | a ≠ b }
Suppose that P != NP. Then there exists 3SAT formulas such that their satisfiability is computationally "evil" (i.e, the satisfiability can be exponentially hard to determine in the size of the formula). Primality testing can be reduced to the satisfiability of a multiplication circuit, which can be reduced to the sati...
I am working on the base of a language model, and am wondering how to represent the base type, which is a type Type. I have heard of an "infinite chain of types", but (a) I can't seem to find it on the internet while searching anymore, and (b) I am not sure if that's what I need or what it really means in practice. Bas...
I presumed they were equal, such that both resulted in aabb. However, I'm told they are false and I don't know why. Is it because in the second one, we would concatenate a · b before raising to the power of 2, thus resulting in abababab? Or because in the first one you concatenate first, thus resulting in abab? Thanks ...
This is a question in my textbook, it requires me to write an algorithm to find the median of a bitonic sequence in $O(\log n)$, where $n$ is the number of elements (a bitonic sequence is a sequence that is non-increasing first, and then it's non-decreasing after some point). How do I approach this? I feel like it has ...
Total Memory size = 65,536 bytes Number of cache blocks = 32 cache blocks Cache size = total 512 bytes So using this info provided I cannot figure out how to calculate the cache block number. I know if number of cache blocks =2^M then the last M bits is the cache index. But how to calculate the block number? and then f...
void partition(int a[], int L, int R) { int i = L; int pivot = a[R]; for (int j = L; j < R; j++) { if (a[j] <= pivot) { swap(a[i], a[j]); i++; } } swap(a[i], a[R]); } My code is above. My loop invariant is "At the beginning of the iteration, j is in the range of a[L] to a[R-1]". Is this correct...
The Partition Problem supposes that we have a set $S=\{s_{i} \in \mathbb{R^{+}}\}_{i=1}^{n}$, is there a subset $T$ such that $\sum_{s \in T} s = \sum_{s \notin T}s$? I have read a lot of proofs using the Subset Sum problem: Given an integer set $S$ and an integer t, does there exist a subset $U$ of $S$ such that $\sum...
Given a context-free grammar in Chomsky normal form, is it decidable whether that grammar has any useless rules? By "useless", I mean a rule that can be omitted from the grammar without changing the language. Note this is not the same as asking whether the grammar has the minimum possible number of rules to generate th...
I wanted to calculate the complexity of this pseudocode. In my knowledge, it is $n^2$ because the last loop only runs 8 times. I wrote a program to test it tends to run 8^logn (approximately). can you help me to find the correct answer_ 1: procedure f(n) 2: for i := 1 to n do 3: for j := 1 to n do 4: ...
Motivation So the other day I had fun providing a new solution to this famous question. In the analysis part I showed that my little algorithm has space complexity: O(k) and Ω(log(k)). However, my rough logic says that we should be able to prove a tighter bound of O(min(k,log(n))), but I was unable to prove it. Moreove...
I need to prove the statement $\exists$ a minimum cut $(S', T')$ where $S' \subseteq S$ for any minimum cut $(S, T)$ My attempt: Before proving this statement, I have a lemma if $(S_1, T_1)$ and $(S_2, T_2)$ are both minimum cuts, then $(S_1 \cap S_2, T_1 \cup T_2)$ and $(S_1 \cup S_2, T_1 \cap T_2)$ are minimum cuts ...
LR parser for a (CFG) grammar uses a handle-find automaton (which is a DFA) to find the handles. Such automata can be constructed by computing the canonical collection of sets of LR(0)/LR(1) items. Is there a way to obtain the RE of the handle-find automaton, directly from the given grammar? Example: Below are the gra...
I am searching a fast pseudo-random permutation function with the following requirements. Given a predefined set of values $V$ and an integer $k$. Split $V$ to $k$ subset, and iterate over any subset in order. In more detail, we need an $n$-length ordered value set $V$ splitted to $k$ (contiguous) partitions. Partition...
I was reading formal proof of Rice theorem in wikipedia: https://en.wikipedia.org/wiki/Rice%27s_theorem#Formal_proof I want to know is what we used here is the reduction algorithm : we reduce the Halt problem language to the semantic problem language? Thank you so much
Let $G = (V,E)$ be a directed graph where every vertex is represented by an $n$ bit string. The edges are represented by two polynomial-sized circuits $S$ and $P$. There is an edge from $u$ to $v$ if and only if $S(u) = v$ and $P(v) = u$. I am trying to prove: $G$ just contains paths, cycles, or isolated vertices. Let...
Prove that if $g ( n ) ∈ ω ( 1 )$ and $f ( n ) ∈ o ( g ( n ) )$, then $2 f ( n ) ∈ o ( 2 g ( n ) )$. I was going over this question in my Algorithms class and could'nt understand why first condition has to be met. How would $g ( n ) ∈ ω ( 1 )$ affect our reasoning? Also, what would happen if instead of $g ( n ) ∈ ω (...
Given a neural network(assuming no regularisation/dropout), I want to determine the computational cost of doing a forward and a backward pass of a datapoint. I want the measure to be of independent of the programming language/operating system involved. I can think of it as a graph model, with some activations applied o...
First off - I'm not a Computer Scientist, I'm a Software Developer - so when it comes to presenting an idea in a formal manner to a Computer Scientist, I have no idea how to do so. As such, I'm wondering if someone would be good enough to show me how to write the algorithm/idea I've outlined below in some form of forma...
I want the regula falsi to get x +- .0001 so that f(x) = 0. But all the implemetations I see get x so that f(x) +- .0001 = 0 which doesn't make much sense. (f(x) = x^3). How do I stop the regula falsi method when the error is .0001 on the x-axis? I have this scilab code: function salida = falsaposicion(fun, tolerancia...
Show that $L=\{a^x b^y c^z : x=2y \lor y>z\}$ is not regular using the pumping lemma. I know that in order to use the pumping lemma, I have to assume that $L$ is regular. Then I know that there is a $p$ such that every $w \in L$ such that $|w| \ge p$ can be represented as $xyz$ with $|y| \ne 0$ and $|xy| \le p$, so t...
This question is from Section 15.5 of Introduction to Algorithms (third edition). We are given sequence of keys, $ k = \{ k_{1},k_{2},\dots,k_{n} \}$, where $k_{1}<k_{2} <\dots<k_{n} $. For each key $k_{i}$, where $1\leq i \leq n$, we have a probability $p_{i}$ that a search will be for $k_{i}$. We let the sequence $d ...
Given $A,b$, let $Ax \le b$ be an instance of linear programming on the variables $x=(x_1,\dots,x_n)$. Assume that the constraints $0 \le x_i$ and $x_i \le 1$ are included in $A,b$. Suppose that there is a feasible solution $x \in \mathbb{R}^n$ to the linear programming problem where $x_1 = 1$. Also, suppose there ex...
Consider a Turing Machine which (1) reads all its input and (2) accepts inputs arbitrarily large. Given the affirmative answer to the previous question that there must be a loop in the finite-state control as its inputs get larger, could we conclude that there may be more than one loop in such a machine? That is, there...
In online knapsack problem, items arrive one by one. Each time an item $i$ arrives, its weight $w_i$ is revealed. We would like to maximize, in an online fashion, the number of items placed in a bin of capacity $W$. The proposition that I am trying to prove is that no deterministic competitive algorithm exists for this...
I have a graph G containing cities (vertices V) connected by distanced roads (weighted undirected edges E). Characteristics of the graph: Each city is connected to the rest of the graph Each city has an index value where the index is equal to minimum number of roads you need to use to get to the capital from this cit...
I have an almost fully connected graph in python with roughly 3k nodes and 9M edges. Each node in this graph is represented by a point in R3 and each edge represents the distance between them with a weight given by a weight matrix. My goal is to visualize subnetworks (areas where points close to each other also have a ...
void min(arr[], n){ for(i = 0;i < n; ++i) { // Change < to > if you want to find the smallest element if(arr[i] > arr[i+1]) arr[i] = arr[i+1]; } To avoid wording about a "just check my work" question. I will try to explain what I do not understand about this topic of loop invaraints. I have been having th...
I'm trying to design an algorithm for some specific arbitration requirements and I have a feeling I'm on well-trodden ground, but lack the maths background to properly analyse it. If someone could point me in the direction of further reading or prior work (or, of course, develop a complete answer should you wish) that ...
Problem: Prove $p \rightarrow (q \vee r), \neg q, \neg r \vdash \neg p$ using Modus Tollens. I need to prove the validity of the above sequent by using natural deduction. Initially, I didn't read the entire problem, and went the long way by doing an implication-elimination, two negation-eliminations, an or-elimination,...
One of the most challenges in distributed consensus mechanisms is both time complexity and message complexity. For example, PBFT message complexity is O(n^2) that means that it is only scalable to tens of nodes. Thus, classical BFT (Byzantine Fault Tolerant) consensus mechanisms are not scalable to the large networks. ...
Here is the question again : Give an example of two increasing functions f (n) and g(n) from the set of positive integers to the set of positive integers such that neither f (n) is O(g(n)) nor g(n) is O(f (n)). I tried with several functions such as sine and cosine, but they are not increasing functions but Oscillatory...
Is it possible to encode two 6-bit wide positive integers a and b guaranteed to be in [0, 63] in a way that a and b are recoverable -- in fewer than 12 bits? We could obviously concatenate the binary representations (a << 6 | b). The scheme would have to allow any two arbitrary values within the given range. Can we do ...
Let's say we have a directed graph in which each pair of adjacent edges has a weight; or, alternatively, each ordered triple of vertices A, B, C has a weight $W(A,B,C)$ of going A->B->C. I am looking for a generalisation of a widest path in such graph, that is, a way to find a directed path between given two vertices, ...
Claim: If we are training a hard-margin SVM on a set of perpendicular training vectors which can either be classified as "positive" or "negative," will every training vector end up being a support vector if the data is linearly classifiable? I can't seem to come up with a counterexample to this claim. Any ideas?
Some programs run quickly, some programs run slowly, and some spend all eternity whirring and whizzing without ever halting. The halting problem uses a thought experiment to prove that there cannot exist a program which can itself examine any arbitrary program and tell the user whether the program being examined will h...
I heard that some operations involving regexes that do not have common elements can NOT be generated using a finite automata. I do not remember what it was, where it was from, can anyone tell me what that could possibly be? Edit : I finally managed to find the exact statement. Here it is, below : A language (like $(00)...
I'm learning some Data Structures and I cannot figure out the difference between the Balanced BST and the AVL Tree. From my understanding, an AVL tree is a balanced tree with the height difference <= 1. But then what about the Balanced Binary Search Tree? What's the difference here? Let's take an example: I have a sort...
Let $A$ be a ring such that all elements of $A$ are complex computable numbers. I'm interested in knowing whether the decision problem that asks, given $P\in A[X]$, if $P$ has a root in $A$ is decidable. I know that this problem is decidable for the following rings: $\mathbb{Z}$, since we can easily bound the absolute...
I have a successful completed proof which used induction. but I essentially proved the goal on the base case by tactic discriminate. Why is this induction proof still stands? the principle of induction tells us induction involves three steps: - show that the P(O) holds, (* O stands for the first item *); - s...
I need to prove the above sequent using natural deduction. I did the first half already i.e. I proved $(p\rightarrow\neg q)\rightarrow \neg (p \wedge q)$, but I'm stuck on where to start for the reverse i.e. proving $\neg (p \wedge q) \rightarrow (p\rightarrow\neg q)$. I figured I would start by assuming $\neg (p \righ...
Common algorithms for creating bounding-volume-hierarchies (BVH) rely on grouping primitives together that are not necessarily adjacent in memory. This is either done by rearranging the primitives directly or using an index which is then sorted. What if we are not allowed to change the order of the primitives? More for...
Is $L = \{ w : \#_a(w) = \#_b(w) \}$ regular? I do not think it is. I recently posted a question and from there I was thinking if this language is regular. If we assume on the contrary, then there exists a pumping length $p$. In that case, the word looks like $xyz$ where $|xy| \leq p$. If $y$ does not have the same num...
Say you have 2N named peers (agents) able to address each other by their name and communicate freely among them. What distributed algorithm could they use in order to randomly pair up? The final situation would be that the agents were able to organize themselves in N random couples. On different runs the random couples...
I'm trying to find a characterization of when $L=L^*$. I think I have one, but maybe is trivial, but I don't know if the proof is correct. Claim: $L=L^* \Leftrightarrow L=LL$. Proof: If $L=L^*$ then is easy to see $LL \subseteq L$ so $L=LL$. The other implication is in which I have doubts, I used a simple chain of equ...
Problem There are N intervals in which a particular integer can be chosen. What is the maximum possible minimum gap between each integer if one integer is chosen for each of those intervals? For example: Input: [2,4], [0,8], [3,15], [10,20] We shall choose 2 in [2,4], 8 in [0,8], 14 in [3,15], 20 in [10,20] Thus answer...
As I understand it Rice's Theorem seems to imply the existence of the Halting problem. That is, with Rice's Theorem, we can prove that the Halting problem is undecidable. However, to me, it seems like one could write a proof using that the Halting problem is undecidable to show Rice's Theorem. I'm not exactly sure how ...
For example, we have an array [4,7,6,13] and I choose the first item 4 as the pivot. Now I have a pointer i that goes through the array from index 1 to index 3; and I have another pointer j that starts at index 1, increases whenever we find an element that is smaller than pivot and we swap this element with the element...
How can I use the master's method in order to solve the recurrence formula $T(n)=3T(\frac{n}{3})+\sqrt{n}$ ?
Please help me solve it in terms of Theta or Big O
In image processing we can use affine transformations for translation, rotation, shear and scaling of pixels. But what kind of transformations are used for twisting and pinching of image pixels? Or what is mathematical definition for this kinds of transforms?
2PL's rule says: Upgrading of lock (from S(a) to X (a)) is allowed in growing phase. But what if upgrading lies after the last lock and before the first unlock? Does it still count "in the growing phase"? For example, is the transaction below a 2PL? begin lock-S(X) read(X) lock-S(Y) read(Y) **upgrade(Y)** write(Y) un...
How would I go about proving that the language: $$A_{NTM }= \{\langle N, w\rangle | N \text{ is a nondeterministic TM and } N \text{ accepts }w\}$$ is undecidable? I looked at the proof for $A_{TM}$ being undecidable, but am struggling to figure out how to prove the above. Any ideas?
I'm following along the examples in https://people.csail.mit.edu/rrw/6.045-2020/note-cc.pdf and in specifically the following text: What’s a good protocol for computing MAJORITY? The natural thing to do is to have Alice and Bob send the vote counts! Over multiple rounds, when it’s Alice’s turn, she sends bits of the i...
I was studying Theory of Computation and I'm kind of lost in solving this problem. Let $R$ be a relation defined on the set of states $Q$ of a DFA as $q_1Rq_2$ if $\delta(q_1,a)=\delta(q_2,a)$ for some $a\in\Sigma$. Is $R$ an equivalence relation? Prove. So to prove that $R$ is an equivalence relation, I have to sh...
This paper explains that testing the irredundancy of a SAT instance is NP-complete. But I don't understand the theorem/reduction. How would one reduce 3SAT or k-SAT to this problem, for example?
We are trying to build a system that would accept fyp proposal documents and then would validate is there something missing, like a heading or a chart that should be in the document according to the template. The question is how machine learning can be used to solve this problem. As it seems a simple if else sort of a ...
I want to draw a DFA to accept a String containing even number of both A and B, but rejects the empty String(ε) I have already drawn the DFA which accepts the above language, without rejecting the empty string.
I have many API endpoints that take IDs that are constantly increasing. I want an algorithm to find the highest number in the least amount of requests. I need to do this without knowing what the previous highest number was. I am thinking something like binary search would work but would it be the most efficient? I also...
I have a problem where I can easily construct a set of deterministic acyclic finite state automata (DAFSA) and I need a full-text search index, e.g. a suffix tree/array, over all the words encoded by these automata. Is there an efficient algorithm for this? By efficient I mean that the complexity must not depend on the...