instruction
stringlengths
35
29.1k
We know that Extended Church-Turing Thesis (or Cobham's thesis) states that any 'reasonable' model of computation can be equivalent to Turing Machine model in at most polynomial time overhead. People always believe that this ECTT is not true and a candidate counterexample is quantum computation. But, why they don't see...
Just did a test about the subject that had the following question: I know it seems trivial and my first reaction was "well of course its true" but the epslilon kinda threw me off. $L_2$={ab,$\epsilon$} $L_1$={a} , is there a computable reduction from $L_1\leq L_2$ ,: True Or False I assumed by contradiction that its tr...
I have a dense set of data that looks like this Y X1_BIN1 X1_BIN2 X2_BIN1 X2_BIN2 X2_BIN3 ... 0 1 0 0 1 0 ... 1 1 0 1 0 0 ... 0 0 1 0 0 1 ... 1 0 0 0 1 0 ... 0 1 1 0 0 0 ... but for millions of rows and about 400 columns, corresponding to bins of about 20 different XN variables. The average of Y is ...
Setup An instance of Max-Coverage is typically defined by a collection of $n$ sets $S = \{s_1, s_2, \dots, s_n\}$, and a budget $k$, where the objective is to select a subset $U\subset S$ such that $$\big|U\big| \leq k,~\text{ and }~\big|\cup_{s\in U}s\big|~\text{ is maximized}.$$ The variation I am interested in is as...
I have a simply connected graph $G$. I start at a uniformly randomly chosen vertex, and from there, randomly walk through the graph by choosing a random edge to follow at each step. On average, how many steps $T$ until the random walk hits every vertex? Can this be efficiently computed? Here are some cases for which I'...
I'm playing a MMORPG where we party hunt, the problem is that at the end of the hunt each person may have different balances depending on what items they wasted and the stuff each one looted. The game tell us what are our balances in the party, but nothing more... so for example, having something like this as an input:...
Prove that $L$ is not a Context-free language, where $$L = \{ a^{i} b^{j}c^{h}\mid i,j,h\in \mathbb{N} \wedge h = \max(i,j)\}.$$ I have an idea: It can be divided into two situations: When $i < j$, $w = a^{i} b^{j} c^{i}$ When $i > j$, $w = a^{i} b^{j} c^{j}$ Then with the help of the pumping lemma,but I will onl...
Freivald's algorithm (see the wiki) is a randomized algorithm for verifying whether the product of two $n \times n$-matrices $A$ and $B$ yields a given matrix $C$ (i.e. $AB = C$). The way this task is accomplished is to introduce a random vector $\vec{v} \in \mathbb{R}^{n}$ and evaluate whether $$A(Bv) = Cv$$ The claim...
I have two similar problems in which I'm trying to find a connection to help me solve one of them. In the first one I'm given a graph G = (V,E) , integer k, and vertex cover U of size k. The objective is to find the largest clique (max size clique in G). The second one is instead of a vertex cover, U is is a group of v...
The DSATUR algorithm is a greedy graph coloring algorithm. It consists of applying the usual greedy coloring algorithm, considering vertices in reverse lexicographic order of (number of different colors among neighbours, total number of neighbours). Though not always optimal, this algorithm is already known to be optim...
We know that $L$ = { $w$ $\in$ {a, b}* $|$ $|w|_{a}$ > $|w|_{b}$ } This is my answer: $G$ = ({$S$,$A$,$B$},{$a$,$b$},$R$,$S$) $R$ = S $\to$ $AB$ $A$ $\to$ $aA | Aa |B$ $A$ $\to$ $a | abB | Bab | Bba |aBb|bBa $ But after testing, it seems that writing like this is wrong. So how should it be written? https://web.stanford...
The following example is given: The sender and receiver are using 1 bit even parity The sender is sending 1110 1010 over a noisy channel. in case 1 the receiver gets 1110 1100 in case 2 the receiver gets 1110 1001 Which one of this two cases was detected and why wasn't the other one ? I don't understand how one error...
A defer statement takes another statement and evaluates the given statement at the end of the current function call. See how Go does it. Delimited continuations can be abused to provide throw/catch semantics. See an example here. Is there any way to abuse delimited continuations to provide defer semantics? Sorry if thi...
I have the following algorithm: MyFunction(A, i, j): if (i + 1) >= j: return k = [(j - i + 1)/4] # round up MyFunction(A, i, i + k) MyFunction(A, i + k, i + 2 * k) MyFunction(A, i + 2 * k, i + 3 * k) MyFunction(A, i + 3 * k, j) for a from i to j: m = i for b from i to j: if A[b] > A[m]: m = b swap A[m] with A[a] My go...
Problem definition: Given a universe $U$ of $n$ elements, a collection of subsets of $U$, $S = \{S_1,..., S_k\}$, and a cost function $c: S \to Q^{+}$. Find a minimum cost subcollection of $S$ that covers all elements of $U$. The provided algorithm (Approximation algorithms - Vijay V. Vazirani) Part of the proof where...
I don't really understand time complexity, and wanted some clarification in this hypothetical situation. If I were being given items one by one, and I wanted a list of them all in the reverse order I got them in, I could add each item to an ArrayList, then reverse it. Both of these operations are $O(n)$ in time complex...
Suppose that we have an $n$ sized array that it broken into $m$ contiguous, non-overlapping chunks such that when the chunks are concatenated, they form the original array. Say we perform a binary search individually on chunks[0], chunks[1], chunks[2]..., chunks[m-1]. What is the complexity here? We perform binary sear...
A question that answers itself. If P=NP could be proved in a formal language, then surely it would be as easy to verify the proof as it would be to discover/derive it? Couldn't a program just quickly check that every sentence/line obeyed the formal rules? If P!=NP could be proved in a formal language, then it could ...
So I’ve been reading about multi-threading these past few days. Can you give me a real life example where the multi-threading might be used in a REST API web server?
When can we say that a software is an operating system and not a firmware, in terms of what it can do? I know that firmware is usually stored in ROM and OS is stored on HDD/SSD, but technically you can also store OS on ROM, so the way of storage is not what exactly distinguishes between an OS and a firmware. So what ca...
Suppose I have a list of tuples. Each tuple contains 2 intervals. The intervals in each tuple have nothing to do with each other. I would like to find a smaller list of tupels that covers all elements in each interval. Therefore it´s necessary to merge the intervals of the first type and the intervals of the second typ...
Good day everyone, I'm currently trying to carry out the PetersonNP (a.k.a. FilterLock) correctness proof (mutual exclusion). I've found several proof sketches on concurrency books but I'm interested in the one shown in Distributed Algorithms (by Nancy Lynch). I find it more convincing because lemmata required for prov...
I need some help with this question: Definition: A Turing-machine that is a counter for the language $L$ is called 'polynomial counter' if there exists a polynomial $p$ s.t. every word $w\in L$ appears on the machine's tape starting from the $p(|w|)$ cell at most (that is, the first letter of $w$ is at cell $p(|w|)$ or...
Why the Kth largest element of a Min Heap of size K is always root element of the Min Heap ? How to prove this ?
Consider a weighted graph where each node represents a city. Now a truck starts from a city A and it has to cover a set of cities B, C, D.. could be in any order How to generate an ordering that result in the minimum total distance travelled while covering all the cities.
I read a proof in my script: If $P = NP\implies $ there exists no OWF $f$. A function $f$ is a OWF $\iff$ $f\in PTIME \space \land$ $f^{-1}\notin PTIME$ Their proof was a bit messy so I want to ask if the following technique (in general) can be used to proof similar problems: Assume $P = NP$, and a OWF $f$ over $\{0, 1...
I have a list of connected rooms, I need to visit each room in the list, but I have to record the exact path to traverse the entire graph. 1: [2] 2: [1,2,3] 3: [2] 4: [2] output: [1,2,3,4] expected: [1,2,3,2,4] I've written a Depth First Search that returns a path of [1,2,3,4], what I am looking for is [1,2,3,2,4] I...
Consider the following sequence $$\mathcal{S}=\langle3,1,4,1,5,9,2,6,5,3,8,9,7,9,3,2,3,8,4,6,2,7,9\rangle$$ We can imagine some adjacent elements of $\mathcal{S}$ as a number. For example, $5$, and 3 and $8$ form the number $538$. We say two number in above format is disjoint, if there is nothing common element betwee...
This is a question from CLRS: Describe an implementation of the procedure RANDOM(a, b) that only makes calls to RANDOM(0, 1). What is the expected running time of your procedure, as a function of $a$ and $b$? Here RANDOM(a, b) is a random number in the range $a, \ldots, b$. Here is the answer: RANDOM(a, b) range = b ...
In Petal-Deletion, we are given an undirected graph G and k ∈ N, and the objective is to decide whether there exists a subset S ⊆ V (G) of size at most k such that G − S does not contain any 3-petal as a subgraph. Design an O(k)-vertex kernel for Petal-Deletion. I got a hint: You may use a 4-approximation polynomial-ti...
I read about correctness of iterative and recursive algorithms.I need a sequence of book recommendations for learning mathematical aspects of computer networks and data communtions such as applications of graph theory and number theory in routing and security and error control respectively.Please provide layerwise reco...
In this paper[1] there is a section where it is mentioned that “The most commonly used L1 loss will have different scales for small and large objects even if their relative errors are similar”. I don’t understand this statement. Can anybody explain? [1]: End-to-End Object Detection with Transformers
How programming languages are capable of handling generics ? Here is some context on why I got the question. Constructs like Lists, Dictionaries and Sets in Python can handle any type of data without even specifying the type of data being added. Whereas in Java Collections require you to specify the type at the time of...
I have searched around and it seems like it is impossible for a Turing machine to implement binary search for an arbitrary sized array. How can a turing machine be called universally computable if it can't perform a simple operation other models of computation can do with ease?
You have $2$ computers denoted by $C_1$ and $C_2$ and $n$ missions $M_1,M_2, \dots M_n$. Doing the $i$-th mission on $C_1$ (resp. $C_2$) costs $a_i$ (resp. $b_i$). Moreover if you do $M_i$ and $M_j$ are done on different computers. you incur an additional cost of $d_{i,j}$. I need to find an efficient algorithm that mi...
In these lecture notes the authors mentions that P is a syntactic complexity class, as we can find a decidable set of encodings for all polynomial time Turing machines. Of course, given a deterministic Turing machine $M$ and a number $k$, we can construct a Turing machine that simulates $M$ for $|x|^k$ steps on input $...
Sorry for the vagueness, but I'm trying to study the latest progress on the exact cover problem and using graphs for NP-complete problems. Googling around has not been very helpful. I understand the basics but I can't find a key journal in this area or where to look online. Any references would be greatly appreciated!
I tried to search whether Knapsack (the decision version) has a FPT algorithm, but didn't find anything on the topic. Can someone help with a reference?
For a recurrent neural network, the LSTM was a model of how the network worked. However, consider the case where an input was a long paragraph or even an article. $$c_1c_2...c_n$$ where $c_i$ were some characters. The LSTM would work as expected given $n$ not a large number. But what if $n$ was a large number, say $1e5...
I am struggling to grasp the algorithm for building the KMP failure function. The bulk of what is making my understanding incomplete concerns the line length=PI[length-1]. There is the psuedo code for the algorithm below. Here are my questions: 1.) How do we know that in the event s[i] != s[length], the best possible o...
I am reading a text book by David Tarnoff and there is something I do not understand, the section is on CPU and memory. The book states that the number of address lines going into a memory device determines the number of addresses which makes sense to me, as it says for $n$ address lines going into the device there wi...
I'm having a small problem understanding what is the result of the 4-approximation polynomial-time algorithm for 4-Hitting Set. What I mean is that by solving 4-Hitting set I get a group X such that all subsets in the universe have a common element with X. What can I say that the result of the approximation algorithm?
What is a T-star packing and what is Proper Maximal 3-Star Packing? I read some definitions and can't understand "By a T-star we mean a complete bipartite graph K1,t for some t ≤ T. For an undirected graph G, a T-star packing is a collection of node-disjoint T-stars in G."
I'm Telecommunication student so I don't have Computer Science background, just in case if my question looks stupid. Here is my scenario: Consider an empty array named ARR with size N, we also have an array named MAP with size N that stores the state of ARR cells, ON for filled, OFF for empty, initially ARR is empty s...
Given a list of unique strings, how can I find the sum of squares of longest common prefixes length for all pairs? I think a trie will be useful but I'm not sure how to calculate the final result. For example, if given strings are and, anacron, anagram, build and buffer Then possible pairs are (and, anagram) which will...
Studying for my finals in Complexity theory. This question comes up in different variants and it requires to use probability. A side note before, to be more clear: A CNF clause consists of $n$ clauses $C_i$, so $\varphi=C_1\wedge\dots \wedge C_n$, and each $C_i$ has some amount of literals $l_1^i,\ldots ,l_m^i$, so $C_...
It is known that neural networks, such as convolutional neural networks, struggle with pattern recognition if training sets contain ambiguities (i.e. several labels can correspond to one and the same pattern). However, I struggle to locate the paper that directly discusses this issue, or demonstrates it for the first t...
I knew that $P \neq EXP$ by Time Hierarchy Theorem. But, I'd like to show that $P^A \neq EXP^A$ for all oracles A. How can I do it? I knew that If I make A=EXP, PSPACE, NP, and many others, then this would show that the inequality holds. But, how can I prove it for all oracles? Can you give me hints? Notes: I don't thi...
The language $D=\{[M]|M([M])=0\}$ is not decidable because of the following argument: Suppose there was a $TM \space M_D$ that decides $D$. Then if we gave $M_D \space [M] $, there would be two possible outcomes: 1. $M_D([M_D])=1 \text{ (accepts)}\implies M_D \text{ does accept }M_D $, contradiction, because then $M_D(...
As per Galvin's book, segmentation is the solution to external fragmentation. But in segmentation, the memory blocks are of different sizes. So, if one segment is removed that creates a hole. If we put the small segment many times then this creates external fragmentation. How, then, is segmentation solution to external...
Let $n, M$ be integers. Given two arrays $X$ and $Y$ of $n$ elements. For each $i \leq n$, we define arithmetic progression $X[i] + kY[i] \pmod M$, where $0 \leq k \leq M$. Find all $k$ such that for all $i$, $X[i] + kY[i]$ has the same value. Example Let $n = 3$ and $M=6$. Let $X=\{1,3,5\}$ and $Y=\{2,1,0\}$. Then, $...
This seems to be my first ever question :) Given that adjacency lists store all the necessary information with regards to the endpoints of an edge, we could even store a weight alongside that. I don't understand why we would ever want to use an Edge List in a way that would be more useful than the above mentioned Adjac...
Assuming you know the meaning of pipelining in Computer architecture & organization. When is the next PC address or jump address available or known to the processor? In this lecture, https://youtu.be/TMpjvAvQCWA?t=2346 Jump and branch addresses are computed during EXE or execution stage and are good to go ahead but I c...
Here's a question about using a divide and conquer approach to find a majority element in an array. It's taken from Algorithms by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani, Question 2.23. I'm not convinced why this algorithm should work. It seems to give no direction on what to do with the element that is le...
I have a connected graph, each vertex has a cost. I want to slice the graph into as many components as possible, but each component should have a cost (sum of costs of vertices) at least C. I think it should be possible with a modified Kruskal's algorithm. Each vertex is a component by itself. Then, I find the cheapest...
Given a number line from $-\infty$ to $\infty$, there exists a point $P$ on the line. We need to find the minimum number of steps to get to $P$ subject to the following constraints: The value of $P$ is not known. At a time you can only move one step either backward or forward. For example: if you are currently at 1, y...
I just want to know if people in the complexity initiated the name 'class' because the term 'class' in Zermelo-Fraenkel set theory or not? For me, I assume the answer is Yes; because it doesn't seem right that it was coincidence and we use all time set theories tools to prove inclusions. But what made me asked this que...
The Problem Find the shortest sequence of moves that makes up the optimal solution of a level. If there is more than one optimal solution, just find one of them. Game Rules The game level is made up of two types of tiles: walls and floors. The player's task is to paint the whole level using a ball that can be moved in ...
I recently went through a interview session for a SWE/CS role at a well known company. It wasn't specifically a "coding-round" but was titled a "domain interview" session, so I assumed the interviewer was interested in an discussion/high-level-solution related to the problem. The problem: You're given a computation gr...
I always seem to have trouble finding a formal way to analyze this (be through proofs or whatever). The problem statement is as such: If A and B are friends, and B and C are friends, then A and C are friends too. In a simple network like the following, this makes complete sense: 1 --- 2 --- 3 Analysis: We can see that ...
I have been looking for a maths operation that allows me to combine functions in a specific way. For example if we have functions f and g both with single mappings from o to e and v to c respectively, and we want to achieve whats below. f ? g = {o -> e} ? {v -> c} = {(o,v) -> (e,c)} I have been told that what I'm look...
I'll keep the reasoning abstract. If I start from a mathematical formulation of a problem $A$ known to be $NP$-hard, I add a set of constraints which creates a problem $A'$. However, I do know that there exists some instance of the problem for which the new set of constraint is empty, which brings, for those instance, ...
I'm asking about the question described here: Knapsack Problem with exact required item number constraint Can't we iterate over $\binom{n}{L}$ options (which is polynomial), and for each option check if the constraints are met?
The algorithm iteratively picks the vertex with maximum degree and removes it and every incident edge of the vertex, until only vertices with degree of $0$ are left. Formally: $\text{GreedyVertexCover}(G)$: $C\leftarrow \emptyset$ While $(E\neq\emptyset)$ $\hspace{10pt}\text{Pick a vertex }v \text{ that has maximum deg...
I have a × rectangular grid of cells, and a set of rectangles within this grid. Each rectangle is a subset of the cells. (Alternatively, you can think of them as axis-aligned rectangles where each of the four corners has integer coordinates.) Some of these rectangles overlap and some of these rectangles are adjacent. ...
In the Inclusive Vertex Cover problem, For a given graph $G=(V,E)$, each vertex $u\in V(G)$ has weight $u_{w} \in \mathbb{N}$ and value $u_{v}\in \mathbb{N}$. The value and weight of a set cover $S$ are defined as the sum of weight, value of the vertex in the cover, and its neighbors. Note that a vertex might be counte...
I am trying to solve a problem efficiently. The problem is to recurse over a set $\{0,1,\dots,n-1\}$ (as array) in ascending or descending order, while removing or re-adding items in $O(1)$ time. A sample algorithm is shown below (pseudo-code): function countswaps(n, x, y, unvisited) { c = 0; remove(x, y from u...
Design a grammar for the language $$F = \{x^a y^b zx^b y^a\mid a, b\geq 1\}$$ I'm trying to get a stronger grasp of designing grammars for languages. A thorough explanation of how to design the grammar for this language would be very much appreciated.
I hope this question doesn't offend anyone. I start off by saying that I have and always had difficulty understand the language used in computer science so I have to interpret everything into the language of physics of electronics. First what is termed as memory, I seem to think that it refers to energy that is held ba...
Suppose you are given a directed acyclic graph $G$ with $n$ vertices and an integer $k \leq n$. Each edge has an associated weight $w(u,v)$. We want to find $k-$vertex-disjoint paths that cover all vertices of the graph such that it minimizes the total sum of the weights of all edges in the paths. (assume such $k-$ pat...
$C$ here represents combinations. $$ C(n + m, m) = \frac{(n + m)!}{n! m!} = \frac{(n + m) * (n + m - 1) * \ldots * (n + 1)}{m!} $$ In this formula it looks like it's $O(m)$ because both the numerator and denominator is $O(m)$, if I'm not mistaken. Alternatively, $$ C(n + m, m) = \frac{(n + m)!}{n! m!} = \frac{(n + m)...
This is the PARTITION problem: Given a multiset S of positive integers, decide if it can be partitioned into two equal-sum subsets. This is the SUBSET SUM problem: Given a multiset S of integers and an integer T, decide if any subset of S sums to T. The positive variant of SUBSET SUM is NP-complete. SUBSET SUM can...
Let's consider the following simple algorithm for attacking the Travelling Salesman Problem: Choose the pair of cities $(A,B)$ where $A\neq B$ and the distance between $A, B$ is minimal amongst all the distances of the cities. Start with $A$, then visit $B$, then in each step visit the nearest city not visited already...
The book CLRS says that any comparision sort algorithm requires omega(nlgn) comparisions n the worst case. My question is that why for heapsort it's O(nlgn) not omega(nlgn) since heapsort is also a comparision based algorithm?
Given graph $G=(V,E)$ and weight function $w\,:\,E\to\mathbb{N}$, function $f(G,w)$ finds the heaviest clique in the graph, when the sum of a clique is the sum of the weights on all of the edges. I want to prove that there is a Turing machine $M$ so I will get $L(M)=CLIQUE$, using function $f$, where $CLIQUE$ is the la...
The output given by this nearest neighbor algorithm for the Travelling Salesman Problem can be arbitrarily bad. In the example constructed here, the triangle inequality doesn't hold in most cases. Let $L$ be the set of positive real numbers $r\in\mathbb{R}_+$ such that for every setting of TSP such that the triangle eq...
I'm new to the site. I had a test a few days ago and failed it, I had a question I did not understand. This is the question: Let's look at the FALSE language: Collect all the verses P in the form of CNF so that any placement on the variables P will not satisfy P. We will mark the number of variables in N and the number...
I'm looking at the methods posted in https://www.geeksforgeeks.org/program-to-find-whether-a-no-is-power-of-two/ for checking whether n is a power of 2. Method 5, pasted below, in the link claims to be O(1) but shouldn't it be O(log n)? When we do n & (n - 1), that's a bitwise operation over 32 bits (since n is a 32 bi...
I'm new to networking so please bear with me. My textbook gives 4 as an answer, but I'm not sure I understand the question: What's a "/20-subnet"? My understanding is that a network mask (/20) is used to give structure to a classless IP-address, i.e provide a way to distinguish network bits from host bits. In this cas...
In the answer to an earlier question "SAT algorithm for determining if a graph is disjoint" a formula is constructed that is satisfiable iff a given graph is connected. The formula uses a lot of variables, as basically a breadth first search is performed and the variables code the number of steps needed to reach a vert...
What's so hard about creating a piece of software with as minimal as possible mathematical axioms, defining a formal language in which one can create new constructs based on the existing ones, and then all research papers could be written in that language and its correctness verified by a computer?
I have an assignment problem where I need to assign resources to consumers. Each consumer has a list of resources it'd like to acquire, ordered by preference, and each consumer can have at most one resource. I'd like to find a mapping from the resources to the consumers that tries to satisfy each consumer's preferences...
Given a boolean vector b representing a solution to the knapsack problem with n elements k capacity and where each element has integer weight and value. Proving that the solution is a solution is trivial. You add all the weights multiplied by the selection coefficient and check if it adds to more than the capacity. But...
I am a student who wishes to research neural networks (ANN, CNN, RNN) and deep learning, write papers on those topics, and actively participate in forums like CVPR. My question is: Which professions are dedicated to researching the theories behind, and developing models of, deep learning and neural networks? Taking the...
Consider Intel x86 and AMD x86 Processors. As I understand, since they use the same Instruction Set, in theory an application compiled for Intel x86 processor would run without any modification on AMD x86 processor, even though these processors have different microarchitectures. Is my understanding correct? Or is ther...
I'm trying to understand Figure 1 in this theoretical description for queues: https://www.cs.bgu.ac.il/~abraham/courses/Concurrency14/2(Logic)/3.Qexample.pdf Key excerpts from the PDF: I grasp everything except 3(c). How can a dequeue event have a preceding enqueue event which is not in the range of the gamma functi...
Here is a question that I do not understand: There is a list of items $E = e_1,\dots,e_m$. Suppose we have two players (the first and second). Each item $e_j$ has a value $v(e_j) \ge 0$. The values are not necessarily integers. The value of a set of items $A \subseteq E$ is $v(A) = \sum_{e_j \in A} v(e_j)$. Let's look...
The question is Convert the following 16-bit binary numbers to two 8-bit signed integers (two’s complement) in decimal. i. 0b 0011 0110 1101 0100 I first flipped it and added 1 to it which equaled 0b 1100 1001 0011 1100 which is 51516 in decimal Is this right? I don't really understand what the question is asking for...
Let $w$ be a string over an alphabet $\Sigma$. It is obvious that $w \circ \epsilon = \epsilon \circ w = w$. However I'm having a hard time coming up with a proof for that (which I assume should be fairly easy, I just don't know how to tackle it). My first thought on how to do it is the following: $\Sigma^{*}$ is the s...
Consider an equations of the form: (a + x) * (b + y) - c = 0 Or: (a + x) * (b + y) = c Or: x * y = c Classifier evaluates these equations as binary quadratic type. Are they can be solved only for exponential time? Or there is another way?
A few days ago I had a test and could not pass it. This is a question I did not understand in the test. We will look at the Edge-Coloring problem, in which, as is well known, we get as input graph G = (V, E) and natural number k and ask "Is there a coloration in arcs of G which uses at most k colors?". Remember, while...
The following English sentences have different forms (syntax): Declarative: You are my friend. Interrogative: Are you my friend? Imperative: Be my friend! Exclamative: What a good friend you are! They also have different meanings (semantics): Statement: You are my friend. Question: Are you my friend? Command: Be my ...
Deteremine if $L = \{\langle M\rangle : L(M) \text{ consits of all words of prime length}\}$ is in $R$ or in $RE\setminus R$ or not in $RE$ I am trying to prove that $L$ is not in $RE$ by reduction from $L_{acc}^c = \{M,w: w\notin L(M)\}$ to $L$, but I it seems not works for one side and I have no idea how can I fix ...
a few days ago I had a test and could not pass it. This is a question I did not understand in the test. Recall the reduction we saw $SAT \leq _p 3SAT$. Given verse $\varphi$ in the form of $CNF$, we converted each fragment $C_i$ in $\varphi$ to verse $D_i$ in the form of $CNF$ by adding new variables. Then, we returne...
Trying to get a fair understanding of our artificial immune systems. To do this I’ve been reviewing this paper, but the algorithm and mathematics is over my head, could someone explain the below to me in simple terms. Thank you In the case of this paper, I’ve been able to understand that the system takes the IoT-Bot da...
a) For $\sum =\{0,1\}$ , design a deterministic finite automaton $M$ accepting the language $L=\{a^ib^j:i,j\ge 1, \text{5 divides (2i+3j)}\}$ b) Prove that ypur automaton exactly accepts the language $L,$ i.e $L=L(M)$ I first find $i,j$ relation . since $5|(2i+3j) \Rightarrow j=i+5k, k\ge 0(\in \mathbb{N})$ Theref...
I understand how the UF algorithm works to detect a cycle in an undirected graph, but I don't understand why it always works. Could someone explain that intuitively? Specifically, I don't understand why if you come across an edge that between nodes $u, v$, and if you see that $u$ and $v$ are already in the same disjoin...
This is a cross-posting from here, on the mathematics Stack Exchange. I thought this might be a more appropriate venue. The problem is this: I have a list of sets $$S_1, S_2,... S_N$$ where each set contains $m$ elements, all drawn from some larger set $A$. The challenge is to find the largest set $$K\subseteq A$$ such...
Problem A: Given an algorithm $\mathcal{A}$ for $(I,k)$,$k\in \mathbb{N}$, $A$ return true $\iff$ There exist a subset $S\subseteq I$ s.t $|S| \le k$ some property hold. Problem B: Given an algorithm $\mathcal{A}$ for $(I,k)$,$k\in \mathbb{N}$, $A$ return true $\iff$ There exist a subset $S\subseteq I$ s.t $|S|=k$ some...
I have a strongly connected component (SCC) of $n$ vertices. Let $n_1n_2$ be an edge between two vertices $n_1$ and $n_2$ in this SCC. Is there an efficient algorithm to check if removing the edge $n_1n_2$ splits the SCC into two SCCs or not? The graph I am using is a directed graph.