instruction
stringlengths
35
29.1k
I'm working on this task: Prove that the following problem can be solved in time $2^{k} \cdot \Vert \varphi \Vert^{\mathcal{O}(1)}$: given a boolean formula $\Vert \varphi \Vert$ in CNF, decide whether there exists an assignment that satisfies at most $k$ clauses of $\varphi$. but with very little success so far. I'v...
I'm trying to come up with a context free grammar for the following language: $${\{0^i1^j0^k1^l0^m | i, j, k, l, m \ge 0, i \le k \text{ or } j = m \text{ (or both)}\}}$$ I'm able to come up with rules for the $i ≤ k$ case and I think the $j = m$ case but the both case is killing me.
I recently had the idea that it would be neat if it were possible to make a SAT solver play combinatorial games. To start, I'm trying a relatively simple case of solving single-stack Misère Nim through integer programming: there's a fixed limit $L$ with a set of moves $N$, where a move is added to the state each turn. ...
Every context-sensitive language $\subseteq \Sigma^* = \{a,b\}^*$ can be expressed using an essentially non-contracting grammar. With just one non-terminal symbol, we can't express all context-sensitive languages. Does there exist a minimum $k$, such that all context-sensitive languages can be expressed as a non-contra...
I'm currently learning about Data Structures and Abstractions and one particular problem has been very confusing to me, and that is the concept of Circular ArrayDeque. In particular, how can we add or remove elements at the first and last of a circular Arraydeque? I've learnt a few things so far and listed them down be...
I have an async process that receives a message then post the content to another service and acknowledges the message. To improve on the efficiency I want to batch the messages together, but can't request more than 1 message at a time from the external service. Therefore I want to create a buffer in code to batch up th...
Define the following function to be the count of integers not greater than $L$ that are coprime to $n$:$$C(n,L)=\sum_{k=1 \atop {GCD(n,k)=1}}^L1$$ Then I am interested in the following sum: $$S(x)=\sum_{d=1}^xd\cdot C(d,\Big\lfloor\frac xd \Big\rfloor)$$ $C$ can be calculated relatively fast given the prime factorizati...
With dependent types, types can be statements that are true or false and constructing a value with that type constitutes a proof of that statement. This proof/value construction is itself a program that can be run (which I think encapsulates the Curry-Howard Equivalence idea), but often these programs are not very "use...
I'm scheduling a large invitational tournament with the following conditions The event takes place over 8 weeks Teams arrive and depart on different dates/times, so each day of the event will have a different number of teams available to play Teams will play only once per day Teams have specific criteria they ask for,...
Regular expressions are a powerful practical tool for string processing. But there are simple examples of useful string processing tasks (like, say, removing brackets from an expression (E) -> E when E might itself contain brackets) which cannot be represented by a convenient regular expression. Is there a language of ...
so I know that this language is not regular, however, can you still define the language using BNF? This is the problem: {a^n b^n |n>0}
So I recently came across a question in my Algorithms class. Given a binary matrix of N X N. we can do following operation any number of times we can take a square of size M X M (1 <= M <= N) and convert all 1's to 0's in this submatrix this operation costs M coins we have to convert all 1's to 0's in least amount of...
I am struggling to find a good loop invariant for the following function, which returns a^b where a is a real number and b is a natural number: power <- function(a, b){ c <- 1 while(b > 0){ if(b %% 2 == 1){ c <- c * a } b <- floor(b / 2) a <- a * a }...
My (attempt at a) proof is as follows: $f\in o(g)$ means that $\forall c>0 \exists n_0 \forall n\geq n_0: f(n) \leq cg(n)$. Now taking the complement we get: $\exists c>0 \forall n_0 \exists n\geq n_0: f(n) > cg(n)$. Fixing some $c'$ satisfying the above and $n_0=0$ we get some $n_1 \geq 0$ where $f(n_1) > cg(n_1)$. We...
I'm trying to read chapter one of the famous book : Structure and Interpretation of computer programs. The chapter one starts with a mysterious paragraph: We are about to study the idea of a computational process. Computational processes are abstract beings that inhabit computers. As they evolve, processes manipulate ...
Is it possible to prove the total number of parenthesizations of n matrices is Ω(4^n/n^3/2) using the Induction Method? Recurrence formula from CLRS book When n = 1, the sequence consists of just one matrix, and therefore there is only one way to fully parenthesize the matrix product. When n ≥ 2, a fully parenthesized...
A question I was given $T(0) = 1,$ $T(1)=0,$ $T(n)= 2T(n-2)$ I think the possible solution is $T(n)=2^n$ Proof: by induction. Base Case: $n=0$ $T(0)=2^0=1$ Inductive Hypothesis: Assume for some $n$. $T(n)=2^n$ Show for $n+1$ $T(n+1)= 2(T(n-1))$ $=2(2^{n-1})$ $=2^n$ which is what I proposed. Is this correct? I'm a littl...
The idea for this problem comes from GATE CS 2014 Set-3 Q13. Given a graph, are there any heuristics to figure out a DFS traversal which has minimum/maximum recursion depth? Consider the graph from the question, labelled Consider the DFS traversal a-b-c-f-e-d-g-h-i-j-k-l-m-n-q-p-o-r-s-t-u with a recursion depth of 19....
CLRS pseudocode: begin for each vertex u in G.V - {s}, do u.color := white u.d := infinity u.p := NIL done s.color := green s.d := 0 s.p := NIL Q := NULL insert s into Q while Q is not null, do u = delete from Q for each v in adjacent to u, do if v.color = ...
Show that the language $\{0^n1^m0^n| m,n\in \mathbb{N}\}$ is not regular using closure properties. I tried showing this using pumping lemma but I am stuck when it comes to closure properties. Please help me out!
Consider a data structure that has only two functions. extract_lowerthan_median() and insert(). How can we design it in a way that the amortized cost for both the operation is O(1)? Using a 2 tree, a min heap and max heap will ensure that the root of min heap is always the median and allow us to extract an element smal...
I am trying to understand what an algebraic decision tree is but wikipedia lacks a formal definition, just an intuition. So I need to check if my understanding is correct. From what I have read it seems that an algebraic decision tree is: A tree where each node has exactly 2 children. Each node in the tree is a polyno...
Let $v_1,…,v_n$ be a finite list of vectors in $ℝ^k$ (with $k ≪ n$, in my case $k≈10$ and $n≈4~000$). I would like to know if I can precompute something so that given a linear form $f : ℝ^k→ℝ$, I can quickly get the $i$ maximizing $f(v_i)$. If $k=2$, I can do that with a convex envelope and a binary search. But even fo...
I have seen many posts which were related to algorithms for solving an N⨯N puzzle, but I could not figure out the time complexity or memory complexity in these algorithms, especially when we want to apply DFS and BFS for solving our puzzle. For example, if we assume that at first, the elements are not at their place, b...
I'm looking for some machine learning algorithm to train on data that are sampled from some submodular set function and I want the learned model predictions also obey submodularity. For example linear regression can do this (because it's linear hence it produce a model that obey both submodularity and supermodularity) ...
I've recently been designing a simple 8-bit microprocessor, similar to the Intel 8008. It doesn't make use of anything advanced as pipelining, as my knowledge isn't at that level yet to know how to implement it. The address length of 14 bits, and an instruction lengths ranging from 1 to 3 bytes. I've been researching, ...
The question is basically the title. If two NP-Complete problems reduce to each other, do we know that the reductions take equal amounts of time? What about space? Does this apply for all 'invertible' reductions?
I am studying graph algorithms, and I know that in algorithm theory there has to be an invariant of sorts that stays the same during the algorithm run that makes the algorithm valid and right to use. But I can't seem to find the invariant in Kosaraju's algorithm for finding strongly connected components. What is it tha...
I have a list of companies with n timeslots (number of slots may vary from company to company) and a list of students. Each student made a list of their top 3 companies they would like to talk to. Is there an algorithm to efficiently match those students to timeslots, taking the student's preferences into account? I al...
This is a bit of a theoretical question. I would like to know how to call the principle described below, in proper computer science terms, or math terms. Let's say we have a database in which one entity is split into two tables: main and meta. The main table is a matrix where rows are instances (for instance each row i...
On a turing machine and in the lambda calculus one can define transcendental numbers such as Pi, the golden ratio, etc. These are computatible functions with 0-arity that never terminate. In the theory of general recursive functions (which also defines the same class of functions as turing machines and lambda calculus)...
An undecidable problem is a decision problem proven to be impossible to construct an algorithm that always leads to a correct yes-or-no answer. I wonder if there are examples of probabilistic approaches (in the following sense below) that solve such problems. By a probabilistic approach, I mean a nondetermistic algorit...
The halting problem is semi-decidable. Does that mean that: If a program terminates it can always be established/determined? If a program does not terminate It can sometimes be established/determined? It can sometimes not be established/determined? When we write programs we can clearly proof in some instances that...
Non-computer scientist here, trying to understand what SICP (Structure and Interpretation of Computer Programs) means by a procedure, whether it matches the dictionary definition, and also how a procedure relates to an algorithm (so maybe I should ask separate questions). First, SICP defines a process: We are about to...
I wonder if there are "standard" models of computation that are less powerful than DFA that are still "mathematically interesting"? It is evident that restricting the set of DFAs in various conceivable ways easily yields examples, but would any of those generate considerably interesting mathematical questions?
Given a known strongly NP Complete problem $A$. If there is a polynomial time transformation from $A$ to another problem NP Complete problem $B$ does that imply anything about if $B$ is always/automatically strongly NP complete or not? I don't think that it is necessary that $B$ is always/automatically strongly NP Comp...
The halting problem is semi-decidable, which means that if a program terminates then it will always be able to be determined. Some programs can be proven to terminate without running them, with say: induction typed theories, such as typed lambda calculus. Ackermann function Are there some programs for which there is ...
I have consulted the literature concerning graph isomorphism algorithms, and all papers I could find involve finding a canonical representation of a graph. So to decide whether two graphs are isomorphic, you just check if they have the same canonical representation (i.e. the same equivalence class). There is, also, an ...
I found a one question I wonder, but there is something to be clear about. The link is https://electronics.stackexchange.com/questions/56488/parallel-multiplication-hardware/56518#56518 Q1. In his answer about the question, how can I make a 16 LSB bits by the time I get to the input of the fifth tier. I think 1 bit bef...
In order to show that the next problem is NP-hard: Problem: Vertex Cover and Independent Set Input: Graph G and integer k Output: Does G have a vertex cover of k and an independent set of k? The sets does not have to be complementary (just about size k). I have tried to reduce Vertex Cover but I cannot find how to ensu...
The halting problem concerns programs which take input. By framing the halting problem on the diagonal argument it is clear why this is so. What about programs with no input, constant functions. Can it always be determined if they terminate?
Classic searching algorithms such as binary searching and dictionary searching search sorted arrays based on a given element and make estimations on their own. What I'm looking for is a list of more such algorithms to solve the generic problem- given a sorted array, find an element $x$ present in the array. I'd like to...
Suppose you are given a bit string $B[1 ... n]$. Now, suppose that some bits are just padding bits conveying no information, the rest of the bits may be permuted and some meaningful (that is, non-padding) bits should be inverted from $0$ to $1$ and vice versa. According to my intuition, the total number of interpretati...
In a text file you can write both the letter 'A' and number '65'. But obviously one of these data will be saved with different bits while the ASCII standard gives the letter 'A' the binary code for 65. Does a .txt file use some sort of container for different interpretations of binary? How does this work?
I'm looking for the name of the family of algorithms whose exact runtime is dependent only on the size of the input. An example of such an algorithm would be naive $O(n^3)$ matrix multiplication. If we know $n$, we know exactly how many operations it will execute and how many cycles it will take to complete (ignore rea...
I am sure this question has been asked, but I was unable to search for it in a manner that would give me the solution. So I will present it here. I seen this in another database years ago, and I want to implement it in one of my apps. It is perfect: Pets 1. fish 2. dog 4. cat 8. monkey 16. mice 32. snakes 64. rock If ...
0 I am learning about the instructions-set in my computer science course, and I am wondering if it is possible to split an instruction into more than four sub-instructions. Thank you
Caveat. You have to show this specifically by showing there exists an infinite set that is pairwise distinguishable with respect to L. This question was on a quiz which we had 12 minutes to complete (this wasn't the only question!) I can see that this isn't a regular language but I cannot come up with any set that is p...
Is there a formal definition of a 'Quantum Turing machine'? I am mainly interested in how the tape position would move. https://en.wikipedia.org/wiki/Turing_machine https://en.wikipedia.org/wiki/Quantum_computing
The Graph Isomorphism Problem is a classic in Computer Science. In its decision version $(DGI)$, we are given two graphs $G$ and $H$ and we are asked if there exists an isomorphism between the two. In its function version $(FGI)$, we want to produce in output the found isomorphism (if it exists). It is a (in)famous ope...
Could one use the Radix Sort to find the Longest Common Subsequence problem? I am new to algorithms and was wondering if the string was converted to a list and then one was able to apply Radix Sort and instead of sorting able to search for the longest common subsequence by matching up the positions. Or would this be an...
I am looking for the fastest algorithm (in practice) to multiply two polynomials $f(X)\cdot h(X)$ in $\mathbb{F}_p[X]$. The prime $p$ is roughly $256$ bits but the integer $p-1$ might not have any large smooth divisors. The polynomials are of degree less that $2^{30}$. In the absence of large $2$-power roots of unity i...
In several explanations of coinductive definitions (for example, in the answers to What is coinduction?), we're told that while an inductive definition gives us the smallest set with a specified set of properties (the constructors), coinduction gives us the largest set such with a specified set of properties (the destr...
In CLRS it is stated that the class $\mathcal{H}_{p, m} = \{ h_{ab}:\mathbf{Z}_p \to \mathbf{Z}_m \mid a \in \mathbf{Z}_p^*, b \in \mathbf{Z}_p\}$, $h_{ab}(x) = (ax+b) \mod p \mod m$, $m < p$ prime has $p(p-1)$ members. However, I don't see why some of these functions couldn't turn out to be the same. I've investigated...
Let $ A $ be an array of $ n $ integer arrays with unknown lengths and $ s \in \mathbb{Z} $ a given number. I want to find the number of combinations of numbers from each array, such that their sum is $ s $. In set theory terms, if I have $ n $ tuples, $ A_1, A_2, \ldots A_n $, I want to find all $ (a_1, a_2, \ldots, ...
I am trying to find the language generated by this context-free grammar S → aSb | bbY | Yaa Y → bY | aY | ε I understand that one way to solve is this to find set of strings that satisfies this grammar, But I don't see a common pattern in those strings. Some of the strings that belong to this language are aa,bb ...
This and this agree that there will be near 100% false positive rate with Bloom's filter should number of elements in the set ($n$) be greater than the number of bits in the filter ($m$). E.g. if $n=100$, $m=10$ with a single hashing function $k=1$, then we get a probability of false positives worth: $$\begin{split} p ...
I am wondering about this small question, why aren't these regular expressions equal? $(a+b)^* a^*$ and $(a^* b)^* a^*$
The expected running time, $T(n)$, of quicksort when the pivot is chosen uniformly at random satisfies $$ T(n) \leq \mathcal O(n) +\frac{1}{n}\sum^{n-1}_{i=0}(T(i) + T(n - i)),$$ which leads to the known bound of $\mathcal O (n \log n)$. Suppose we consider the following procedure to discard bad pivots: after sampling ...
Why isn't it possible to have P=NP, but not all problems in P are in NP-hard? The diagram of the various classes would look something like: We have P=NP, but not all problems in P lie inside NP-hard. The intersection of P and NP-hard is still NP-complete. Lander's theorem seemed relevant, but it holds when P != NP whi...
Why do you think the Immediate type instructions are limiting its immediate values to only 12 bits, while upper immediate type instructions can handle immediate values of 20 bits.
I am new to Hough transform, though I have some basic idea about it. I am currently trying to fit the best line to a cluster of points $\left(x_i, y_i\right), i = 1,2,\cdots , N$, where there are many outliers, as well. The true points have very low noise. So, the main issue is to correctly identify outliers and rejec...
I started wondering this after reading about the x86-SSE instruction rsqrtss being faster (and more accurate) than the Fast inverse square root. I have also read about other specialized hardware instructions that replaced staple software algorithms for better performance. Can a specialized hardware instruction generall...
Some sources state that an algorithm that solves the SAT problem not only needs to decide whether a given existentially-quantified formula is satisfiable or not, but, additionally, in the case where the formula is satisfiable, it does need to provide a satisfying assignment. Is this true or not? I am bit confused, sinc...
I'm taking a Theory of Computation class and we went over the proof to show that for any NFA there is an equivalent DFA, which I understand the proof fully in this case. But if it were in reverse, for example, "For any DFA, there is an equivalent NFA," how different would the NFA -> DFA proof be to the DFA -> NFA proof...
My minimax graph search has considered three options at the root level of a graph. The first option, A, yields a solution with cost 10. The second option, B, was not fully investigated. It has a solution with cost 20, and the lower limit to any possible solution is 15. The third option, C, was also not fully investiga...
I'll start with some definitions to simplify the rest of the message. Let's denote $f_0 = b, \ f_1 = a, \ f_n = f_{n-1} \cdot f_{n-2}$, where $\cdot$ stands for concatenation of two words. We call $f_n$ the $n$-th Fibonacci word. Let's also denote $f := \lim_{n \to \infty} f_n$ (the Fibonacci word). Let $s_{k}$ be the ...
Subset Product Problem is $NP-Complete$. Given a promise that the product contains exactly 1 occurrences of each of its prime factor is the problem still $NP-Complete$? Seems to be the case but couldn't find any references. Can someone confirm?
Let's say we have some distinct sets each containing a number of line segments. I want to choose the minimum number of sets such that I will obtain a line from 0 to L with the largest gap being X long. For example, let's say we have the sets A, B, and C as given below. L is 45 and X is 4. If we take A, there is a gap f...
Is the problem of communication with a pre-shared database studied? If yes, what field studies it, or which researchers work on it? Let there be two parties that want to share multiple yet-to-be-defined messages. These parties want to compress future communication as much as possible. For that, they first define some p...
Apologies for the vague title. This decision problem has applications to graph coloring but I have not found a name for it in the literature. I am trying to improve my algorithm for a decision problem. The problem input is a graph and hypergraph which have the same vertex set, $(V, E, H)$ where $V$ is the set of vertic...
In two unsorted arrays (say $A$ and $B$) such that all items of $A$ belong to $B$ ($A \subset B$), find the smallest item in $B$ that doesn't occur in $A$ in linear time. No hashing or linear time sorting is allowed. I can solve this question when $A$ and $B$ are sorted. However, the question states $A$ and $B$ are u...
Description This is an exercise for Formal Language course, I'm asked to find a grammar for language: $L = \{ 0^i1^ic0^j1^j | j = i+1 \}$ As an example: 01c0011 can be generated using this language, so does 0011c000111. What I've tried The difficulty is around the j = i + 1 controlling, I've tried something like this: ...
There's this problem that I was solving and even though I have an O(n) solution but still trying to make sense of the pattern. The problem being: determine the number of pairs of the same numbers. For e.g for an array [1,2,3,1,2,1]. The 4 possible pairs include: [1,1] // index (0,3) [1,1] // index (0,5) [1,1] // ind...
Suppose that I have two random processes. Process $X$ has probability 0.5 to be in state A and probability 0.5 to be in state B. Process $Y$ has probability 0.4 to be in state A and probability 0.6 to be in state B. State B has two substates: $B_1$ and $B_2$. For both processes, the two substates are equally likely. No...
I used a vector to determine the collision between a line and a circle. Here's the way I thought of it in the beginning. 1. When the ball collides with a straight line, it finds a normal line passing through the center point. 2. Take the coordinates before the ball collides and move symmetrically with respect to the no...
So, I have a set of 2D points with real valued positions. I want to find a set of N adjacent unit squares that contains the most points possible. If it's easier, this could be a set of N adjacent (or overlapping) disks. Any idea how I could do that? Thank you :)
During the run of Ford Fulkerson algorithm if we label each vertex with d(v) where it means the shortest path distance from source to vertex v in residual graph. Is it possible that for some vertex this value decreases at any execution stage? I tried to find such an example, but it seems the vertices are getting away a...
There is a classic linear algorithm to find every cut vertex (AKA articulation point) in a graph. I have a usecase that does this computation after every time a non-articulation-point is inserted or deleted. An articulation point is never deleted (but may become non-articulation then deleted later). Is there some incre...
Suppose that $X\in\mathcal{X}$ is data in abstract space and $Z\in\mathcal{Z}$ is random noise vectors in latent space over a defined prior $P(Z)$ (e.g., Gaussian). Then, let $G$ and $D$ denote generator and discriminator. In a generative adversarial network (GAN), we train $G$ to generate samples $G(Z)$ through advers...
Can I define a complexity class $\mathsf{C}$ by giving a language $L^\prime$ and stating that $L^\prime$ is $\mathsf C$-complete? Specifically, a language $L$ is in $\mathsf C$ if there is a reduction from $L$ to $L^\prime$. If so, are there any common (i.e., well-studied) complexity classes that are usually defined th...
Let $X=x_1,x_2,x_3,\dots,x_n$ be set of $n$ distinct keys. I read this posts about Randomly build binary search trees like this and now I encounter the following question in my mind, suppose we generate a random permutation $X'$ from $X$ and we insert first half of $X'$ in empty binary search tree $T$. Also we sort s...
Since strings are finite by definition, then it follows that languages are enumerable because they are finite string sets and we know that finite string sets are enumerable. Turing Machines are enumerable, because each Turing Machine has a finite string description. Therefore: If all languages are enumerable, and we k...
I'm trying to randomly allocate N indistinguishable items over B indistinguishable bins with unlimited capacity. Each allocation should occur with equal probability. An allocation identifies the number of balls in each bin, and two allocations are equivalent if you can obtain one by permuting the other. At first, I th...
I am working on a project for the prediction of preeclampsia, and one of the algorithms to be used is the convolutional neural network. I am a beginner in machine learning, and I am struggling to find out "whether is it applicable to use the convolutional neural network for numerical data. without the need to convert ...
Hello Folks, I am facing hard time in understanding this, basic question which says, how many possible finite automata ( DFA ) are there with two states X and Y, where X is always initial state with alphabet a and b, that accepts everything? What i understand is: Number of possible inputs possible: (a,X), (a,Y), (b,X),...
I'm trying to solve this recurrence relation: $T(n) = T(\frac{n}{2}) + T(\frac{n}{5}) + T(\frac{n}{10}) + c_1n$ ; n > 1 $T(n) = c_2n$ ; n = 1 My first thought was to combine the fractions and solve through the Master Theorem. Would this approach be enough to calculate a tight bound, or are there any other approaches ...
Are all non-context-free language infinite?
I am looking at a problem where I have an assembly/collection of items, V, and my goal is to issue an ID to this collection, such that: this ID uniquely identifies V, aka a change in V results in a change in the ID of V (much like a hash function), given V, I can generate the ID and, given the ID I can work out which ...
With the purpose of proving my problem NP-hard, I'd like to reduce from a SAT variant (which of course should remain NP-hard) in which not two parameters are present (typically $n$ clauses and $m$ variables) but only one, so $n$ clauses and $f(n)$ variables, for some function $f$. I've tried to look up 3-SAT (SAT with ...
Our test log files are stored in .asc format. Each file contains around 5000 rows of these Logging Strings as shown in the image. I would like to reduce the size of these files.They are around 4-5 MBs each bringing the total folder size for one test run around 700-900 MBs. The files are output from the system in only ....
I have multiple functions as shown in the image. For a fixed x value, I need to distribute it into f, g, and h functions for getting the maximum output (y). In other words, having a fixed x value, find a, b, and c in which these conditions are satisfied: a + b + c = x a >= 0 and b >= 0 and c >= 0 f(a) + g(b) + h(c) h...
we say that a constructive axiom is an equality axiom $u = s$ : whose left member $u$ is a pattern, whose right member $s$ is any term whose variables are all appearing in $u$. and yet we say of $suc(i + j) = i + suc(j) $ is not constructive, Ok, and this $dump(push(e, s), t) = dump(e, push(s, t))$ is constructive. B...
For the purpose of this post, let $k$-SAT be SAT with exactly $k$ literals per clause, as opposed to the more common meaning of at most $k$ literals per clause. With the purpose of proving some problem NP-hard, I'd like to reduce from a $k$-SAT variant (which of course should remain NP-hard) in which each variable occu...
For example (and this is not my use case), imagine there is a set of 50 000 random natural numbers represented in decimal with 8 digits (in the range 00 000 000 to 99 999 999). We could index the set with an index for each digit position (i.e. an array of pointers to all numbers ordered by their fist digit, another one...
On the one hand it does not belong to NP problems because it simply is not solvable and is undecidable and on the other hand it is an NP problem because there are claims that it is NP-hard and therefore can be reduced to NP and is an NP problem. My question, does the halting problem belong to NP?
The binary expansion of a given real number can be encoded as an amplitude using the inverse QPE. Together with Amplitude Amplification, I wonder if this could indicate that the (some weakened?) trichotomy of the real numbers is physically effective. I think the crux of the question is that these assumptions that "th...
What is the asymptotic relationship between $\frac{1}{n}$ and $\frac{1}{2^n}$? The answer here mentions that both functions are $O(1)$ (because they are always $\leq 1$) but not $\Omega(1)$ (because the functions will not be always greater than any constant $c>0$, as both are eventually 0). Thinking of it using limits:...
I am trying to recognize a particular language, L= {a^n b^k | n<=k<=2n} and according to me it should not be CFL, as i can see two comparision i.e. firstly number of a is compare to keep count less than equal to k, and secondly for count of b that should be less than twice n. My question then how it is still CFL?? Than...
In "Introduction to Algorithms" by Cormen et al. the Potential Method is explained. For example, we have the following representation for the amortized costs of the i-th operation with respect to the potential function $\Phi$: $$\hat{c_i} = c_i + \Phi(D_i) - \Phi(D_{i-1})$$ The book also states that for each $i = 1,2,....