instruction
stringlengths
35
29.1k
The negative answer to decidable = non-contracting grammar? suggests the following question: Is there a decidable language that can be recognized only by a space unrestricted Turing Machine (i.e. with infinite tape but in finite time)? This is, are there words, w, in a decidable language for which cannot be determine...
Quoting from Wikipedia: In mathematical logic, the disjunction and existence properties are the "hallmarks" of constructive theories such as Heyting arithmetic and constructive set theories (Rathjen 2005). The disjunction property is satisfied by a theory if, whenever a sentence A ∨ B is a theorem, then either A is a ...
Suppose, we have a two binary sequences, encoded as "recursive repeating sequences" (I don't know exactly how to name them). Each sequence can contain other sequences and has number related to how many times this sequence is repeated, or can contain a bit either 0 or 1. Following image describes it visually: On this i...
I want to know the steps for finding a Formula for Average number of total comparisons in bubble sort. Please look at this example: 4 3 2 1 -> 3 2 1 4 -> 3 comparisons 3 2 1 4 -> 2 1 3 4 -> 2 comparisons 2 1 3 4 -> 1 2 3 4 -> 1 comparisons For ordered and reverse ordered input we have different formula for num...
I'm trying to prove the irregularity of the following language: $$L = \{ a^mb^nb^n \mid nm \ge 3 \} $$ I tried to demonstrate that it doesn't verifies the Pumping Lemma but for all words I tried it seems to accept all of them. Any hints or suggestions?
This is what I've learned from the SHT and the sketch of its proof. I would appreciate pointing out any mistake. The intuition behind the Space Hierarchy Theorem is that "there are Turing Machines using s1 space that can perform computations not posible using s2 < s1 space" s2 < s1 means that s1 uses O(f(n)) space ...
Given the following language: $L = \{ a^ib^j \mid \lvert i - j \rvert \le 2 \} $ I am trying to prove that it is not regular. On the one hand my intuition tells me that the language is non-regular as there is no way of tracking $a^{i's}$ and $b^{j's}$. However, when I try to prove that it is irregular using the pumping...
I know that $\mathsf{P}$ class is only defined for decision problems. Therefore, a problem like "Does there exist an $(s,t)$ path of length $k$ in the graph $G$?" is in $\mathsf{P}$. One can first find the shortest path from $s$ to $t$ in polynomial time and check if it is smaller than $k$ or not. Now, consider the opt...
I'm trying to find a CFG for the following language: $L = \{ a^ib^j \mid \lvert i - j \rvert \le 2 \} $ What I thought about unsuccessfully is the following: $S \rightarrow SASBS \mid SBSAS \mid \epsilon$ $A \rightarrow a \mid aa \mid aaa $ $B \rightarrow b \mid bb \mid bbb $ Which has the following problems: (1) It do...
Using the Fitch application and only Intro and Elim rules (& REIT if necessary), prove that $$\forall x \forall y (P(x) \implies Q(y)) \iff (\exists x P(x) \implies \forall y Q(y))$$ is a logical truth (i.e. prove it from no premises) I am attaching a screenshot of my work so far, please give me feedback and/or assista...
I have a cake with $n$ layers in total. I know that $k$ are vanilla, and at least $n-k$ are not. I dislike all flavors other than vanilla, so I decide to only eat those layers. I can't tell which layer is which flavor, but I can smell the vanilla. For any $m$ with $1\le m\le n$, I can test the top $m$ layers of the ca...
How do we define the term computation / computable function generically across models of computation? Beginning with the textbook definitions of: {Linz, Sipser and Kozen} for "computable function". A function f with domain f is said to be Turing-computable of just computable if there exists some Turing machine M = (Q, ...
Is there an upper bound of the number of induced subgraphs in a tree (i.e., connected acyclic undirected graph)? The bound can be expressed in terms of vertices, edges, etc. For example, consider the following graph $G$ represented as edge list: $\{(S,T),(T,G),(T,B),(B,H),(H,Q)\}$. The number of connected subgraph (i.e...
I have a directed graph $G=(V,E)$ where each vertex is a 4-D coordinate $v: (x, y, z, c)$ representing spatial coordinates $x, y, z \in \mathbb{R}$ and the non-physical parameter colour $c \in (c_{1}, c_{2},... c_{n})$. The edge weights $\omega_{v_{a} \to v_{b}}: f(x, y, z)$ are purely a function of three of the four d...
Construct a pushdown automaton that accepts $$\{a^ib^jc^k \mid (i+j)\bmod 3 = 0, k = i + j\}$$
I'm trying to prove that the following languague is a regular language: $L=\{ w \mid \lvert w \rvert$ is prime $\}$* What I have thought is to divide each word $w \in L$ into subwords of length 2 if the word is even and and if the word is odd end with a suffix of length 3, in this way I would get the following regular ...
I am currently reading a paper on a meta-heuristic called 'Grasshopper Optimization Algorithm'. The main idea of the algorithm is to utilize the social behavior of grasshoppers in a swarm to solve optimization problems. The distance to other grasshoppers in the swarm is used to determine, if a grashopper is repelled (e...
I'm making simulations like Ant colony simulation, boids, and cellular automata in Go (to learn Go), but I believe this can apply to most languages. From what I've read (this), using 1D arrays is generally better, but the post only addresses CPU processing. I want to do my simulations with the GPU and that may have som...
I know this could be a strange question. But was there any algorithm ever found to compute an NP-problem, whether it be hard or complete, in polynomial time. I know this dabbles into the "does P=NP" problem, but I was wondering whether there were any particular instances when people were close to it. I've also heard ab...
I need to cluster $N$ data points. I don't know the number of clusters to be formed. It needs to be found optimally. Also, there is maximum and minimum cluster size constraints, where $C_{\max}$ is the maximum size that one cluster can get and $C_{\min}$ is the minimum size that one cluster must get. The coordinates of...
Please look at this grammar: $$ → \ | \ \ | \ \\ → \ | \ \ | \ \\ → \ | \ d$$ I eliminated B from the grammar and it converted to: $$ S → SAAS \ | SAd \ | \ Ab | \ b \\ A → SAS \ | \ Sd \ | \ a \ | ASS \ | dS $$ But I can't eliminate loop recursion between A and S.Was it a good solution I removed the B...
I am studying computational complexity using Papadimitrious's book: "Computational Complexity". I am trying to solve Problem 9.5.14, about polynomially equivalent minimization-maximization problems in weighted graphs: Consider the following pairs of minimization-maximization problems in weighted graphs: (a) - MINIMUM ...
Given a time-series of data collected from a single running process that takes 8 hours to complete: Minute GB of Disk Space Used 0 0 1 8 2 15 3 22 ...Etc. It is sampled every minute, for 8 hours. The # of GB used jumps up and down a lot, and ends back at 0, like a big spiky mountain shape. I'm ma...
I'm a bit confused as to how they relate to each other. I think I understand them individually but not sure how they would relate.
I'm doing some work with static analysis and need to represent local variables as SMT formulas. In general this is fairly straight forward, depending on the domain of the static analysis. However, my question lies when needing to represent impossible or infeasible values, e.g., divide by zero paths from the static an...
I'd like to create some program that can keep spitting out verification algorithms. My verification algorithms take two inputs: problem instance, and solution (both encoded in binary), and output True or False. Every verification algorithm my program returns needs to satisfy the following criteria: It terminates in po...
I am currently dealing with a problem that I believe to be a network flow related problem, and I am trying to find some similar solved problems to help me formulate my solution. I want to make it clear that I am not searching for a solution here, but asking a community of more experienced individuals if they have exper...
Complement of equality problem of Turing machines is unrecognizable or not-recognizable but How? As per my knowledge it is recognizable if you can decide its accept condition but not reject condition and the opposite is the case with unrecognizable. But in complement-Eq problem of TM if a string/input accepted by one b...
A company has some workers who need to perfrom some jobs. Each job requires workers of a combination of departments and seniority. Departments : HR, Legal, Product, Development Seniority : Junior, Mid Level, Senior For example, a job might have the following minimum requirements. Job1: Total Workers - 8 Atleast 2 work...
I know that the offset is based off of the line size for a cache. I have seen the example: "32-btye line size would use the last 5-bits (i.e. $2^5$) off the address as the offset into the line" but I do not understand the process used to determine this.
A crown in a graph $G$ is a pair $(H, C)$, where $H \subseteq V(G)$ and $C \subseteq V(G)$ with $H ∩ C = ∅$ such that the following conditions hold: (a) The set of neighbors of vertices in $C$ is precisely $H$, i.e. $H = N(C)$, (b) $C = C_m \cup C_u$ is an independent set, and (c) There is a perfect matching between $C...
Let $A$ be an array of n elements. We know that $n - \lfloor \sqrt n \rfloor$ elements are integers in range $\sqrt n$ to $n\sqrt n$ (the other $\lfloor \sqrt n \rfloor$ elements may or may not be in the range). I need to sort the array in $\Theta (n)$. I thought of partitioning the array to 3 subarray: elements small...
Suppose I want to deploy the algorithm for finding connected components in a graph $k$ many times. Now the time complexity for finding connected components in an undirected graph is $O(v+e)$. Then what will be the time complexity, $O(k(v+e))$ or $O(ke)$? Similarly, I have deployed a method $k$ times which requires $O(n...
I need to design an algorithm that given a string $T$ of length $n$, performs $O(n)$ preprocessing, and can then answer queries of the sort "does a string $P$ of length $m$ appear in $T$ before position $k$" in time $O(m)$. The algorithm should use a suffix tree. Unfortunately there are not any good bioinformatics book...
I'm familiar with binary search, but I'm interested in when a collection of numbers can be searched faster than checking them all one by one with any algorithm. Binary search requires sorting to work, which means some knowledge of the structure of the collection, but maybe there is something else.
So using K-maps I was able to simplify xy + (!x)z + yz to xy + (!x)z, and I double-checked that the truth tables are the same. I'm having trouble understanding how I would have used boolean algebra to get this result. I tried my usual tricks of adding zero, letting addition distribute over multiplication, etc., without...
Let $A$ be an array of $n$ integers containing the numbers $\{1, 2, \dots , n\}$ in some arbitrary order. For integers $i$ and $j$ such that $1 ≤ i < j ≤ n$, let $\mathrm{Reverse}(A, i, j)$ be a procedure that reverses the subarray $A[i], A[i + 1], \dots , A[j]$ of the array $A$ while leaving the remaining elements of...
What I need to do is go from a binary image like this: to a segmented structure like this: because I have a program that operates on those separated line contours after. As you see, those contours are not perfect, they might be slightly bent but where they meet it's always pretty much orthogonal, there are no 45 degr...
The algorithmic problem is as follows. The input is the source code of a program accepting an integer as input and outputting a finite binary sequence. This program defines a recursively enumerable formal language. The output is a formal grammar generating this language. How can we solve this problem?
I have a search problem that requires me to find a path from $v_s$ to $v_g$ in the graph $G = (V, E)$ where $v_s, v_g \in V$ are the start and goal vertices in a set of vertices and $E \subset V \times V$ is an undirected set of edges connecting vertices. Both $V$ and $E$ can be infinite. Each edge has an associated co...
Got a problem I'm not sure how to approach. I'm being given a string of text with indeterminate length, around typical "body text" size. The text is a solid color, and the background can be a solid OR a gradient of one or more colors of varying luminance. The goal is to make the text readable across the entire backgrou...
I cannot seem to find an example of an NFA and Turing Machine that both accept the same languages. I am trying to understand how to convert an NFA to its equivalent Turing Machine and I think a simple example would help a lot!
I have an array, [23,12,11,0,5,2,7,8,15,14]. I choose the rightmost element (14) as the pivot and set lo = 23 and hi = 15. Then since lo = 23 > pivot = 14, I don't change the position of lo. However for hi = 15 it is > pivot = 14, so I move one step to the left, which results in hi = 8. Since hi = 8 is < pivot = 14, I ...
How to solve the max contiguous subarray problem, where we have an addition parameter $M$, and the contiguous subarray must include both $A[M]$ and $A[M-1]$? For example, for the zero-indexed array $1, -4, 2, -2, 4, 1, -1, 1$, if $M=1$ then the contiguous subarray must include the first two elements, and so the answer ...
An interesting advantage of bloom filters over hash tables, that they share with bitarrays, is that they support taking unions & intersections of sets by simply doing bitwise or & bitwise and respectively. The union of two bloom filters is the same as the bloom filter generated by the union of the sets, while the inter...
I am trying to sort an array that I know to have a constant number of unsorted elements (elements that are not in their right place). In the solution I looked at they say you can do this in $O(n)$ time: you can find any unsorted element in $O(n)$ and then move it to the right place in $O(n)$ also. I am not seeing how y...
What is the asymptotic rate of growth of the following recurrence relation? $$ f(x) = \begin{cases} 8f(x/2) + Θ(1) & \text{ if } x^2 > M, \\ M & \text{ if } x^2 \leq M. \end{cases} $$ Here $M$ is a constant. I'm not sure how to do it with the condition on $x^2$.
The following theorem is cited in Balcan, M.F., Sandholm, T. and Vitercik, E., 2019. Estimating approximate incentive compatibility which I am currently reading and it is referenced to David Pollard. Convergence of Stochastic Processes. Springer, 1984. However, I have trouble finding the proof. Anyone knows a reference...
So far I've understood that because of the definition of $\Theta$, we have $c_1n^2 \le f(n) \le c_2n^2$. I'm not sure how to proceed from there.
I have a sequence of bytes: https://drive.google.com/file/d/17sfchPgsySi2ilIxLuBb1q-UUqq5lO87 What the data is, is unknown (see NOTE below). I'm pretty sure this data is compressed in some way, due to the ent analysis results: $ ent first-chunk Entropy = 7.997831 bits per byte. Optimum compression would reduce the si...
I'm working on a mini lisp and now I'm wonder about scopes. For my case I'll have this constructs that introduce scopes. lambdas introduce it's arguments let binds and modules The way I worked on this was, a single scope is an associate array, and all scopes are stacked from inner to out. Also I have a global scope t...
Task Consider the following recursively-defined tree structure: const tree = { val: 1, children: [ {val: 2}, { val: 3, children: [ { val: 4, children: [ {val: 5}, {val: 6}, {val: 7} ] } ] } ] }; Here, ...
I'm playing around with C++ and was looking at how to loop through an array of unknown length. The following code was suggested and works perfectly from the little testing I've done: std::string words[5] = {"Lorem ipsum dolor sit amet orci aliquam.", "Hi", "Welcome", "World", "LoopyDoopyDoo"}; for (int i = 0; i < sizeo...
Are there any examples of CNF formulas that are tautologies? Such that every clause contains different variables so phrases like (a or not a) are rejected?
In this set of notes it is claimed that: If there exists a polynomial-time pseudorandom generator $G:\{0,1\}^{O(\log n)}\to\{0,1\}^{O(n)}$ that $1/10$-fools all $n^2$-size circuits, then $\mathbf P=\mathbf{BPP}$. The proof of this is as follows: If a language $L$ is in $\mathbf{BPP}$, then there is a polynomial-time ...
Suppose we have a hallway environment, i.e, $N$ nodes from left to right, and we can either move left or right. Moving left at the leftmost node does nothing and reaching the right most node gives you a $+1$ reward and terminates the game. But every other action has $0$ cost or reward. I'm curious to know how reinforce...
Is the halting problem decidable for TMs that do not write to the tape? Once a read only tape TM repeats a configuration, it will loop forever. Therefore, all we have to do to decide the above is construct a different TM(with read and write tape) that’s takes the read only TM as input and checks for a repeat configurat...
I'm trying to find the PDA of the above language. I understand that this is the complement of the language $L_1=\{w : w=a^nb^n : n\geq0\}$ However, I can't understand the idea behind constructing the PDA. Even if I construct the PDA for $L_1$, and convert the non-accepting states to accepting states and vice-versa, the...
Languages recognized by finite automata are exactly those definable by sentences of the sequential calculus, and also exactly those definable by rational expressions (also called regular expressions) Howard Straubing, Pascal Weil. An introduction to finite automata and their connection to logic. Deepak D’Souza, Priti...
I'm trying to find the language of the given CFG $S \to aB \mid bA \mid a \\ A \to bAA \mid aS \\ B \to aBB \mid bS$ I understand that the productions $S \to aB, S \to bA, A \to aS$ and $B \to bS$, correspond to the language where the number of a's are equal to the number of b's, but how do I interpret the other produc...
Let's say there are two sets of affine functions. $\mathcal{A} = \{ax +b \mid a,b \in \mathbb{R}\}$ $\mathcal{H} = \{2x + 1, x, 3x + 4, 4x\}$ I know that the $\mathrm{Pdim}(\mathcal{A}) = 2$. From my understanding the $\mathrm{Pdim}(\mathcal{H})$ is also equal to 2 as I can find $\{x_1, x_2\}$ and $z_1, z_2$ such tha...
I'm trying to figure out proof of maximum independent set from: this link. (1b part). And I'm bit confused why exactly sum of $w(v)$ is less than or equal to sum of $w(v')$. Shouldn't it be other way around? As we define $v'$ if it is in $T$ and is in $S$
I am trying to prove that you can't sort binary heap with better complexity than O(nlogn). We proved at class that every sort based on comparison can't have better cocmplexity than O(nlogn) and i know nothing about the items in the heap (except its a heap) so you can't use radix sort or linear sort. Problem is i feel...
I need to define a family H of universal functions $\{0,1, ..., p^k−1\} →\{0,1, ..., p^2−1\}$. Now based on a similar example I was thinking of something like: Given some $a= (a1, a2, ..., ak)∈\{0, ..., p−1\}k$, define $h_a(x)=(a_1x_1+a_2x_2+...+a_kx_k)\ mod\ p^2$ for $x \in \{0,1, ..., pk−1\}$ as we can write x as a s...
I am trying to solve this question: Let's say you have a binary heap and an index $i$, design an algorithm that finds if a number $x$ appears in the path between the root of the heap and $heap[i]$ in time $O(\log(\log n))$. My solution: Before the loop, I will create a new linked list and initiate $heap[i]$ to be the f...
given 'r' , a regular expression that does not include λ or ∅, What are the Conditions of 'r' so that L(r) would be infinite?
Do two halting Turing machines accept the same language? Proof that it is undecidable(credit to another user on this website: "Tom van der Zanden"): Let M be an arbitrary Turing machine. Let M′ be a Turing machine that on input x, simulates M (on some predefined input) for |x| steps and accepts if (and only if) M halts...
Would it be possible to do better than standard compression if you fed a bunch of zipped files through a machine learning algorithm that kept track of the most common bit sequences and produced a lookup map, with a heuristic for giving the longest / most commonly used sequences the shortest key values? The compression ...
One way to prove that a problem $X$ is NP-Complete is to pick two NP-Complete problems $Z$ and $W$ and show that ($\leq_p$ is polynomial reduction): $$\begin{array}{rr}X \leq_p Z & (1)\\W \leq_p X&(2)\end{array}$$ The usual way to prove NP-Completeness however, is to follow Karp’s strategy which consists in proving tha...
I'm trying to find the CFG and PDA for the above language. I have so far come up with this $S \to S_1S_2 \\ S_1 \to aS_1b \\ S_2 \to bS_2c$ However, I realized that this is just a subset of the required language. How do I consider the remaining ones? Also, how do I construct a PDA for it? Any help is appreciated.
I am learning computer architecture and organization. I have this confusion, can synchronous data transfer be used for transferring large data in case of computer architecture and organization? I have read that synchronous data transfer can be used for transferring large data but I think it is true only in case of co...
The following problem appears in "Introduction to Algorithms" by Thomas Cormen et. al., aka CLRS. Problem 7-1.b Hoare's partition algorithm from the book. Part b: Assuming the subarray $A[p,\cdots,r]$ contains at least two elements, show that the indices $i$ and $j$ are such that we never access an element of outside ...
I have a graph with an arbitrary amount of edges and vertexes. Each vertex having an arbitrary amount of edges connecting to it but in practice the number is usually around 3 or 4 no less than one and no more than a dozen. I want to find the path that goes to as many vertexes and edges as possible without using any e...
If an algorithm for $SAT$ runs in $O(n^{\log n})$ time, and if $L$ belongs to $\mathsf{NP}$, is there an algorithm for $L$ that runs in $O(n^{\log n})$ time?
My understanding of the Y-combinator is that it never terminates (Yg = g(Yg)). Its termination is only decided externally to the $\lambda$ specification when it has reached a fixed point (g(x)=x) because based on its $\lambda$ expression there is no exit from the infinite loop even when the fixed point is reached. Am I...
Is there any known algorithm to check for equivalence of two binary expression trees over a field $\mathbb{F}$? For example for the expression $a+b = b+a$ it should return true (since $\mathbb{F}$ is commutative) and $a^b = b^a$ should return false as well as for $a^2 = a$. I can think of a naive implementation which i...
Consider a problem: we have an undirected graph $G = (V, E)$, function $l: E \to \mathbb{Z}_{+}$ where $l(e)$ is edge's length $e \in E$, and two vertices $s$ and $t$. And we want to find a pair $(A, B)$ of edge-disjoint paths between $s$ and $t$ such that $$ \sum_{e \in A}l(e) + \sum_{e \in B} l(e) \to \min $$ How can...
The reduction from 3SAT to SUBSET-SUM includes building a table as follows: Where base 10 representation is used for the rows in the table. I would like to know if the reduction will still be correct if we replace the base 10 representation with the following bases: 2, 3 or 6?
In a single pass stream you can compute the minimum spanning tree (MST) in an undirected graph using the following algorithm: H ← ∅ for each (u,v) in the stream H ← (u, v) if H includes a cycle remove largest weight edge in the cycle To make this fast we need a data structure that allows you to c...
Assume we have 26 vectors ${A,B,C,....,Z}$ all have 1 million integers. given a query: $$ \vec{query} = (r_a, r_b, r_c, ..., r_c) $$ I want to find a match vector $\vec{m_{1 \times 26}} = (a, b, c, ..., z)$ that satisfies the following criterias: $$ a \in A, b \in B, c \in C, ..., z \in Z \\ \text{and} \\ r_{a} = \frac...
Would a "TM starting with a blank tape will ever write a nonblank symbol anywhere before halting" be undecidable?
So I'm trying to implement an insertion sort algorithms based on page 18 Cormen psuedocode but I'm confused by for j = 2 to A:length. Specifically, what does the j=2 mean? I'm implementing it using the below python code and it only works when the range is the entire length of the array: def insertion_sort(arr): # l...
I want to give a DFA for the language which contains the words X ∈ {0,1,2}* for which the number of 0's + number of 1's is even AND the number of 1's + the number of 2's is odd. I tried many automatons so far but I haven't succeeded with any.
Show that the language L = {<M>| M is a TM and does not accept <M>} is not Turing-recognizable. Note: Prove by contradiction. No need for reduction. This is the problem I am trying to solve. I'm confused on how to do this without using reduction.
Obviously there is JIT but it is basically run-time compilation. There is also implementing things in VHDL or ASIC. But my question is more towards software techniques for program building and execution
I want to draw an state diagram for a Turing machine such as: If "a" and "b" are the inputs, output in tape will be $a^b$. I saw many Turing machines that output: $a+b$ $~~$ ,$~~$ $a-b$ $~~$ , $~~$$a*b$ $~~$ ,$~~$ $a/b$ And also I know how to design a Turing machine for accepting $x^{2^n}$,$x^{3^n}$ and ... But for gen...
Show that the language $\{ ww \mid w \in \{0,1\}^* \}$ is in $\mathsf{NTIME}(n)$. I have a doubt first of all how can I prove that. Secondly, what does NTIME mean? Can we use a $k$-Tape Turing machine, when they say NTIME OR NSPACE? What do both of them mean?
My first intuition was to take two languages $L_1$ and $L_2$ (symbol $d$ at the end is to fulfill prefix property): $$L_1 = \{ a^i b^i c^j d : i,j \ge 0 \} \mathrm{\ \ and\ \ } L_2 = \{ a^i b^j c^j d : i,j \ge 0 \}$$ So their union would be: $ L = L_1 \cup L_2 = \{ a^i b^i c^k d : i=j \lor j=k \} $ Then to prove $L$ no...
I know that Manacher's algorithm can be used to find the longest palindromic substring of a string in linear time. But I want to find the longest palindromic substring after swapping any two indices once. If I run a for loop twice in $O(n^2)$ to find all possible swaps and find the max of all formed strings I get the a...
Let $\mathcal F_1$ and $\mathcal F_2$ be a families of subsets of $\{1,\dots, m\}$. Such that $|\mathcal F_1| = n_1$ and $|\mathcal F_2| = n_2$. I would like to check if there is $f_1\in \mathcal F_1$ and $f_2\in \mathcal F_2$ with $f_1\cap f_2 = \varnothing$ One approach is to go through all $n_1n_2$ possible pairs a...
Everything is in the title. What is the difference between broadcast and gossip in the context of message-passing distributed systems? According to Wikipedia, gossip and epidemic protocols/epidemics are synonym. Thank you for your help.
Considering the definition below (with $d$ as distance, $w$ as operation weight/cost and $m$, $n$ being the string lengths), the operations $del$ and $ins$ seem to represent pretty much same thing given equal weights (deletion in one string is the same as insertion in the other, and vice versa). \begin{aligned}d_{i0}&=...
I have written a CFG that supposedly generates $L$ below. $$L = \{w \in \{a, b\}^* \text{ }| \text{ } w \text{ has } n_a(w) = 2n_b(w)\}$$ Where $n_a(w)$ is the number of $a$'s in $w$ and similarly for $n_b(w)$. My reasoning is that for every $b$ in $w \in L$, we will be able to pair it up with two distinct $a's$ in $w$...
I am learning about computer architecture and organization. I have read that programmed I/O is not suitable for high-speed data transfer because it does not support synchronous mode of data transmission that is a requirement for many high-speed peripherals like disk. But programmed I/O supports synchronous mode of data...
Without the unknown $\lfloor \sqrt n \rfloor$ elements this question wouldn't be hard. After a long time trying to solve the question, the best partial idea I have is to use Radix sort for the $n-\sqrt n$ elements which are in the given range. Then I would need to sort the $\lfloor \sqrt n \rfloor$ elements in a decen...
I am analyzing the time complexity of the Douglas-Peucker line simplification algorithm. Reading online I've found that it has a worst-case running time of $O(n^2)$ where $n$ is the number of points on the line. However, I haven't been able to provide complete proof. Here is the pseudo-code I am working with: Here is ...
Let Sigma = {a,b,c} and let L be the language of all words in which all the a’s come before the b’s and there are the same number of a’s as b’s and arbitrarily many c’s that can be in front, behind, or among the a’s and b’s. Some words in L are , abc, caabcb, ccacaabcccbccbc. How can I solve this problem by empty stac...
I'm having a trouble proving it to be non-context-free. For example, if I take w = $a^k b^k b^{k+1} a^{k+1}$, it would be problematic if the partition of $vxy$ with $|v| = |y|$ was in the $ b^{k+1} a^{k+1} $ part as I can't get it to be equal with $k$ or make the amount of $a$s and $b$s different. We are also allowed t...
Let us suppose that we have some algorithm A that halts for all valid inputs, can we prove the existence of another algorithm B that takes A as input and calculates the time complexity of A. Are there any examples of existing algorithms/programs that do this?
According to these two definitions: Logical address: every memory address generated by the CPU. Physical address: address which identifies uniquely a (real) memory cell. my textbook (Operating systems concepts - Silberschatz, Galvin, Gagne) says that address binding at compile-time and load-time both generate ident...