instruction
stringlengths
35
29.1k
So far, I have found out that chordal graphs have linear number of maximal cliques with respect to the number of vertices. In general case, it is exponential. I am trying to determine whether the number of maximal cliques in a $(2C_4, C_5,P_5)$-free graph is linear or polynomial with respect to the number of vertices. ...
Question Statement: Given a NFA $N$, design an algorithm that runs in polynomial time such that it determines if $L(N)$ is infinite. (Note that converting NFA to DFA is exponential time). For any DFA, By pumping lemma, I am very sure that the following algorithm works: T = Upon input <M> (a DFA) Accept if any state ...
I have been stuck on this problem for few hours, my assignment asks to design an efficient algorithm(polynomial running time) that check whether a given flow network graph contains a unique maximum flow or not. I have been search everything I could, and some people said run an algorithm that able to find a max flow fir...
Traditional ICP assumes that the inputs are point clouds with no predefined correspondences between the clouds. If I know before hand that some / all points in one point cloud corresponds to some / all points in the other point cloud, I assume this becomes an easier problem to solve. What is the name of this modified v...
Here is a simple turing machine, that accepts only $0$. For this, it read $0$, write it with $x$, then move to right and checks end, if it is end it accepts. With that logic, I can also add this 1->x,R, then it accepts all strings of length 1, {'0','1'}. What I want to do is, instead of writing to logic I want to wri...
Lets assume I have this turing machine: And I have a $\Sigma = \{0,1,2,3,4,5\}$. Now my question is can I simplify the transaction from $A$ to $B$ ? Is there any way so I can write - when the read value is not $2$, write $x$ and move to right?
For reference - Gödel machine is a hypothetical self-improving computer program that solves problems. It uses a recursive self-improvement protocol in which it rewrites its own code when it can prove the new code provides a better strategy. So let's say you have a program which solves TSP using Simulated Annealing, you...
$\mathit{GNI} \in \mathrm{PCP}(\mathit{poly}(n),1)$ GNI is the language of nonisomorphic graphs. Given two grapsh $G_0$ and $G_1$ with $n$ vertices, a verifier expects $\pi$ to contain, for each labeled graph $H$ with $n$ vertices, a bit $\pi[H] \in \{0,1\}$ corresponding to whether $H \equiv G_0$ or $H \equiv G_1$ (a...
I'm reading (with much pleasure) the book Quantum Computing Since Democritus by Scott Aaronson. At some point the author claims that, while most most people believe that $\mathbf{P} = \mathbf{BPP}$ in real life, it is very easy to construct an oracle $O$ such that $\mathbf{P}^O \neq \mathbf{BPP}^O$. Frankly I don't fin...
I'm currently looking for literature/papers on machine learning techniques to create structures. In detail, I want to generate finite automata (NFA, DFA), which are useful for student-exercises. So I have a bunch of useful graphs and I want to check, whether there is a possibility to feed that into an ML algorithm and ...
Professor has given this question in exam. I am not able to find relevant reference for this question Which Addressing Modes (for x86 architecture) consumes more CPU cycle?(Consider all are special purpose registers) A. Indexed B. PC-Relative C. Indexed Register with displacement D. None of the above What I have unders...
Let $x_{ij} \in \{0,1\}$, $1 \leq i \leq M$ (typically, $M = 2000$), $1 \leq j \leq N$ (typically, $N = 10$), be Boolean variables. If possible at all, I would like to simplify the following expression $$ \bigvee_{i_1,\dots,i_N} \left(\bigwedge_{k=1}^N x_{i_k k} \right), $$ where the join operation is taken over all ...
So I have done part a) but I have no clue what I am supposed to do for part b), I have been trying for days to wrap my head around and even asked my fellow course mates, none of which seem to know themselves. The way I understand it they give me automaton of a->b->c But what do they mean about the next state a',b',...
I'm trying to use a proof assistant to define a type and a relation that are mutually dependent on each other: Vec : (a : Type) -> (n : Nat) -> Type0 Rel : (a : Type) -> a -> a -> Type data Vec : (a : Type) -> (n : Nat) -> Type0 where Nil : Rel Nat n 0 -> Vec a n Cons : a -> Vec a n' -> Rel Nat (S n') n -> Vec a n...
Let's say that a string of length $N$ is "compressible" iff its Kolmogorov complexity is less than $N$. To keep it simple, we can assume binary strings for this. It is easy to see that almost all binary strings of length $N$ are incompressible by using the pigeonhole principle. So my question is, how many strings of le...
I have a graph with at most two outgoing arcs for each node and I need to extract a DAG by removing the least number of arcs. I know that the general problem is np-complete but i can't reduce it to the other one. I know that each graph can be mapped to a graph with only two outgoing edges for each node, but i can't fin...
Consider two unknown binary strings $$X = x_{1} x_{2} \dots x_{n^{2}}, \quad Y = y_{1} y_{2} \dots y_{n^{2}}, \quad x_{i}, y_{i} \in \{0, 1\} .$$ We may request a string $Z = z_{1} z_{2} \dots z_{n^{2}}$, where $z_{i} = x_{i}$ or $z_{i} = y_{i}$, no more than $n + 1$ times. So, for every request we set required $z_{i}$...
I have a set of many bi-directional links like A-B, A-C, B-C, A-D, C-D, D-E, etc. I need to find a set of many closed chains with a sequence of different vertices (vertex-disjoint cycles). It would be better if I can find them all. How I solve the problem right now: I build a directed graph by these links. I take one ...
If I have n points A, B, C, D it seems like finding the closest pair via brute force search would go like: Compare A to every item (n-1) Compare B to every item (except A which it has already been compared to) etc for every element. This seems like it would be less than $O(n^2)$ because the you are comparing to a pr...
Of course assuming there aren't any negative cycles. I saw this question somewhere. And i saw a complicated solution which says to build three such graphs and connect between them in a very complicated manner. My question is why isn't my simple solution good for it? My simple solution is to first find the negative edg...
I'm reading Compilers Principles, Techniques and Tools textbook and I encountered a problem from exercise 2.3 We have to construct a syntax-directed translation scheme that translates arithmetic expression from postfix notation into infix notation. I constructed a scheme the following way. expr -> expr expr + | expr ex...
I'm trying to understand what are the techniques to prove an exponential time lower bound. For some problems, we can prove that the size of the output is exponential is the size of the input, thus it takes an exponential number of steps just to write the output. For example for some generalized board games, if the inpu...
So given 2 arrays of equal length, is it possible to determine whether the 2 arrays contain the same elements (ignoring duplicates and where those elements have a total order relation) with time complexity faster than O(N log N)? So I'm going to go into what I've been pondering, but have a couple specific questions at ...
If we start a new process with exec('process-2') Does this cause an immediate context switch in order to halt the current process and then start the new 'process-2'? Edit: This is a theoretical question with no specific OS intended, but you suppose it's some UNIX like OS. There is no specific details about exec, the...
We know that the Burrows-Wheeler Transform is reversible, in the sense that, given s=BWT(w) and an index I, it is possible to recover w by an algorithm. But how to prove that w is unique? In other way how to prove that Burrows-Wheeler is injective?
Let $B$ be an undirected tree with $|V|$ nodes given as adjacency list. I want to develop a greedy algorithm using pseudo code to find a maximal matching in runtime $\mathcal{O}(|V|)$. My approach: Find all leaves. For each leaf if the parent edge has not been seen by another leaf, mark the edge to its parent as matchi...
For every Kth operation: Right rotate the array clockwise by 1. Delete the (n-k+1)th last element. eg: A = {1, 2, 3, 4, 5, 6}. Rotate the array clockwise i.e. after rotation the array A = {6, 1, 2, 3, 4, 5} and delete the last element that is {5} so A = {6, 1, 2, 3, 4}. Again rotate the array for the second time and de...
I am reading this paper by Fortnow, titled: One Complexity Theorist's View of Quantum Computing. In section 4, he states the following: Bernstein and Vazirani [BV97] show that BQP can simulate any deterministic or probabilistic polynomial-time algorithm and Bennett, Brassard, Bernstein and Vazirani [BBBV97] show that ...
How can we solve summation of asymptotic notations like given below: $$ \sum_{k=1}^{n-1} O(n). $$
The problem exactly: Suppose you're helping to organize a summer sports camp, and the following problem comes up. For each of the n sports offered at this camp, the camp is supposed to have at least two counselors who are skilled at this sport. They have received job applications from m potential counselors. For each o...
I would like to build a Data structure that uses subquadratic space to quickly report a set of AABBs (axis aligned bounding boxes) in 3 dimensional space when it intersects a query line? I am only interested in the design, no coding. I believe I can use the approach of kd-trees assuming that the query line is also axis...
I was trying to do the following: Consider the set of all strings over the alphabet {0,1,2,9} that are decimal numbers beginning with 1 and ending with 9 and having exactly one decimal point (.). For example 12.9, would be a valid decimal number while 0.129 would be not since it does not begin with 1. but it didn't s...
I have a doubt. For a given n (axis-parallel) squares in a plane, where there are Ω(n²) intersection points between the edges of the square, is it possible to have O(n) external intersection points? (external intersection meaning if the point is not contained in the interior of the union of all the squares).
I'm having some difficulty with implementing a non-brute force algorithm for solving the following Problem. If I can get something even close to O(N^3) i'd be happy at this point. Auction: https://www.investopedia.com/terms/a/auctionmarket.asp I have an algorithm in place that can do a generic Auction (accumulating bid...
I want to search many times, not identical elements but similar, for something a similar image or fingerprint without having to search the whole space. When I have a 1D case I sort it first. For 2D I can make boxes big enough to be not wasted on boxes containing no elements, these boxes have subboxes and these have ele...
In class we saw examples of reductions like from Independent Set (IS) to Longest common subsequence (arbitrary number of sequences) (LCS) $V = \{v_1,\ldots,v_n\} E =\{ e_1,\ldots, e_m \}$ The reduction is $(G(V,E),k)$ to $\{S_0,S_1,\ldots, S_m\}$, where $e_k = (v_i,v_j)$ gives $S_k = \langle v_1v_2 \ldots v_{i-1}v_{i+1...
Given that $L = \lbrace 0^n1^n : n \geq 0\rbrace$ is a non-regular context-free language, prove that $\texttt{prefix}(L)$ is regular. So far I have provided that the grammar to produce this language is: $S \rightarrow 0S1 \thinspace | \thinspace \epsilon$ Would you go about proving $\texttt{prefix}(L)$ is regular just ...
ML-style languages have a concept of "extensible" or "open" sum types, where variants can be declared at any point, and there's not a fixed number of constructors for the type. They're usually used to model exceptions and handling, where users can declare their own exception types. I'm wondering, is there a way that we...
I have been toying around with the idea of creating a programming language as a side-project, specifically trying to get extreme performance out of a machine. I have been thinking about the efficiency-memory tradeoff, and was wondering if it would be at all possible to design a language which always uses a fixed amount...
I hope I am asking this on the right community. I am building an Artificial Intelligence to play the board game Pandemic. The AI uses a Monte Carlo algorithm. After implementing the game rules and the AI, it works as expected (very poorly, but it works). I figured the main problem the current algorithm has is the acti...
The world is 3D and data of it is usually (as far as I know) represented and processed with real numbers. I've seen very few cases where complex numbers are used in programming and none when it comes to processing anything that doesn't explicitly require complex numbers. How are complex numbers used it Computer Scienc...
I am trying to understand the HashTable open-addressing technique. I see there are three approaches: linear, quadratic and double hashing. I'm wondering are these techniques used: to find an index of the main array and no bucketing is involved or used when our buckets are arrays too and we are trying to add it to the ...
I’ve got a computer science school assignment which I can’t solve for the past week and it’s driving me crazy! I hope I’m posting this on the right board. I need to find the least amount of combinations in “not-so complex” data in php. The answer of course doesn’t have to be in php. Anything helps! PROBLEM DESCRIPTION:...
I'm refining my understanding of the connection between initial algebras and datatypes. This paper suggests that one could even represent the categories corresponding to datatypes definitions: as follows: Where $1$ is the terminal object of the category. My question is, how can I justify that $1$ is the terminal obje...
I came across this problem and have not been able to find a solution. Given directed graph $G$, devise an algorithm to find the minimum number of edges to flip/change/transplant such that the modified graph $G'$ has a path from any vertex to any other vertex. That is, we can remove any edge between any two vertices an...
I have two lines segment in 3D space. Lines segment are defined by 2 points each: $A_1$, $B_1$ and $A_2$, $B_2$ (see left part in the below schema). I would a like to find an algorithm to detect which portion of the line segment 1 has a distance less than or equal to $x$ to the line segment 2 (and the opposite). The ex...
I'm wondering in what direction we construct reductions to prove that a problem is NP-complete. Say the question is asking to prove that the vertex cover problem is NP-complete given that the independent set problem is NP-complete. In this case, do we start with an instance of the vertex cover problem and show how we ...
I have a set $S$ of $3m$ positive numbers $\{a_1,a_2,\ldots,a_{3m}\}$. The question is: can you select $m$ disjoint triples $(a_i,a_j,a_k)$ from $S$ such that $a_i-a_j-a_k\geq1$? I was trying to prove that this problem is NP-hard by a reduction from Numerical 3D matching (N3DM). Given an instance of N3DM; 3 sets $X$, ...
I am trying to determine the optimal value of k. I have used a graph to plot the SSE against the values of k. Using the elbow method, what would be the optimal value of k? I am unsure as to whether 7 or 8 would be most suitable because the line changes significantly at several points.
I came across a problem which I think can be reduced to the assignment problem/Hungarian algorithm. We have matrix $A$ and matrix $B$ which are both $n\times n$ symmetric matrices. We can rearrange $B$ in the following manner: column $i$ can be swapped with column $j$ provided that next, row $i$ is swapped with row $j$...
If $L_1$ and $L_2$ are both non-decidable languages (Not decidable, so can be SD or $\lnot$SD), is it possible that $L_1-L_2$ is regular and $L_1-L_2\neq\phi$, where $\phi$ is the empty set? What's a good way of tackling this question? Me and some classmates have been stuck on this question for a while, and this was t...
From Wikipedia: Even a degenerate tree (linked list) satisfies this condition if α=1, whereas an α=0.5 would only match almost complete binary trees. A binary search tree that is α-weight-balanced must also be α-height-balanced, that is height(tree) ≤ ⌊log1/α(size(tree))⌋ By contraposition, a tree that is not α-...
Here is Canadian Computing Competition 2019 Junior problem 5 on dmoj.ca. You can also see the original problem at cemc.uwaterloo.ca as well. A substitution rule describes how to take a sequence of symbols and convert it into a different sequence of symbols. For example, ABA→BBB, is a substitution rule which means that...
I was wondering, what is to be the shortest possible key using Vigenere encryption, if a text is ciphered one time with a key of length $i$ using Vigenere and second time with a key of length $j$ using Vigenere? From what I understand, each time it is encrypted, each character shifts using the first key and then using ...
The unweighted maximum coverage problem is defined as follows: Instance: A set $E = \{e_1,...,e_n\}$ and $m$ subsets of $E$, $S = \{S_1,...,S_m\}$. Objective: find a subset $S' \subseteq S$ such that $|S'| = k $ and the number of covered elements is maximized. The problem is NP-hard, but a simple greedy algorithm (at ...
I came across following regular expressions which equals $(a+b)^*$ (set of all strings on alphabet $\{a, b\}$): $(a^*+bb^*)^*$ $(a^*b+b^*a)^*$ $(a^*bb^*+b^*ab^*)^*(a^*b+b^*a)^*b^*a^*$ I want to generalise different ways in which we can append to original regular expression $(a+b)^*$, to not to change its meaning and ...
For example if I have an array [0, 1, 2, 3, 4, ..., n] and I want to iterate over it in an order like [0, n, 1, n - 1, 2, n - 2, ..., n // 2] how it can be called? Is there a general name for this?
We’ve all seen this: Can we get worse? Part 1: Can mathematical operations of increasing orders of growth be generated, with or without Knuth’s up-arrow notation? Part 2: If they can, can algorithms of arbitrary complexities be systematically generated? Part 3: If such algorithms can be generated, what about programs ...
Consider a sequence $s$ of $n$ integers (let's ignore the specifics of their representation and just suppose we can read, write and compare them in $O(1)$ time with arbitrary positions). Denote $\text{supp}(s) = \left\{ x \in \mathbb{N} \;|\; x \in s \right\}$, the support set for $s$. We are interested in obtaining a ...
We all know iterations and recursions are a powerful thing in programming. But this doubt always troubles me whenever I write an iteration or recursion. Can every recursive problem solved using iteration and vice-versa? We can avoid efficiency for simplicity. Only thing is is it possible for all?
If an optimization problem is mixed integer non-convex problem. The optimal solution by applying brute exhaustive search is infeasible to be applied in practice due to high complexity i.e. $O(N^K)$. Can we say that it's NP hard problem? If yes, can someone explain with more details.
The question is whether someone could provide an algorithm for finding all the partitions of a set S into subsets of fixed size (assume the fixed size is 2, to make things simpler, in which case the cardinality of S is even) which is iterative and not recursive and which runs in time proportional to the output (and pro...
Wikipedia defines halting set as follows: $H = \{(i, x) |$ program $i$ halts when run on input $x\}$ Ullman defines universal language as follows $U = \{(M, w) |$ Turing machine $M$ accepts $w\}$ This link says: The universal TM, $U$, is a TM which takes as input an encoded machine/string pair, $(M,w)$, and perfor...
I want to find two undecidable languages $A$ and $B$ that $A$ cannot mapping (i.e. many-one) reduce to $B$, $B$ cannot reduce to $A$. One of my thought is to let $A$ be the halting problem, let $B$ be some non-Turing-recognizable language, then it is clear that $B$ cannot reduce to $A$, but I don't know which $B$ can I...
Anyone know if an optimization variant of the 3-partition problem (as explained there) would also be strongly np-complete? This would be where the goal is to group a multiset whose size is evenly divisible by 3 into triplets that sum to as close to a target as possible and to produce this grouping. This would not be a ...
Let $H$ be a hypothesis class of multiclass predictors; namely, each $h\in H$ is a function from $X$ to $[k]$. Denote the Natarajan dimension of $H$ by $Ndim(H)$. Hope you can give me an intuitive proof of the following lemma . $|H|\le |X|^{Ndim(H)}\cdot k^{2Ndim(H)}$ The lemma is in the book "Understanding Machine Lea...
I'm new to Computer Organization and even to this community. I didn't find anything which was simple, clear and up to the point. Any examples supporting the discussion is appreciated. I'm not looking for some text book answer. Here's an example of my view to question: What is a Programmer's Model ? Programmer's model s...
I have a matrix that consists of 0, 1, 2. 0 - dot. 1 - block. 2 - start dot (initial position in the path). I have to create a path from the start dot, that connects all the dots in the matrix and visits each dot ONE time doesn't visit blocks In other words, create a Hamiltonian path in a matrix. A pic below exhaus...
I have found this problem on CodeForces.The problem is in the following link: https://codeforces.com/problemset/problem/729/C Problem Starts here: Vasya is currently at a car rental service, and he wants to reach cinema. The film he has bought a ticket for starts in t minutes. There is a straight road of length s from ...
No three distinct positive integers $a, b, c$ can satisfy the equation : $a^n + b^n=c^n$, if $n$ is an integer greater than two. The above statement, known as the Fermat's last theorem is proven with rigorous mathematics. I happened to stumble on one particular statement: Proofs were eventually found for all value...
I encountered this question while revising for my finals exam on database theory. The following database contains information about car repair workshops. The following tables are used: $$Workshop(\underline{rname})\\ Car(\underline{cname},make,model)\\ Repairs(\underline{rname,cname},price)$$ Given two workshops $W_1$...
Suppose I have a minimum spanning tree $T$ in a graph $G=(V,E)$ with positive edge weights $w$. Provide an algorithm that after adding a new edge $e$ with a unique weight $w(e)$ to $G$, returns true if $T$ will still be an MST.
I have downloaded the slides from the site: [Compliance and Violation Patterns It says No writes after calls. I can understand this concept. It’s a remedy for reentrancy problem. But it shows compliance and security patterns in some technical language related to Datalog or to some language related to software represent...
I have read in the book "Introduction to Algorithms", 3ed by Cormen, Leiserson, Rivest, and Stein (Chapter 20) that Emde Boas trees run min/max operations in $\mathcal{O}(1)$ time since the minimum and maximum element are stored as attributes in each tree. I don't understand this very well. Does this mean that the...
I was given the following regular language: For any $n$, the language $L_{n}$ consists of all words over $Σ = \{0, 1\}$ whose $n$th character from the end is 1. I know it's regular because it can be expressed as a regular expression ($\Sigma^{*}1\Sigma^{n-1}$), and I constructed a DFA and an NFA for it. I need to calcu...
I was learning about disambiguating grammars. In particular I was learning about enforcing right associativity on the sum language here: $$ \mathit{Sum} ::= 0 \mid 1 \mid \mathit{Sum} + \mathit{Sum} \mid ( \mathit{Sum} )$$ I think I understand the intuition that in a string like: $$ 0+1+0 $$ we want the 1 to be an argu...
Suppose $X=[0,1]$ and $Y=[0,1]$, and we use the squared loss Let's define the hypothesis class $H = {h(x) = (x-a)^2 : a \in [0,1]}$. Question: How can covering numbers be used to show that this class is agnostically PAC-learnable, and prove an upper bound on $|L_S(h) - L_D(h)|$, which holds simultaneously for all $h\in...
We are given a set of $n$ bits, call them $a_1$, $a_2$,...,$a_n$. We are also given a set of $m$ sums, where the sums $s_1$, $s_2$,...,$s_k$,...,$s_m$ are given as sums of some of the bits. For example: $$s_k = a_3 + a_5 + a_{17} + a_{22} + a_{35}$$ There is more structure to the sums, however. The sums are split int...
Regarding: delete a node from a linked list algorithm,in procedural languages with garbage-collection. Should there be a step in the algorithm, of setting the removed-node-next-pointer to null ? (Several high-school-CS-teachers in my area teach YES, while others teach NO) What is the right approach? /thanks ran
I was doing reading on weighted quick-union using path compression. I have a clear understanding of why this is $O(1)$ with amortized analysis for union and find operations but do not understand how to address this special case. Suppose we have $x$ items to start with, (all disjoint) and we perform a sequence of $m$ op...
I'm learning machine learning. VC dimension is a good way to measure the complexity of hypothesis class for binary classifier and has a very good intuitive explanation from shattering. When we discuss multi-class problems, we will use Natarajan dimension. I know that both dimensions are based on the "shattering" concep...
In 3 dimensional matching, we are given a set $M\subseteq X\times Y\times Z$ where $|X|=|Y|=|Z|=n$. A matching in $M$ is a subset $T⊆M$ such that no elements in $T$ agree in any coordinate. The goal is to find a matching in $M$ of size $n$. If we assume that $n\leq|M|=m<2n$, can we solve 3DM in polynomial-time? I know...
So, my professor asked me to implement recursion in different ways to compute $a^n$ (a and n being integers) and rank them according to their space efficiency. Now, here is one of the methods I came up with: int Power (int a, int n) { if ( n == 0 ) return 1; if ( n % 2 == 0) return Power(Power(a, n/2), 2); ...
The run time of binary search is O(log(n)). log(8) = 3 It takes 3 comparisons to decide if an array of 8 elements contains a given element. It takes 4 comparisons in the example below. python2.7 def binary_search(a_list, item, comparisons_inner=0): low = 0 high = len(a_list) - 1 while low <= high: ...
Coinduction is a logical principle that is somehow dual to induction. I'm struggling to understand it. Are there any interesting examples of coinduction in analysis? A few examples seem like they could be promising: the $p$-adic numbers can be represented as infinite streams in such a way that the arithmetic operation...
+---+------+------+ | | T1 | T2 | +---+------+------+ | 1 | W(A) | | | 2 | | R(A) | | 3 | W(A) | | | 4 | | R(A) | | 5 | W(A) | | | 6 | | W(A) | | 7 | W(A) | | | 8 | | W(A) | +---+------+------+ In the above scenario can someone tell me how many WW, WR, RW conflicts are the...
How many read and write ports in a register file? Moreover, what is the difference between a register and a register file?
I am looking to find a minimum list of cycles in a graph such that their union gives the list of all simple cycles in this graph. In the example below, here are 4 simple undirected cycles: 1-2-3, 2-3-4, 1-3-4-5 and 1-2-3-4-5. The last cycle does not add any further information about the cyclic structure of my graph tha...
I'm working on a school project that takes in a simple linear equation and has to return the value of $x$. The code I have transforms $x + 3 = 3x - 2$ into a binary tree format like so: = / \ / \ + - / \ / \ x 3 * 2 / \ 3 x With the expression in thi...
I was told there is a algorithm that always resolves ambiguity for grammars that have issues with precedence and associativity. I know ambiguity in general is undecidable, so I only want to resolve those two sources of ambiguity (precedence and associativity). As far as I know from reading this course, the heuristic I ...
Left quotient is defined as below at this link: Left quotient of $L1$ by $L2$: $L1\backslash L2:= \{u\in \Sigma^*|vu\in L1$ for some $v\in L2 \}$ Wikipedia defines it as follows: $L_1\backslash L_2=\{w|\exists x((x\in L_1)\wedge (xw\in L_2))\}$ Q1. I feel both definitions differ. Which one is correct? Also first li...
Why default TCP Maximum Segment Size is 536? If found this line in TCP/IP by behrouz forouzan
For all bit strings $x$, $y$ and Kolmogorov complexity $K$, is $K(xy) > K(x)$?
In Database System Concepts 6ed, 6.2 The Tuple Relational Calculus When we write a relational-algebra expression, we provide a sequence of procedures that generates the answer to our query. The tuple relational calculus, by contrast, is a nonprocedural query language. It describes the desired information without givin...
In Gonzalez et al it is mentioned that Tapered Quantization is I am unable to figure this thing out. I have searched the whole internet, but nothing of the same appears. I need a help in understanding this matter, and if you can provide a picture that will be really helpful.
Minimum number of bits required to represent $(+32)_{base10}$ and $(-32)_{base10}$ in signed two's compliment form? My attempt: 32 = 0100000 ( 1st zero - sign bit as positive) So to represent +32 we need 7 bits -32 = 1100000 (1st bit 1 - sign bit as negative) So to represent -32 we need 7 bits But answer is given a...
I can't understand why we are setting the D(0,0) to 0 in the alignment matrix when we are running the algorithms for minimum distance like the Levencthein algorithm?
We are given postorder traversal of a Binary "SEARCH" Tree (in an array) and we want to find (print) its preorder traversal. A very naive solution is to check from end until we find element less than root so we can find left and right subtree and call the function on them. This is $O(n^2)$. Another way is to generate t...
I'm reading through sipser and there is a lot of computability problems that the halting problem reduces to, i.e. if $A_{TM} = \{\langle M,w\rangle : M$ accepts input $w\}$ then $A_{TM} \leq P$ where P is some other language, but is there an example of another language that reduces to $A_{TM}$ (i.e if we could decide $...
I am wondering whether timestamp can be used to solve process synchronization problem, when race condition occurs? Below is an algorithm for entry as well as exit sections for every process who wants to enter in critical section. Entry section uses FCFS (First Come First Serve) technique to give access to critical sect...