instruction
stringlengths
35
29.1k
In our class the following exercises/examples were given: Compute/find $n_0$ and c from the formal definition of each Landau symbol to show that: $n^{2/3} \in \Omega(log^8(n))$. Then in the Solution the following was done: $n_0=1$ and $c=(\frac{1}{12})^8$. Show: for each $n>n_0: n^{2/3} \ge c \cdot log^8(n)$. $n^{2/3}=...
If $RA$ is context-free for a regular language R, is $A$ context-free? I think this statement is true. Let G be the CFG given by the rules $S_0\mapsto LA_1, S\mapsto LA_1, A_1\mapsto SA_2 | RS | 1, A_2\mapsto RS | 1, L\mapsto 0, R\mapsto 1$, where $S_0$ is the start symbol. How would one modify G to get a CFG that ge...
I was wondering how to determine (with proof) whether the context-free language generated by the following context-free grammar $G$ is regular, where $S$ is the start variable and $a$, $b$ are the non-terminals. $G:\ S\to aABb,\ A\to BAS \mid\epsilon,\ B\to a \mid b.$ It doesn't seem easy to determine exactly what se...
if two vectors are used for ex, vector<vector> temp; vector temp2; then what will be the space complexity, will it be O(n) or O(n^2)?
I'm designing an expression language that's trying to (a) be maximally compatible with a different ambiguous language; and (b) be LR(1). I'm facing the current fragment of the language: $$ \begin{align} S & → T \quad | \quad \texttt{prefix} \quad T \quad S \\ T & → F \quad | \quad T \texttt{-} F \quad | \quad \texttt{-...
I have just learnt about some typical result of fine-grained hardness in 15-455 by Prof Ryan: CNF-SETH implies ${\sf DIAMETER} \notin {\sf TIME}(mn^{1-\epsilon})$. (Here DIAMETER stands for the graph diameter problem). To prove fine-grained hardness, we construct reductions from $A$ to $B$, then "perturbation" on $A$'s...
Consider the following scenario. Let $x_1,...,x_n$ be a group of cars that all drive from some point A to some point B. Each car starts driving in index order. i.e. $x_1$ starts driving strictly before $x_2$ and so on. i.e. Each $x_i$ starts driving strictly before $x_j$ for any $j > i$. We also have a set of facts $Y$...
While I understand the process of considering/observing an algorithm and finding an average time, necessary to perform an operation that happens in this algorithm, I still cannot quite gasp the idea, or rather the expression: "The Algorithm has an amortized time complexity which is cost./linear etc". What to understand...
Are there any NP-complete problems where the fastest known algorithm solves the problem in superexponential time (like $O(n!)$ time)? Every NP-complete problem that I am aware of has fastest known algorithms that are all exponential time, but it is not obvious to me whether there is anything preventing such problems f...
I am a student who is currently finishing second year of university mathematics. This summer I have to choose a topic for my diploma. Because I am particularly interested in computer science I am seriously considering choosing a topic about programming language theory. But I have one problem - I will be taking a course...
Can anyone help me figure out the error in my approach to this problem from Sipser 1.18 (1.6f)? Write a regular expression for the language L = {w | w does not contain 110} So, the answer I get is: $(0 \cup 10)^* (1 \cup 111^* \cup \epsilon)$ And the answer given is: $(0 \cup (10)^*)^*1^*$
Consider two finite languages, $L_A$ over alphabet $A$ and $L_B$ over alphabet $B$. $A$ might be the same as $B$. Since $L_A$ and $L_B$ are finite languages, there exist minimal acyclic deterministic finite-state automata to decide them: $M_A$ and $M_B$ respectively. So $x \in L_A$ iff $M_A$ accepts $x$, and $y \in L_B...
I get that the argument for this set $\{ w \in \Sigma^* : M_w[\epsilon]\downarrow \land |w| \leq 7\}$ to be decidable is that $|w|\leq7$ meaning it is a finite set and therefore it can be decided. But my problem is that for each of the $w$ it could be the case that one has to wait an infinite amount of time in order t...
Why there is no final state for a transition system? And why do NFA and DFA have final states? The transition system may or may not have any terminal states, but NFA/DFA has at least one final state (for describing its language). I just want to know about the basics. Can I call a DFA a transition system (because DFA is...
In Robert Lafore's book "Object Oriented Programming in C++, Fourth Edition", on page 450, he has a section on the bubble sort. The way he describes it is as follows: Here's how it works, assuming we want to arrange the numbers in the array in ascending order. First the first element of the array (arr[0]) is compared ...
The complexity book by Arora and Barak mentions that "branching programs of constant width (reminiscent of a TM with O(1) bits of memory) seem inherently weak." I am not able to figure out how both are connected. Can anyone here shed a light on this?
Consider a 2-dimensional version of generating points in the circumference of a unit radius circle, independently generate each coordinate uniformly at random from the interval [-1,1]. How to generate a random point in a higher dimension? High level idea is also welcomed. If we try to extend the above idea (2-dimension...
I have read this question on compile time gc and what I understand from it is that the compiler wouldn't know if a variable is referenced or not by some other object due to conditional statements (because they are computed at runtime), and that is why runtime GCs are used, as they can dynamically check if a variable is...
I have a pubsub channel where an event is fired every time a user logs in, and I want to be able to query the unique users in a date range. Solutions I thought: Put the data in bigquery, and then use APPROX_COUNT_DISTINCT, but it's too expensive Same as above, plus a cache. Past data doesn't change, so it's a good app...
Prove that there does not exist a Turing machine M such that for every Turing machine K that halts on all inputs, $M$ accepts $\langle K\rangle$ if and only if $L(K)$ is infinite. The above question came from a set of final practice problems for a computability course. Suppose such a Turing machine M exists. Maybe ...
I know that whenever click on .exe, it will be moved into RAM so cpu can execute machine code line by line. But what if .exe is bigger than RAM? for eg: I play games which take up more space than my RAM. My RAM is 8gb, but i can still play them. How's that possible
In the chapter on space complexity in "Computational Complexity: A conceptual perspective" by Goldreich, it is stated (ch 5.1.2, p 146): It is tempting to say that sub-logarithmic space machines are not more useful than constant space machines, because it seems impossible to allocate a sub-logarithmic amount of space....
I'm searching for the generic name of an algorithm/method that would allow me to solve this type of problem efficiently. I have a continuous line which I traverse, from one side to the other. Along that line are buckets, placed at various positions which have a given size. Along the line are also items that I have to p...
Is it true that if a given DFA $M = \langle Q, \Sigma, \delta, q_0, F\rangle$ with $|Q| = n$ accepts all strings $w \in \Sigma^*$ such that $|w|\leq 2n$ then it accepts any $w \in \Sigma^*$ ?
I am reading a research paper in which following equation is given: $\underset{\small{X}\\\text{s.t}\sum_{(i,k)\in \mathcal{A}}x_{ik}=1, \forall i\in \mathcal{M}}{\operatorname{max}} u$ where $\small{X}$ is a binary variable that collects all $x_{i,k}$ $\mathcal{M}$ is a set of clients and say its elements are $\mathca...
If I'm given a minimum spanning tree, my understanding is that it is a structure that connects all nodes to each other through some path, and that the overall weight of the tree is smallest. However, does this necessarily imply that for any 2 nodes V1 and V2 in the MST, that the path between V1 and V2 is definitely the...
In a Talk by Herb Sutter C++ and Beyond 2012: Herb Sutter - atomic Weapons 1 of 2 at 46:30 the point is made that only around 15% of the physical space (or the transistors) on a CPU do actual processing while the rest is basically just caches. Further it is mentioned that of those 15%, only around 1% account for actual...
How many page faults are there in the following accesses of pages in case of FIFO mechanism where page frame size is 8? $$11,21,23,53,8,7,10,3,3,38,3,37,7$$ Soln: This question appeared in one of my the entrance tests for a company and I am pretty sure I got it right but there was no option matching what I had thought....
Source: https://oj.vnoi.info/problem/cryptkey (problem statements are in Vietnamese, so here it is translated). There is a set $S$ of positive integers. If $A$ and $B$ are in $S$, then $\gcd(A, B)$ and $\text{lcm}(A, B)$ are also in $S$. You are given $n$ positive integers $a_1$, $a_2$, ..., $a_n$, which are elements...
Background: I'm working on a data structure benchmark tool to benchmark insert and search time and I am trying to improve my own implementation of a BST to support parallelism. I have implemented a Binary Search Tree, it is a very basic (naive) tree structure: class Node: Node? right; Node? left; long value; ...
A sparse 1D array of integers is commonly encoded as pairs of [index, value], which consumes 2 memory spots per value. A dense 1D array is commonly encoded as a linear array of values [value1, value2, ..., valueN], consecutive in memory. If an array is encoded as a sparse array, but grows in density, until it becomes d...
I'm trying to sort the elements of a set of "goal" stacks to minimize the number of pushes/pops to reach each state. The inputs and outputs can be some other structure rather than stacks, they just represent a target state of the stack. Each goal must be reached in the order given in the input. For example, given this ...
I was reading a textbook on COA, it says If the processor is going to ignore the interrupt request line till the execution of the first instruction of the ISR, how will it know which device to service? I mean the processor is ignoring the interrupt requests so how does it acknowledge the request in the first place?
I want to find the maximum possible value of an unknown function on a rectangle. What is the optimal method of doing this? Do I need to use simulated annealing?
I am interested in understanding what we mean by a von Neumann architecture and need something at a very introductory level. Does anyone know of any good and readable references or notes that will introduce me to this topic?
Are there systems in computer science where we have several logic systems working all at once and without isolation? I am thinking there are system where subsystem A uses Paraconsistent logic, subsystem B uses Four-valued logic, and subsystem C uses ordinary logic, but the elements inside those subsystem don't interact...
I'm trying to identify an algorithm to solve this computational problem Input: Bipartite graph (V, W, E), with E ⊆ V×W A fixed order for both V and W: V = (v1, ..., vn) and W = (w1, ..., wm) Output: The subset of E of maximum cardinality in which there are no crossing edges. The mental image is that the two vertex ...
I have to make an application as my Parallel Computing university course project. The application should make use of parallel processing. Any ideas or examples for these kinds of applications ??
Preparing for my finals in my "advances algorithms" course. Usually there is a question to prove one of the theorems that was given over the course. I'm currently trying to write a full proof of the following statement: Self-organizing list that uses Move-to-Front is 2-Competitive. For the completeness of the questio...
I have a project to match two groups of people. Under insurance, if the initial sales agent leaves the insurer, their customers will become so-called “orphan customers”. I've given a big data set containing 100,000 customers with matched agencies (13k agencies in total), for each customer and each agency, it provides ...
Let $T$ be a hexagonal tiling of the plane and assume we are given a simple polygon $P$ (we define $P$ as the union of the points on its boundary and its interior). The task is to find the subset of $T$ that intersects $P$ as fast as possible. We can assume that the diameter of the hexagons are some fixed constant $c$,...
I am working through Sipser, and have come accross the following claim, "any $f(n)$ space bounded Turing machine also runs in time $2^{O(f(n))}$", which can be proven by looking at the upper bound on the number of configurations a Turing machine that uses space $f(n)$ can take. An implication of this claim is that a $...
First Few Iterations of the Algorithm We have an algorithm in which a squirrel visits the nodes of a directed graph. Our graph has two colors of edges: black and white. Initially, the graph has black edges only, and no white edges. The squirrel never changes the color of an edge from black to white. The squirrel simply...
I have a problem that consists of finding a good solution for a graph that has vertex weights (and this cost is the highest priority), but also has edge costs.
Various computational hierarchies describes the relative expressivity of different classes of languages, machines, or other models of computing, with the classic progression for Automata Theory [0] being: Deterministic Finite Automata (DFA) < Push-Down Automata (PDA) < Turing Machines (TM). These correspond to the foll...
From what I understand, LL and LR parsing require a grammar to be in "canonical form", i.e. only productions of the form A -> b1 b2 ... bn, where b1, ..., bn are either a terminal or a nonterminal. To express alternation, one would add multiple productions with the same LHS. However, some EBNF expressions would require...
The Church-Rosser Theorem [0] states that the Lambda Calculus (LC) is confluent: between a source expression S and target expression T, the latter in normal form, for any given P, a sequence of permissible reductions that begins with S, there is some subsequent sequence of reductions Q (possibly the empty sequence) tha...
monitor DiningPhilosophers { enum {THINKING, HUNGRY, EATING} state[5]; condition self[5]; void pickup(int i) { state[i] = HUNGRY; test(i); if (state[i] != EATING) self[i].wait(); } void putdown(int i) { state[i] = THINKING; test((i + 4) % 5); test((i + 1) % 5); } void test(int i) { if ((state[(i + ...
Let's say I have a optimization problem P1, where the constraints are linear but the objective function is not. Let's say I have another optimization problem which is linear in constraints and linear in the objective function. The goal of the problem is to show that if P1 has a bounded optimum value then P2 has the sam...
(larger context at the end) My view of the problem I have an undirected graph whose nodes can be categorized into three classes depending on some metadata (I have a function that can tell me the class of a node in constant time), let's name the classes $A$, $B$ and $C$. I want to find an $A$ node and a $C$ node such th...
I've heard it said that "fortran uses column-major ordering because it's faster" but I'm not sure that's true. Certainly, matching column-major data to a column-major implementation will outperform a mixed setup, but I'm curious if there's any absolute reason to prefer row- or column-major ordering. To illustrate the i...
I have a question : is the term front-end in this context phpmyadmin is frontend for mysql slang is it taught in academy in this context I don't want to use slang term
Are there any problems which are known to be both NP-complete and EXPTIME-compelte? My guess is no, because we know that $P$ is not equal to $EXPTIME$ and EXPTIME-complete problems are not in $P$, and hence a problem that was both NP-complete and EXPTIME-complete would imply $P \not= NP$. Is my thinking correct? Note...
Task Build the Parse Table Let $\mathcal{G}$ be the following context-free grammar: $$ \begin{aligned} E &\to TE' \\ E' &\to +TE'\; |\; \epsilon \\ T &\to F T' \; \\ T' &\to *FT'|\;\;\epsilon \\F &\to (E)\; | \;id \\ \end{aligned} $$ I calculated $ FIRST $ and $ FOLLOW $ sets \begin{aligned} FIRST(F) = FIRST(T) = FI...
I am reading a book about data architecture, and I am wondering about the text segment and the memory adresses. In one example(assembly using ARM) where the code was compiled there were adresses to global variables. Does this mean that the executable is always loaded in the same place in the text segment?, so that the ...
Let A[1...n] be an array of n distinct numbers. The ordering of the numbers is any permutation of [1,2,...,n]. An array Inv_A is defined as follows: Inv_A[i] = number of elements A[j] such that j<i and A[j] > A[i]. Give an optimal algorithm that computes the above array Inv_A. For example if A = [3,1,4,5,2] then Inv_A ...
Given the following: A set of input types $I$ = {a, b, d, ...} A set of functions $F$ (With associated costs, and possibly identical signatures) = {($c_1$, a -> d), ($c_2$, (a,b) -> e), ($c_3$, e -> (d,f)), ...} A set of desired output types $O$ = {f, g, h, ...} I would like to build a system that can return the lowe...
While studying Shannon's notion of perfect secrecy I came upon the idea that a bit is perfectly random if it happens to be 0 or 1 with an equal probability. What does this mean? Also, what can we say about the determinism here?
Given a set of nodes $N$ on an undirected, weighted graph $G$ and a query node $n$, what is the fastest algorithm for finding the node in $N$ that is closest to $n$? Furthermore, say we are doing many of these queries, so have many $n$'s, is there some data structure that could speed up this computation? Thank you for ...
Given two strings ABC and CBA, find A, B and C. Input: abcacab, cabcaab Output: ab, ca, cab The time complexity of brute force is O(n^3). Are there any better algorithms to solve this problem? Thanks!
My algorithm homework revolves around matching 4 "O"'s or 4 "X"'s on a diagonal, horizontal, or vertical. Hopefully that makes sense... This is what the data looks like below (2D tuples) where I need to recreate a function that returns "O" or "X" or False depending on what is found. xwins = ((None, None, None, None, No...
I was reading the proof of time-complexity for the Edmonds-Karp algorithm here (https://brilliant.org/wiki/edmonds-karp-algorithm/). Everything in the first part of the proof (The section Monotonically increasing path length) makes sense. However, the last part of it is not very convincing (the part I have highlighted ...
Let's say we want to find the smallest positive integer x for which some property A holds. We know that such an integer exists. However, we have no knowledge about the scale of x (i.e. x could be 7 or 5'142 or 17 Quadrillion or whatever). We have a function f that returns true when evaluated at values larger or equal t...
Suppose I have a Turing machine that takes as input any string of length $n$, where $n$ is odd, and the Turing machine returns the middle character of the string. What time complexity class is this in? Is it in $O(n)$ because the tape head must scan $n/2$ places to the right, counting as it goes, or is there a quicker...
I want to know the major methods to prove the correctness of a program/algorithm. Recommendations on books are appreciated too. This is a general question. TIA. Edit: I'm not looking to detailed answer of each and every method. Instead, solicit recommendations/topics to start reading up my own. Name-dropping of methods...
I want to solve a problem of object tracking along time. The problem is - I have a sequence of images, and I need to find and track the creation of the objects, than their movement, and than their disappearance. There can be up to 3 objects overall, and sometimes there are less, or none. Another limitation is that for ...
The MIU system, famous from Douglas Hofstadter, is a semi-thue system with the following rules: Xi → Xiu mX → mXX XiiiY → XuY XuuY → XY and a start axiom "mi" I have tried to find a formal grammar that generates all words that can be derived from the semi-thue system, but did not succeed. Is there a canonical way to co...
I am looking for elementary cellular automata rules and initial conditions that give rise to interesting cycles (Cyclic boundary conditions, such that the leftmost entry is the neighbour of the rightmost entry). After running a rule with some starting state, the state of the CA might (will?) start repeating in "cycles"...
I'm doing an exercise about the MIPS pipeline with the following characteristics: -Branches and Branch targets are calculated in the E-stage. -There is forward logic from the output to the input of the E-stage. -You can read an operand from the register file only the cycle after it has been written to it. The task is t...
I don’t understand this state diagram. What if $n=0$? Then our input string is the empty string. We begin at $q_1$, push \$ onto the string, move to $q_2$ but then fail. So the language recognized by this PDA is $n \geq 1$. If, however, we change the label on the vertical arrow to $\varepsilon, \varepsilon \rightarrow...
For now, assume that P != NP. Is there a "complete" class of problems between P and NP-hard, and if so, what is it called? The two key words here are between complete By between, I mean that it runs in super-polynomial time (not in P), but sub-exponential time (NP-hard is believed to take exponential time or greater)...
I have been trying to solve questions like this before but I have stumbled in difficulty to track the the space of the cache. so there is an example of a question like this: Given the code: int A[1024,1024],B[1024,1024],C[1024,1024] for(int i=0;i<1024;i++){ for(int j=0;j<1024;j++){ for(int k=0;k<1024;k++...
I have one LP problem (LP1) to solve, where a term in a constraint is to be substituted after solving another LP problem (LP2) (with a different variable vector). Suppose I call the dimension of the variable vector in LP1 as $n$ and in LP2 as $m$. I know that the complexity of solving an LP problem is $O(n^3L)$ ($L$ is...
I am currently reading up about esoteric programming languages and came across a COS theory question stated as follows: Esoteric programming languages can be categorised in a variety of different ways. For each of the following categories identify one advantage and one disadvantage associated with languages falling wi...
Given vectors $A, B \in \mathbb{R}^{n}$, $w \in [0,1]$ and $x \in \mathbb{R}$, let $$ Rank(A,B,w,x)=\sum_{i=1}^{n} \boldsymbol 1 \{w A_{i} +(1-w) B_{i} < x\} $$ denote the number of elements in the $w$-weighted convex combination of $A$ and $B$ that are smaller than $x$. I would like to compute $Rank(A,B,w,x)$ for diff...
Given two players $A, B$ and some natural number $n \ge 2$, let $\#(A,B,n)$ denote the following algorithm: $A$ thinks of some number $a \in \{1,\ldots,n\}$ Until the game ends: $B$ thinks of some number $b \in \{1,\ldots,n\}$ $B$ tells $b$ to $A$ If $a = b$ then the game ends Is there a way to represent this algor...
The complete question is as follows: An edge of a flow network is called critical if decreasing the capacity of this edge results in a decrease in the maximum flow. Give an efficient algorithm that finds a critical edge in a network. I believe some variation of Ford-Fulkerson would have to be used over here, however ...
I have searched around for some time but couldn't find a similar example to my problem. It looks common enough that I would expect it to be solved. It lies between search and optimization/regression. The goal is to find a range of values for each feature, so that the subset of rows where every feature falls in the corr...
Suppose that you were writing down the syntax rules for something like C++ as a context-free grammar in Backus–Naur Normal Form How can you distinguish between the pipe character as symbol in C++ or as a Backus–Naur symbol? Equivalently, how would you tell whether the | character represented a meta-logical operator or ...
Suppose that you were reading some production rules for a context-free grammar in Backus–Naur Normal Form What does the asterisk (*) mean? In the example below, what is the difference between <fun-def*> and <fun-def>? <program> ::= <fun-def*> int main(void) { <block> } <block> ::= { <var-def*> <statement*> } <fun-def...
I'm really having rough time understanding the time complexities of nested loops. So, please help me out in this code. The code is on sliding window with changing length: def smallest_subarray_sum(s, arr): window_sum = 0 min_length = math.inf window_start = 0 for window_end in range(0, len(arr)): ...
Let $k,n \in \mathbb{N} $ and non empty sets $X_1, X_2, \dots, X_n \subseteq \{1,2,\dots,k\}$. Define the change counting cost function $f: X_1 \times X_2 \times \dots \times X_n \to \mathbb{N}$ by $f(x_1, x_2, \dots, x_n) = \sum_{i=2}^n\delta(i)$ where $\delta(i) = 1$ if $x_i \neq x_{i-1}$ and otherwise $0$ How can we...
In any given year,a male automobile insurance policyholder make a claim with probability $p_m$ and a female automobile insurance policy holder will make a claim with a probability $p_f$ where $p_f \not= p_m$. The fraction of the automobile insurance policyholders that are male is $\alpha, 0 < \alpha < 1. $ A automobil...
Given an optimization problem $P$, if we know that this optimization problem is NP-hard, is it necessary to check the complexity of the corresponding feasibility problem, i.e. the complexity of checking if the problem admits a feasible solution? Because in the case of $P$ the problem is not always feasible.
Assuming we are observing an algorithm.I am confused as to how one needs to proof correctness. What exactly the correctness represent for a given algorithm? And why do we have to proof correctness, in case, correctness itself describes or points out that the algorithm does exactly what we want it to do. Basically the w...
(from 'An Introduction to Formal Languages and Automata' by Peter Linz) What I do not understand, is why we have done our best to make sure that the condition (8.2) holds. Why is this restriction important/useful?
Suppose given two $n$ bits numbers $A$ and $B$. Also suppose there is a machine that compute multiply two $\sqrt{n}$ bits numbers in $O(1)$. What is time complexity of multiplying two $n$ bits number in a such case? I think we can use divide and conquer Karatsuba algorithm such that our recursion tree will has heigh...
In one of my lessons about turing machines I have been taught that the function g is not computable: \begin{cases}g(n)=f_{n}(n)+1 & \text { if } f_{n}(n) \text { is defined } \\ g(n)=1 & \text { if } f_{n}(n) \text { is undefined }\end{cases} Proof: If $g$ is computable, then it can be computed by some Turing machine....
I understand that total inversion in a sequence is the number of swaps that need to be done, to sort the sequence. And the best approach to solve this problem is to count swaps in a merge sort of the sequence. Now I can think of another problem whose application I need. Imagine I have two unsorted sequences with permut...
I'm trying to understand whether integers are an abstract data type. The Wikipedia article starts out by saying that integers are not an ADT: In practice, many common data types are not ADTs, as the abstraction is not perfect, and users must be aware of issues like arithmetic overflow that are due to the representatio...
(Note: cross-listed on stack overflow: https://stackoverflow.com/questions/73362856/looking-for-name-of-a-priority-queue-data-structure-based-on-bit-boundary-bucket) I'm looking for the name of a data structure. I came up with this idea but suspect it should already be known, and don't know what to search to find it. T...
I'm writing a DFA minimizer using Hopcroft's algorithm. While testing some regular expressions, I came out with an issue in the algorithm's output relative to two particular regular expressions: a(b|c)* a(b|c*) P.S.: the assumption is that both regular expressions are valid, but if that's not the case please let me k...
Schaefer proved that deciding even cycles cover ( 2-factor with even cycles) in cubic graphs is NP-complete. I am interested in the complexity of odd cycles cover in cubic graphs. Is it NP-complete? Is it polynomial time solvable? P.S. Cycle cover is a set of vertex disjoint cycles that cover all nodes such that each ...
In this question it is stated that a CRC detects burst errors of length greater than the CRC length with probability $1-2^{-r}$, where $r$ is the length of the CRC. Why is there no dependence on the length of the burst?
Consider an algorithm $f(x)$. Are there formal systems or programming languages that only allow $f(x)$ to be defined if $f^-1(x)$ exists?
I am struggling to wrap my head around this compiler technique, so let's say here's my factorial function def factorial(value: int) -> int: if value == 0: return 1 else: return factorial(value-1) * value It is recursive, but not TCO friendly yet, so, as the theory goes, the first thing to try h...
I am bit confused while reading a standard textbook of my curriculum, where it is mention time complexity for knapsack problem is O(nlogn), and rationale they provided is we need O(n) to calculate (value/weight) value for each weight provided and next we need to sort it using O(nlogn) using any standard sorting algorit...
Let $a_i$, $b_i$, etc., be a literal, i.e., a variable or the negation of a variable. 3-SAT concerns formulas in CNF form: $(a_1 \vee a_2 \vee a_3) \wedge \dots \wedge (b_1 \vee b_2 \vee b_3)$ (3-CNF). The problem of whether or not such a formula has an assignment of its Boolean variables such that it evaluates to $1$...
We are given $k$ segments $(s_1,e_1),(s_2,e_2),(s_3,e_4),...,(s_k,e_k)$ where $s_i\le e_i$. Now we are given a query interval $[L,R]$ to find the largest segment $(s_i,e_i)$ contained within $[L,R]$. By the term largest we mean among all the segments contained within $[L,R]$ return the one whose $e_i-s_i$ is maximum. A...
Exam Question: A five-stage pipeline has stage delays of 150,120,150,160 and 140 nanoseconds. The registers that are used between the pipeline stages have a delay of 5 nanoseconds each. The total time to execute 100 independent instructions on this pipeline, assuming there are no pipeline stalls, is _______ nanoseconds...