instruction
stringlengths
35
29.1k
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...
I have system of linear equations over binary field $GF(2)$. Suppose there are $n$ equations with $n$ variables and equations are linearly independent. Then we can solve using Gaussian elimination with $n^3$ complexity. We can improve this complexity using some advanced algorithms. Now suppose we know few variables say...
From what I know hash sets generally have complexity of $O(1)$ (unless the hash function is bad, but let's just ignore that for this question). However, sets need to either read the full data so as to make a hash function that's guaranteed to return a unique result for every input or they need to make a comparison to m...
If I have a set of words and need to return which of them start with a certain prefix, can that complexity be less than O(n*d), where n is the number of words and d is the prefix. I'm asking because of this video: https://www.youtube.com/watch?v=QGVCnjXmrNg (1:20 starts discussing the solution), where it says it can be...
Hello Computer Science stackexchange, I am trying to make an object tracking system. I have a module for object detections which feeds into a object tracking module. However, due to objects sometimes not getting detected and a greedy tracking algorithm the output of these two modules end up with 68 objects where the gr...
What kind of search tree should I use in which I will have operation Rank[x, y] which will return number of existing nodes/values between x and y in time O(depth of tree) so the operations find, insert and delete will have also time complexity O(depth of tree)? I was thinking about a-b tree, which has find, insert and ...
I have drawn this transition diagram for the given language. Is this correct?
Which language class are today's modern programming languages like Java, JavaScript, and Python in? It appears (?) they are not context-free and not regular languages. Are these programming languages context-sensitive or decidable languages? I am very confused! I know that context-free is more powerful than regular lan...
There are two relations, registered(participant,topic) and fee(participant,amount). The primary key for registered is (participant, topic) and the primary key for fee is participant. The premise is that of an academic conference. The relation registered stores the names of the participants and the names of the topics r...
How can I construct a PDA which accepts the language $\{a^i b^j c^k \mid k\geq \min(i,j)\}$ I think about different solutions such as building a stack with two-state. one state is for $i < j$ and another is for $i > j$, But I think it doesn't work. also, The idea of poping and pushing a and b is not good. I tried it....
I am working on some time series problems where the Fourier representation of the signal in the frequency domain is also important. I am wondering if there is any connection between time series signals consisting of sinusoidal/inherently periodic functions (functions that can be cleanly represented by a sum of sinusoid...
Given an undirected graph with some cycles: we can "disconnect" the red vertex by adding a separate vertex to each of the edges adjacent to it: In this case, disconnecting a single vertex makes the graph acyclic. My questions: What is a term for the smallest number of vertices that must be "disconnected" like this, ...
I am reading the book Artificial Intelligence (A modern approach) by Stuart Russell and Peter Norvig. While reading the book, I saw the below sentence in the book. The Turing Test, proposed by Alan Turing (1950), was designed to provide a satisfactory operational definition of intelligence. Now the question is, what ...
I am trying to understand how a sparse table can be used as a prefix sum data structure for a bit vector. In the screendump below 1 the article [2] very vaguely describes how to use a sparse table from article "Storing a sparse table" to do this is $O(1)$ with space: $O(k\cdot loglogn)$. For simplicity, we can assume t...
If we have a language K, that word w=uv, accepts. $K= \{{w \in \{a, b ,c\}^*: \ \vert u \vert_a \ \text{is not divisible by 3}}\}$. Can we land strings like aaaa in final state? How does NFA decides to break up the string in this case, would it be u = aa, v = aa (w accepted) or u = aaa, v = a (w is not accepted). Or d...
Given an undirected graph G with weight on its edges and 2 different minimal spanning trees(MSTs): T, T' Then I want to prove the following: For every edge e in T that's not in T', there is an edge e' in T' that's not in T such that if we replace e with e' in T (let's call it T_new) then it's still a minimal spanning ...
I am trying to find as many pairs of elements as possible from two distinct data streams, while being constrained by the number of elements I can hold in memory at any given time. Once a pair of elements is found, it can be removed from memory. This problem feels like a streaming variant of the maximum coverage problem...
Where is there a gap or error in my reasoning? The subset sum problem deals with a set of n numbers, which is the result of lossy compression of an array r of numbers (r = (2^n)-1). The compression algorithm in brief: check if the size of the set r +1 is a power of two. If not, terminate compression check all combinat...
Consider the topmost part of a complete, balanced binary tree of all 64-bit numbers, exemplified here. As highlighted by the lack of a 7*2^64/8 term it is not necessarily full, but it is always complete. The nodes are stored in numerical order (in-order) in a list of which I know the size, and I have the index (call it...
I have a homework question that is as follows: L(P) is a language of ASCII input strings for which a given program, P, returns "yes". Is the set of all input strings P decidable, such that P is a decision program and L(P) is decidable? My intuition leads me to believe that the set is, in fact, decidable but I am having...
I have this Grammar below: Expr ::= Term "(" Term ")" Term ::= Ident | "(" Expr ")" Start symbol: <Expr> Terminal symbol: Ident ::= [a-z]+ And I wonder if it is possible to construct a recursive descent parser for grammar G2? I think this won't be able to do that?
I have a set of multisets $S = \{ X_1, \dots, X_K\}$ where $X_i \subset \mathbb{R}$. I need to find an optimal partition $L^*, R^*$ such that this $E(L) + E(R)$ is minimized. Denote $K(X) = \cup_{I \in X} I$, then $E(X) := \sum_{i \in K(X)} |i - \text{median}(K(X))|$, where $|.|$ is the absolute value. $X_i$ might con...
There's a floating point question that popped up and I'm confused about the solution. It states that IEEE 754-2008 introduces half precision, which is a binary floating-point representation that uses 16 bits: 1 sign bit, 5 exponent bits (with a bias of 15) and 10 significand bits. This format uses the same rules for s...
Is this statement true? For each two functions $f$ and $g$, where $f \in o(g)$, there exists a function $h$ where $f \in o(h)$ and $h \in o(g)$ Please note that I am using small $o$ notation.
I have an exercise question as follows: L is a set of all Turing Machine encodings for which the Turing Machine halts after a number of steps less than or equal to the minimum value among |w| and 1000, where w is the input to the machine I understand from my textbook that the problem of halting before 1000 steps is dec...
I'm struggling to think of the algorithm to transform one data set to another. The problem I'm looking at is creating a dataset of periods of time where cumulative days absent within a period (eg 30 days) is greater than a certain threshold (eg 14 days). I can easily determine what sub-periods are within master-period ...
In zero knowledge, in the context of graph 3-coloring, I do not understand how the prover is actually showing that he solved the problem. The context: both know the graph (the prover and the verifier) the prover solves a 3-coloring of the graph repeat: *the prover randomly permutes the colors *the verifier asks for ...
I'm trying to pack sets of intervals, to find distinct buckets of intervals. The buckets should not be overlapping. For example if I have these intervals: A: [ [0, 10] ] B: [ [1, 3], [5, 7] ] C: [ [8, 10] ] I want to get the following result: [0, 1]: [A] [1, 3]: [A, B] [3, 5]: [A] [5, 7]: [A, B] [7, 8]: [A] [8, 10]: [...
Given a directed acyclic graph G = (V,E). Suppose that the vertices are in topological sort, in particular there exist an edge $(u,v) \in E$ if u <v (see the graph below). The weight $w(u,v)$ on each edge is a positive number. For a given node $i$, I am interested in computing the following term $s[i]$ defined as foll...
I have the following algorithmen (picture) which calculates a Vertex Cover and gets an undirected $G(V,E)$ Graph as input. The following task is to find the possible Time complexity (estimate) while $n = |V|$, $m = |E|$, $n \le m + 1$ and $deg(v) = |N(v)|$: a) $O(n log n)$ b) $O(n + m)$ c) $O(2^n*m)$ d) $O(n^k*m)$ e) ...
I have an algorithm with this time complexity: $$ T(n) = O(n) + \frac{n}{\log n} \cdot \log \frac{n}{\log n}. $$ I tried to figure out how to solve this and I tried to say something like this : if I have $\frac{\log n}{n}$ then the value is going to be very small, if I switch between them the value becomes very big, so...
Does it make sense to represent an AST as a graph? How can one achieve a mapping between ASTs and graphs that preserves both semantic and syntactic properties of source code? The goal and application of such a transformation would be to use graph neural networks and other deep "graph" learning techniques to extracts fe...
Usually I see the term dialect for programming languages referring to small variations of a language, such as slightly different syntax or supported features in BASIC, SQL, or Lisp. I have also seen in the context of R that the "Tidyverse" set of packages form their own "universe" or "dialect" that is based on some com...
I've come across a question in Codeforces contest 719(Div - 3). The problem goes like this : I was able to solve the problem by using another approach but had to use 4*n auxiliary space, where n is the length of the input string however the solution given in the editorial is way more efficient The editorial goes like ...
Running these lines in Colab: import numpy as np size = 2**13 %timeit np.random.normal(size=(size, size)) print("-----------") %timeit np.random.normal((size, size)) yields: 1 loop, best of 5: 2.67 s per loop ----------- The slowest run took 7.05 times longer than the fastest. This could mean that an intermediate res...
A person wants to connect $n$ circuit points to the clock signal. Now, the clock signal is going to pass parallel to the x-axis and all those circuit points are going to be connected by vertical to the clock line. Suppose the widths of the vertical wires in the given diagram also vary varying. If the coordinates $(x_i...
In Python, this is a valid program def PrintWorld(): print('World') print('Hello') 0 'beautiful' True None 0 < 0 3, 3 lambda c:3 PrintWorld() All it does is print 'Hello World' on two lines. The expressions are 0, 'beautiful', True, None, 0 < 0, 3, 3, and lambda c:3 are ignored and I'm wondering why. I realize th...
TL;DR Is there an existing algorithm for dividing W works each with priority P using T threads? If there isn't, could you direct me to a solution? Expansion given: W - amount of works [0,Infinity) P(w) - priority [1,10] T - available threads [0,Infinity). N(w) - "neighbors" of a work w in its thread There is an inverse...
I am a beginner in graph theory and just found this question in a book after completing few topics and I was wondering how you approach this questions. For eulerian, I can say that the graph has vertex with odd degree hence not eulerian, but how can I determine if they are hamiltonian or not?
I tried to solve Longest common subsequence problem using recursion, however as I later discovered, my thinking approach was wrong. I took 2 strings say s1 and s2 with lengths l1 and l2, s1="ABDEH" s2="AEBFH". I created a decision tree. My reasoning was that if s1[l1-1]==s2[l2-1] then I have 2 choices: to include or no...
So, a circular linked list is a linked list where the next pointer of the last node points to the first node (forming a circle). Now, a linked list comes with some standard methods, like size()/length(), toArray(), or traverse() (print out the nodes). Clearly, the implementation of the above (and related) methods, depe...
I have the following claim: Prove or disprove: If a key in a red-black tree has exactly one child (which isn't null) then it is always red. My attempt: Disproof. We will exhibit a counterexample: This tree satisfies the conditions of being a red-black tree, since: The root is black. All leaves are black. There isn...
I know there's like a thousand questions about this topic in the site and elsewhere. I'm just going to pick one that at least for me it serves as a good basis for my question. The answer by Rick Decker is the one that I understood more, so I'm just going to take it as a basis for my actual doubt. It's not difficult to ...
Say I have a binary number of N bits, and I need to find every combination that have M 1's. For example, if N = 3 and M = 1, then 100, 010, 001 are the allowed combinations. I have read that a more efficient way of finding these combinations for large N is by dividing the bits into two halves, and then combining combin...
I have basic understanding of file I/O. I know how to operate the read and write system calls in Linux. I know that there is blocking and non-blocking I/O. I want to know more about the underlying mechanism in OS for I/O. How is blocking and non-blocking I/O implemented? How do the kernel I/O buffers work? How big are ...
Consider two bivariate polynomials of degree at most $n − 1$ in each variable: $$ F(x,y) = \sum_{i,j=0}^{n-1} f_{i,j} x^iy^j \quad\text{and}\quad G(x,y) = \sum_{i,j=0}^{n-1} g_{i,j} x^iy^j $$ Show how to compute the product polynomial in $O(n^3 \log n)$ time. Can anybody briefly explain the solution please?
Given an array of integers I have to return true if all the elements in the array are different or all the elements are the same. Otherwise, I have to return false. E.g. [1, 1, 1, 1] - all the elements are the same, so it is true [12, 20, 1, 23] - all the elements are different, so it is also true [12, 20, 1, 1] - we h...
I'm solving Problem 11-10(b) in "what can be computed". 11.10 Consider the decision problem HALTSINSOMEPOLY (HISP), defined as follows. The input is a program P, and the solution is “yes” if and only if there exists some polynomial q(n) such that, for every n, P halts after at most q(n) steps on all inputs of length ≤...
I have to write python code in jupyter due to sampling bivariate normal distribution with 3 sampling methods: Prior Sampling Gibbs Sampling Rejection Sampling I have done the first two samplings and I also have clear understanding of what accept reject method or so-called rejection sampling is. yet I can not find any...
I have been reading Michael Sipser's Introduction to the Theory of Computation, and I have stumbled upon a paragraph in Chapter 8 (Theorem 8.9 on page 339 of the 3rd international edition) that I simply do not understand. For context, TQBF is the language of all first-order logical formulas in prenex normal form that a...
Assume we have PDA that accepts a specific symmetric language on $\{a,b\}^*$. if we have $a$ This side of the string, on the other side of the string we have $aa$. and if we have $b$ This side of the string, on the other side of the string we have $bb$. Examples of words in this language (middle point emphasized): $ab\...
I have to handle large binary dataset. That is one of the reasons I have to build my own Hierarchical Clustering. As I digged into the algorithms I was surprised and not ;) to find that it is possible to have multiple (not just two) vectors that have the same distance (hamming,overlap,...), so you can pair them differe...
problem $T(n) = 3T(n/4) + n \log n$ $f(n) = n \log n$ and $g(n) = n$ Why is $\Omega(g(n)) = O(n \log n)$? Is it because $\Omega$ means at some $n$ and constant, $\Omega(g(n)) = O(n \log n)$?
I'm stuck on the following question that I am trying to use for revision purposes. The question states that the data transmitted is 1001101, however, during transmission the second bit has an error and is received as 1 instead of 0, thus the data is 1101101. I need to use the hamming code to detect this error, however,...
I want to construct a context-free grammar for $$L=\Sigma^*-\{ab \mid b=\mathrm{complement} (a) , a,b \in \{0, 1\}^*\}$$ and prove the correctness of answer. The complement of a string is obtained by switching $0$s and $1$s. For example, $\mathrm{complement}(001) = 110$. I'm trying to decompose the language but I'm no...
One of the finer points of amortized analysis about which I have been able to find relatively little information is the broad question of what happens to the amortized cost of a structure's existing operations if we add a new one. I'll use two popular examples to illustrate my confusion: In a binary counter which only ...
I was pretty confident that I understand asymptotic notation until now. However, I am having a hard time understanding some basic definition that use asymptotic notation, specially little-o. Definition 8.1.A mechanism is blatantly non-private if an adversary can construct a candidate database 'c' that agrees with the ...
Notation: $M$ is a DFA; $L(M)$ is the language accepted by $M$; $\min(M)$ is the minimal automaton equivalent to $M$ derived from a minimization algorithm such as the Hopcroft algorithm; and $|M|$ is the size of $M$: the number of states in $M$. We are given the alphabet $\{0,1\}$ and some $n \in \mathbb{N}$. Let's def...