instruction
stringlengths
35
29.1k
I have been researching threading and come across several websites which all say contradicting statements about which and how many thread models exist. Some websites say there are only three: 1:1, M:1 and M:M, while others say the three are 1:1, M:1 and hybrid (M:N). Still others say there are four types, including 2-l...
I have a little doubt about Chan's algorithm. From Wikipedia's description we see that the second phase of an algorithm works with $K = \mathrm{ceil}(\frac{n}{m})$ subsets $Q_i$. The goal of the second phase is to compute $m$ points $\{p_1 ... p_K\}$. On $i$-th iteration the candidate $p_i$ is chosen among $\{q_1 ... ...
I have a variant of Insertion sort (recursive version) that we call split insertion sort because there are two kinds of input. The input array has both numbers and alphabets, hence we have to sort them as two different arrays one for numbers and other one for alphabets. What would be the recurrence equatiuon for this v...
I'd like to measure how different two HTML files are from each other. I refer to the following scenario: User A visits a website, let's call the website example.com User A shares the website with User B User B visits the shared website User A and User B have installed an add-on that each sends the visited web pages as...
I read k-Sum $k \geq 3$ can be solved in $\approx O(n^{k/2})$ If this is right, why do not have a subset sum solver with a time complexity $O(2^{n/4})$ or better? That is, enumerating all the subsets from 4 splits, then apply 4-sum to find if some of the four partial lists add up to the target value?
I have the language $$L = \{a^mb^nc^o| \, m + n + o > 5\}$$ where $m,n,o$ are non-negative integers. I have to find whether the language is regular or not. My attempt: I feel it should be non regular. For it to be regular, we'd have to keep track of how many $a's$, $b's$ and $c's$ we have seen. But the problem is that ...
I know the answer that it will be 1024(2^10). But iam not able to understand why, I have looked the answer but still don't find it compelling My reason, it says ten if are there in the language and since it follows the given grammar then the program having 10 'if' should be generated by it, which can be but in my o...
I'm working with Turing's paradigm to prove termination of programs by annotating functions with ranking functions and I encounter the following example: def zeros: Stream[Int] = 0 #:: zeros This is Scala syntax for contructing a stream made of an infinite number of zeros. In this case, the evaluation terminates but t...
Why is this sort algorithm correct? Many thanks! Task: Suppose all elements in an array with length $n = 2^m$ are in descending order: $a_1 > a_2 > ... > a_n$, we need to turn them into ascending order. Algorithm: For each step from $1$ to $m$: Swap each adjacent (odd index, even index) pair into ascending order, so ...
In computational machine learning, the notion of Probably Approximately Correct means that (generally speaking) we can find (or "learn") with a high probability a function which has "low error". Is there a way to generalize this idea for approximation algorithms? What I thought of: Given a language $L \subseteq \{0,1\}...
Background I have a list of 50 million $A-A_i$ pairs, where $i>1$, and $A$ and $A_i$ are some text. I need to extract the $A$ values from the list, so I get a new list of unique $A$ values.: $$ \text{New List}= \{A, B, C, ...\} $$ Here is a generic illustration of what the list of pairs looks like: list of pairs = [['A...
Let's say I have a simple graph G with an edge set E, vertex set V, and at least 1 cycle. We can determine the number of spanning trees in this graph by finding its graph Laplacian matrix, striking out one row and column, and then taking the determinant of that sub-matrix. Let's call that determinant t (i.e. there are ...
From the problem, count the number of ways to fill a binary string of length $N$ with at least one $1$'s consecutive sequence of length $K$ and other $1$'s consecutive sequences have length no more than $K$. For $N \le 2\times 10^6$, my approach is to using DP. dp[N][K][2] is the number of ways to fill string of length...
I am interested to know whether the time complexity of following algorithm is $O(n^2)$ or $O(n\log n)$. Here is the implementation: public class HelloWorld { public static void main(String[] args) { Hello hw = new Hello(); int[] n = {2,3,4,52,5,63,0,664,2,2,56,68,8}; hw.sortUsingDLLWODup(n); } } publ...
Has anyone ever come up with a grammar that only induces invertible functions, and does so in a way where it is possible to algorithmically construct the inverse function? It could be useful for automatically creating the deserialization of a bitstring after the serialization has been defined, or other things like tha...
Given $L_1, L_2 \in \mathsf{NP}$, $L_1 \cup L_2 \in \mathsf{P}$ and $L_1 \cap L_2 \in \mathsf{P}$, Prove: $\ L_1, L_2 \in \mathsf{coNP}$ What I've done so far is: $$ L_1 \cup L_2 \in \mathsf{P} \Rightarrow (L_1 \cup L_2) ^\complement \in \mathsf{P} \Rightarrow L_1^\complement \cap L_2^\complement \in \mathsf{P} $$ ...
It seems that the standard reduction method you see online from 3SAT to 4SAT is that we let $\phi = (a \lor b \lor c)$ be a 3SAT clause, and so there is an assignment that satisfies $\phi$ iff $\phi' = (a \lor b \lor c \lor z) \land (a \lor b \lor c \lor \neg z)$ is also satisfiable. Is it just as valid to say that $(a...
Here is the excerpt from the linear probing page at Wikipedia. To search for a given key x, the cells of T are examined, beginning with the cell at index h(x) (where h is the hash function) and continuing to the adjacent cells h(x) + 1, h(x) + 2, ..., until finding either an empty cell or a cell whose stored key is x....
Suppose a processor does not have any stack pointer registers, which of the following statements is true? It cannot have subroutine call instruction It cannot have nested subroutines call Interrupts are not possible All subroutine calls and interrupts are possible ===============================================...
consider this question of finding words with no self embedded nonterminal in their derivation. The author(cohen) says that If CFG is in CNF then all the words with length greater than 2^p are guaranteed to have self embedded nonterminal. So, all i need to do to solve these questions is to consider words that have leng...
I am aware that multiprocessor systems often implement simultaneous multithreading in order to allow multiple threads to run on different CPUs. I am also aware that uni-core systems often implement temporal multithreading (fine-grained/preemptive or coarse-grained/cooperative) to allow for a more efficient use of the C...
this is related to the following question: Generalised 3SUM (k-SUM) problem? Without loss of generality, let's only consider even $k$, or just $k=4$. My question is, after summing all pairs of numbers, is it necessary to sort the list of sums? I understand we could use two pointers from left and right to sandwich the t...
I want to find the most optimal algorithm for finding closest ordered pairs and link them. For example: Go thru the vector, one by one For each one set the next according to a set of various conditions For example, something like: A B X C Y Z D First we will link A to B Then when we have a look at B, we will link B to ...
I encountered this result when working with $\lambda$-calculus (so every element I mention here was a $\lambda$-expression there [1]), but I will express everything with, more understandable to broader audience, notions of functions. Intro Definition 1 A numeral system is a sequence $d = d_0,d_1,\ldots$ such that there...
I wanted to know is there any algorithm / function / process through which I can calculate square root of a very large integer number. I wants to know current state of the research in this field. No approximate methods please.
I am interested in a simple variant of the quadratic knapsack problem. Let $\{w_1, \ldots, w_n\} \in \{0,1\}$ be $n$ weights and $\{v_1, \ldots, v_n\} \in \mathbb{R}$ be $n$ values. Furthermore, assume $h$ is a fixed integer such that $n \geq h \geq \left \lfloor \frac{n+1}{2} \right \rfloor$ . Consider the following p...
I have the two LTS (labeled transition system) as seen in the following picture: And the book is telling me that between those two LTS, their $1$ and $1'$ are non-bisimilar. So I tried to get a bisimilation starting from the pair $\{\{1,1'\}\}$ by continuously extending it whenever I found a conflict, ending up with: ...
I'm trying to derive the optimization objective for an SVM (namely $1/\|w\|$), but I'm running into a little trouble. I've already read this question, which has certainly offered a lot of insight into the problem, but I would like to know why my own derivation doesn't quite work. So essentially, let's say our support v...
I came across the following question in a hackerrank competition, which is based on topological sorting of a DAG. https://www.hackerrank.com/contests/hourrank-29/challenges/birthday-assignment/forum Problem description: Nikita has a family tree $T$ consisting of $N$ members number from $1$ to $N$. Each of the $N-1$ ed...
This is a question about the semantics of the name, rather than about the principle itself. What is the Liskov Substitution Principle (LSP)? LSP seems to have two meanings in the literature I've seen. One statement is the rule that determines whether one function type is a subtype of another? I.e, A->Y is a sub...
A sequence is good if the bitwise AND of all its elements is a perfect square. So counting number of "good" sequences, in a subarray . For example : in [1, 2, 3] There are 6 sub-sequences: So there are 3 "good" sequences Can you suggest an efficient approach to count them ?
I'm aware that typical techniques to store matrices in sparse form are compressed formats or maps where the key is the pair of indices and value the value of the entry in a matrix. I was wondering if vEB trees could be used to such purpose as well. At the end of the day the dynamic set to be stored would be the pairs $...
I ran into an interesting problem at work when trying to generate the inputs for an API given the expected output. I've tried to formalize and anonymize the problem below. I've been trying to design a fast algorithm that works here but I'm a little stuck. Thanks in advance for the help! I'm not an experienced question ...
I'm having trouble understanding this statement: $DSPACE(s(n)) \subseteq DTIME(2^{O(s(n))})$. The logic is that $2^{O(s(n))}$ is the total number of different configurations a Turing Machine M that runs in $s(n)$ space can have as a combination of the number of states, head positions, and contents of the tape, but I ...
I'm having troubles understanding the following proof: $$ \begin{align*} &\text{Proof: } \forall \epsilon \in \mathbb{R}^+, \forall a \in \mathbb{Z}^+, n^\epsilon \gg \log_a(n) \\ &\Longrightarrow \ln(a(n)) = \log_2(e)\ln^2(n) \ll n^{0.01} = \ln(d(n)) \\ &\Longrightarrow a(n) \ll d(n) \end{align*} $$ The topic is Big O...
I'm currently partitioning a big area $A$ into $n$ areas $B_i$ such that $$\bigcup_{i=1}^n B_i = A$$ I have geo-coordinates which I know are in $A$ (also with the finite precision of floats). Obviously, for every point $p$ in $A$ there has to be an area $B_i$ such that the point is in $B_i$. Formally: $$p \in A \Ri...
This question relates to liskov substitution principle seems to have two conventional meanings but is really a different question, so I'm posing it as a new question. I'm doing a bit of research into an old language, Common Lisp, which defines function-type as follows: An object f is of type (function (A) Y) if every ...
For example, I have an NFA $A_n$ with alphabet $\Sigma = \{0, 1\}$. The language recognized by this NFA is known to be $\{u1v\ |\ u, v \in \Sigma^*, |v| = n − 1\}$. I was unable to get the answer on my own. What got me stuck was that there is a $1$ between $s$ and $q_1$, plus the $q_n$ toward $s$. I know without the...
I came across the following statement: "Since b is smaller than n, the complexity $O((n + mb)^3)$ is polynomial." I suppose it has something to do with the notion of polynomiality in terms of the input. All three variables are given as input. I am still not sure why it wouldn't be polynomial if $b$ was as big as $n$. W...
N=64 hungry diners come to a buffet. We sit them at 8 different (s=8 people at each table) tables so that they get to know each other while they eat. After a while we distribute them over the tables so that no one will ever match another person with whom they have eaten before. We keep on redistributing them with diffe...
In the graph below, N and M are most remote, and H is also an extremum. Has the problem of finding the most remote vertices been formalized? Could you point me to publications or references on the subject? Does an algorithm exist for finding the most remote edges of a graph? Please note that I am not asking you to in...
I have the following problem which I think is so common that I expect it to have an official name (and standard algorithm of course). The situation is as follows: I receive distinct items (A...E in the below sketch) one after the other. Each item has a relation which can generally be termed "descendance" or "family" an...
Imagine this Table: All combinations represented in the table (1,2 ; 1,3 ; 1,4 ; etc.) are stored as strings in an array with a total of (n^2-n)/2 elements (combinations). I'm looking for an algorithm that sorts the elements so no number of a combination is next to a combination with the same number in it. For exam...
"Buy and Resell Problem" can be described in the following way: There are $n$ cities. For each city, the price of products in this city is given (a positive number). Now a person will travel from city 1 to city $n$, one by one. When reaching a city, he can buy exactly one product with the price in this city, or sell ...
I'm having trouble determining the complexity of an algorithm. Let's say the number of operations of my algorithm is described by $$f(x, k) = f(x, k-1) + f(x-1, k-1) + f(x-2, k-1) + \dots + f(1, k-1)$$ where $f(x, 1) = x$ How can I describe the growth of $f(x)$ in terms of $x$ $k$ $x$ when $k=x-1$ For 1), I believe $...
The language given is: $$L = \{\langle M\rangle \mid M \text{ accepts all strings of length at most 5} \}$$ I have to find the class to which this language belongs. Now according to my intuition, recursive enumerable languages are those which have verifiers i.e for any string $w \in L$, there is a way to prove that $w ...
Given an NFA with alphabet $\Sigma = \{a, b, c\}$ defined in the diagram, is there a way to efficiently convert it into a regular expression? The way I solved this problem is to first convert the NFA into a DFA using equivalent classes, and then proceed with the method described here. I feel in this case, that method ...
I came across following problem: Find the time complexity of below recurrence relation: $T(n)=\begin{cases} & 2T(n/2)+C; & n>1\\ & C;&n=1 \\ \end{cases}$ The solution was given as follows $\begin{align} T(n) & = C+2C+4C+...nC\\ & = C (1+2+4+...+2^k) \\ & = C \left(\frac{1(2^{k+1}-1)}{2-1}\right) \\ ...
I have a problem where I have a number of proposed initiatives each with a cost and payoff. I need to select a subset of these initiatives in order to maximize the ROI for the selected set as a whole while staying within a total cost constraint. Specifically, the problem is: Maximize [sum(v_i*x_i)/sum(c_i*x_i)] Subject...
I am new to Huffman coding and I find myself facing a lot of confusion as to how to determine if a code is Huffman or not without having the probabilities associated to each codeword. I know one way is look at whether or not the code is prefix. If not, then it's not a Huffman code. If yes, then we need to check if it g...
I've been thinking about a computational problem and could use some guidance for how to go about developing an algorithm to solve it. On a Euclidean plane, I have a polygon A, a set of points A* bounded by A, another polygon B (that does not intersect A), and another set of points B* bounded by B. What I want is to cre...
Can solutions to the graph coloring problem be used in the prison system to keep known enemies apart with the goal of reducing violence?
x,y are regular expressions, prove this: (xy+x)$^*$x = x(yx+x)$^*$* (* in this expression is kleene star) I am looking for a method that is applicable to prove such questions. I know that proof needs to show that: 1) (xy+x)$^*$x => x(yx+x)$^*$ 2) x(yx+x)$^*$ => (xy+x)$^*$x My attempt is like this: 1) (xy+x)$^*$x = =...
In an instruction execution pipeline, the earliest that the data TLB (Translation Lookaside Buffer) can be accessed is: List item before effective address calculation has started during effective address calculation after effective address calculation has completed after data cache lookup has completed ==============...
Our problem is: Given an undirected graph, does it have a vertex cover consisting of $k$ vertices? A vertex included in this vertex cover variant will cover every edge incident to it and every edge incident to some edge incident to it. Hence, we call this variant a vertex cover with covering radius 2. What is the compu...
I am generating an LL(1) parser generator for LL(1) grammars that have a maximum stack size when executed in the table-driven parser. Specifically, I'm parsing HTTP headers using a parser generated by the LL(1) parser generator. In case somebody asks, yes, it's possible to parse plaintext HTTP using LL(1) parser, if th...
The Wikipedia page on zero-knowledge proof says Zero-knowledge proofs are not proofs in the mathematical sense of the term because there is some small probability, the soundness error, that a cheating prover will be able to convince the verifier of a false statement. In other words, zero-knowledge proofs are probabili...
so we know data hazards may occur on data that is not ready yet and we can solve them by forwarding data in between the pipes. Look at this piece of code: lw $6, -16($6) sw $6, -16($5) So the sw wants the data that comes from the MEM read and it wants it just for the MEM write. So we can use a bypass to forward the ou...
I'm reading this book Cracking Coding Interview. In this book author is speaking about BST representation of Hash Tables. I googled a lot for BST Representation of Hash Table. Code in C++ but didn't find any link or example. Can someone help me with the implementation. I'm really confused how to represend Key-Value pai...
I'm planning to implement a lexical analyzer by either simulating NFA or running DFA using the input text. The trouble is, the input may arrive in small chunks and the memory may not be enough to hold one very long token in the memory. Let's assume I have three tokens, "ab", "abcd" and "abce". The NFA I obtained is thi...
You open a code editor, define a syntax with lambdas, a few primitives. Then you invent some nice computation rules, some cool typing rules, and write a corresponding interpreter and "type checker". Congratulations! You just built a proof assistant! Now you can formalize all of mathematics on it! Or can you? After all,...
Given $k$ functions $f_0, f_1...f_k$, a large dataset of size $n$, is there an algorithm that will "approximately" sort the dataset according to all of the functions so that "most" items of the dataset end up close to where they should be if they were sorted by any one of the functions alone. More formally, if we have...
I want to solve the Sparse Extended Information Filter Slam described by Dr. Sebestian Thrun in Probabilistic Robotics.I stuck in some nested function. The algorithm is described in page 309 in this book at Table 12.1 Algorithm is like that: 1.Algorithm SEIF_SLAM_known_correspondence($\xi_{t-1}$,$\Omega_{t-1}$,$\mu_{t-...
Given an input table with binary operation $\circ$. I want to check whether given input table represents a group or not. I need to verify the four axioms of a group. The identity I can find it by just scanning the first row of the given table. -----$\mathcal{O}(|G|)$ running time. Find the closure operation ie.e for a...
Yesterday I have been trying to complete this exercise. I have to find: $$ ((map)l)t \simeq \lambda k \lambda x ((k)(t)t_1)....((k)(t)t_n)x $$ where $$l=\lambda k \lambda x ((k)t_1)....((k)t_n)x$$ And $t$ is a generic Lambda term. I tried but without success. Maybe it will be something like that : $$map=(\lambda a \la...
I have tried my best but I'm not able to find any pattern for the $n^2n^{1/2}$ part. This question must be solved iteratively and I get totally clueless after two iteration.s I've to find tight bound in big-O.
This question is motivated by my attempt to understand quantum computing and the source of its computational power. Quantum statest are described by complex numbers. That is, 1 qubit is described by 2 complex numbers, one for each state (actually 1 complex number, due to the constraint and the invariance). Quantum phen...
I am really bad at calculating correctly the complexity of a given algorithm. I would like to know if there is some book or online resources where I can find many exercises that ask to calculate the complexity of a given algorithm. Thank you!
I have been reading about instruction pipeline and I stumbled upon the term delayed branches. From what I have understood, delayed branches will keep the pipeline busy, by executing instructions, regardless of the outcome of the branch. This will avoid the usages of NOP instructions. What I do not understand is, how is...
I've recently came across this language and I don't know if my hint for proving its class is correct or not. $$L = \{ n : \exists x \in N, \,n=3x+2 \} $$$n$ is in binary format. I think $L$ is decidable and as proof I was considering using a canonical enumerator of $\{0,1\}^*$. For each word $x$ printed by the enume...
So at the beginning I was aiming at $L_{a\neq b} = \{w\in \{a,b\}^* : \#_a(w) \neq \#_b(w) \}$. But figured out that is would be better to first deal with: $L_{a>b} = \{w\in \{a,b\}^* : \#_a(w) > \#_b(w) \}$, due to the fact that $L_{a>b} \cup L_{b>a} = L_{a\neq b}$. My attempts so far for $L_{a>b}$ - I proved that t...
Is there a difference between $T(n)=2T(n/2)+n$ and $T(n)=2T(n/2)+Θ(n)$ when using the master theorem? I've seen it both ways and am a little confused. (Looking for the answer $nlogn$).
The challenge says that there is a hash algorithm with a bug, the bug is given if it reaches the end of the array and did not find space to save the element, it discards it directly (that is, it does not try to place it in positions 0, 1, 2 ... as it would be correct) In a hash table using closed hash, linear probing, ...
I have no idea how to approach this problem, could I get at least a hint on how to go about proving/disproving this? I've tried the pumping lemma but I don't think it applies here. I've also tried reasoning about closure properties, but I think my reasoning is faulty. My thought process so far is a string (with length ...
I want to be able to find closed form runtime solution for recursive insertion sort which looks something like this $$T(n)=\begin{cases} 1 &\text{if }n=1,\\ T(n−1)+3n &\text{if }n>1. \end{cases}$$ However, I am confused about how to plot a tree. I know how to find runtime using tree if problem is divide...
Is Master's theorem applicable on $T(n) = 2 T(\frac{n}{2})+n\log n$ ? I got this doubt from here: https://gateoverflow.in/227814/introduction-to-algorithms
Recently, I've read Hennie's Paper. I understood the construction of buffer zones, but why can't it be applied to yield a single-taped Turing machine?
I am reading the paper Foundations and tools for the static analysis of Ethereum contracts, by Grischenko et al. Sometimes the authors speak about hyper properties (e.g. Section 5). What exactly is a hyper property in this context?
I know that different authors use different notation to represent programming language semantics. As a matter of fact Guy Steele addresses this problem in an interesting video. I'd like to know if anyone knows whether the leading turnstile operator has a well recognized meaning. For example I don't understand the lea...
We are given an array of size $N$ with integer entries $> 0$. We have to count the number of all such pairs $(a,b)$ with $a \leq b$ such that $a*b$ is divisible by $a + b$. The obvious naive way is to check every pair and it takes $\mathcal{O}(N^2)$ time. This seems to be more of a maths problem rather than algorithmi...
There are two ways to implement a circular array either take a new array of size 2N where N is the size of the initial array and copy initial array twice into that new array array = [1,2,3,4,5] new_array = [1,2,3,4,5,1,2,3,4,5] Or we can use (i % N) where N is the size of the array, i is the index of that element for(...
I’m reading about the BB84 quantum key distribution scheme, and I’m surprised that it’s conceptually more complicated than seems necessary to me. What’s wrong with this conceptually simpler scheme? Alice chooses two random strings $x,y \in \{ 0,1\}^{2n}$ Alice encodes $x$ into qbits, choosing the basis in which to enc...
Given point sets $Y$ and $M$, I'd like to register articulated $M$ to $Y$ without changing the edge distances of $M$. The point correspondences between $Y$ and $M$ are known and points have a fixed connectivity map. As you can see from the above sample, the edge distances of $Y$ are corrupted, and I'd like to correct ...
In the linear time selection algorithm which finds the ith smallest element in O(n) time our first step is to divide our unordered set into subsets of 5. Why is the size of the subsets chosen to be 5 and how would the algorithm be affected if I chose a different number. Nothing online describes why this number is the c...
I'm trying to come up with a data structure for a following model: Nodes representing points in space are structured in a tree (general rooted tree with no restrictions). Let's call these nodes "joints". Joints contain information about their position and their axis of rotation: Whole subtrees may rotate around their p...
Anyone who deals with mathematics knows intuitively that it is a different kind of thinking than ordinary common-sense thinking that intelligent people use every day to understand and make decisions in the world. I would like to understand what separates ordinary common-sense thinking from mathematical thinking, and I...
Consider a method which finds prototypes for multivariate time-series (MTS) data, and is designed to find prototypes for each class of data. For example, the {walking} class consists of some slightly different types of {walking} sub-classes, but they are not annotated. So i want to check if my prototypes can adequatel...
Consider the following setup: Input: An array of tasks $T=[t_1,t_2,...,t_k]$ where each task $t_i$ is an object that has the following features: start time $s,$ finish time $f$ and coordinates $x$ and $y$, which give the location where the task needs to be performed. Next, we have an array of people $P=[p_1,p_2,...,p_m...
Let $G = (V, E)$ be a graph. I want to find the subset of vertices of $G$ that minimizes a certain modularity cost. In our setting, the modularity cost of a subset $X$ is defined as the number of non-edges within $X$ plus the number of edges from $X$ to the outside, all this divided by $|X|$. Intuitively, it is the ...
I'm trying to understand the following algorithm: int ubnd = Integer.MAX_VALUE int lbnd = ubnd while (fload)lbnd == (float)ubnd { lbnd = lbnd - 1 } lbnd = lbnd + 1 print "$lbnd..$ubnd" I don't see why for 63 iterations of the loop, we have (float)lbnd == (float)ubnd. It has something to do with the conversion of i...
Using the Master Method, I need to prove (True, or False and why) the following (3) recurrences: $T(n) = 3T(\frac{n}{2}) + n = \Theta(n\ln(n))$ $T(n) = T(\sqrt{n}) + 1 = \Theta(n^2)$ $T(n) = 2T(\frac{n}{3} + 1) + n = \Theta(n\ln(n))$ I understand the Master Method (I think, largely from: https://stackoverflow.com/que...
In a Distance Vector routing protocol each node implements a Bellman-Ford inspired algorithm that shares it's routing table (Distance Vector) with each of it's incoming links (upstream neighbors). How would a source node identify a destination node it could reach at an infinitely low cost by traversing a negative cycl...
David IShuman in " vertix-frequency analysis on graph" claims that,"we generalize one of the most important signal processing tools – windowed Fourier analysis – to the graph setting and When we apply this transform to a signal with frequency components that vary along a path graph, the resulting spectrogram matches ou...
Lets there are n stores. A customer order x items. All the stores might not have all the items from the order. So find the store/combination of stores that can serve the order request such that the combination that contain least number of stores. Edit: Example: Lets say there are 4 stores. User is ordering item 1, 3, ...
If a process executes the following code fork(); fork(); fork(); The total number of child processes created is given as 7 by a text book. But how does that happen fork generates 2 processes right? Are both the processes referred to as child processes? One process is the parent parent and one is the child right? Eve...
Consider that I have an array of ranges and I want to transform it to the new array that represents the ranges that any range is in. Example: Ranges: [red: [1,11], black: [15,16],yellow: [5,9], green: [7,8]] Result: [1,4] - red [5,7] - red & yellow [7,8] - red & yellow & green [8,9] - red & yellow [10,11] - red [15,1...
In the www I can find a lot of application examples suited for and benefitting a lot from distributed computing. Question: Are there applications which are not suited for distributed computing? If yes (which I assume) which promiment examples are out there? Thanks a lot for pointing me into some useful direction.
I am currently solving a problem in which we have to show that we can not prove using pumping lemma that the language mentioned in the question is not regular.Here is the full question Consider the language F = {$a^i b^j c^k$ | i, j, k ≥ 0 and if i = 1 then j = k}. a. Show that F is not regular. b. Show that F acts li...
Apologies ahead of time, I don't fully understand what I'm asking... But, is it possible to program using only 'while loops' and still be Turing equivalent? Or more generally, can I do everything with 'while loops' that I could with 'if statements' and 'for loops'?
We have given two numbers $x$ and $p$. We want to count how many numbers are less than $x$ and are co-prime with $p$. I know that we can solve the problem in $O(x\log x)$ with iterating over all numbers less than $x$ and check if their greatest common divisor is $1$. Is there any way to solve this faster, because I thi...