instruction
stringlengths
35
29.1k
I have two lists: Location list, it contains point of interest People list, it contains coordinates of every person. One single person could be in the list multiple times, depending from the log time. Someone who is out for a walk will result in two different locations in two different hours. I would find out what p...
Let EVEN-CFL $=\left\{w | M_{w} \text { is a } \mathrm{TM}, \text { such that } L\left(M_{w} \right) \\ \text{ has only words with even length and is context free.}\right .\}$ Question : Is EVEN-CFL decidable? Am trying to learn this type of proofs Now the Rice-Theorem states, that semantic properties that are non-triv...
Who has published an answer to these problems? An isomorphism signature is a function s on the set of all trees with the property that s(T1) = s(T2) if and only if T1 and T2 are isomorphic. Define such a signature. Many thanks Keith Paton Independent researcher
Let $A\in\mathbb{F}_2^{m\times n}$ and denote its nullspace as $V=\{x\in\mathbb{F}_2^m:xA=0\}$. The weight of a basis $B=\{b_1,\dots,b_l\}$ for $V$ is the total weight of vectors in the basis, denoted $|B|=\sum_{b\in B}|b|$, where $|b|$ is the Hamming weight of vector $b\in\mathbb{F}_2^m$. Out of all bases for $V$, som...
I want to come up with a counter example that proves the following greedy algorithm doesn't work and give an alternative correct algorithm. The problem is I have an array of numbers and I want to reach the last element of the array in the minimum number of steps. At each step, I can move to any element with the same va...
I know get how logical operators for if logic gates work, but I am trying to understand how while loops fit into that picture. I realize that this question is a bit vague. It all started because I was wondering if one could write a while-loop with a series of if statements. Then I realized there had to be something dee...
I try to find out what is the time complexity of this program: for (int i =0; i < n; i++) { for (int j = i+1; j < n; j++) { //Do something O(1) } } I tried to find any explanation, As I see, it something like Arithmetic progression sum (n(n-1)/2). Is it? or it's just O(n^2)
I've just implemented a Trie and I thought it would be a good idea to store strings in the Trie nodes in contrast to storing single characters. Storing strings is for sure more space-efficient and one needs to make less jumps between nodes. However, I think it might be way slower. For example, if you wanted to use a tr...
In my lecturer's notes, the following definition for a 2-CNF wff is given: A 2-CNF formula, or Krom formula is a CNF formula F such that every clause has at most two literals. However, there is no mention in the notes of how one might represent clauses containing a single literal L in the wff's corresponding implica...
I have to implement a compiler for a given language as part of an assignment. The language is kept simple enough such that it can be fully expressed through REs. My question lies with two of the REs provided: DIGIT := [0-9]? INTEGER_LITERAL := DIGIT DIGIT* When I saw the RE for INTEGER_LITERAL I sort of thought to my...
An (unweighted) $k$-spanner of a graph $G$ is a subset of edges $S$ such that the distance between any two vertices of $G$ when using only edges in $S$ is at most $k$ times the distance in graph $G$. The goal is to find a small set $S$ that satisfies this constraint. Recently, I've looked at some algorithms for this p...
I am given a task, where exactly 50% of the work is parallelizable. When applying Amdahl's law to calculate speedup when using 2 processing units instead of one, I get a different result than the one I get when calculating the same speedup using Gustafson's law. I don't understand why is that.
Problem I would to solve Perfect Matching in Bipartite Graph Problem where some edges are mutually exclusive. Example Left vertices: $a,b,c$ Right vertices: $x,y,z$ Edges: $(a,x),(a,y),(b,z),(c,y)$ Exlusive pairs: $(b,z)$ and $(c,y)$ Answer: no perfect matching Question Is the problem in P or NP? Solution Attempts I kn...
What is the difference between a Bus clock and a System Clock? Do they function the same way? I have been reading about System clocks but I can't really find anything about bus clocks in my book to compare the two.
Assume $L_1$ is a regular language, and define: $$L = \{wcv ∈ \{a, b, c\}^* \mid |w|_a + 2|v|_b ≡ 3 \bmod 5, w, v ∈ L_1\}.$$ Show that $L$ is regular. I first tried to prove by showing that the pumping lemma holds true, then learned that it was not a double implication and can only be used to prove languages are not ...
In Jeff Erickson's Algorithms textbook, the chapter on Dynamic Programming asks you to "Describe an efficient algorithm to compute the length of the shortest oscillating supersequence of an arbitrary array A of integers". A supersequence contains all of the elements from the original array X[1...n], and oscillating is ...
As you all know the ASCII chart needed to be extended from 127 encoding to 256, I can't really see why. Some google expert on Coursera said "We needed that because of the foreign languages". I still Can't understand what that has to do with the ASCII Chart. Can anyone explain the full story?
I need to analyse a directed graph (not a DAG) but I don't know the name of the algorithm I would need to use. The graph has many cycles. My desired behaviour is: given a graph source and graph sink, find the longest path by number of edges, excluding cycles. By graph source, I mean a vertex with one or more edges to o...
If we can build up a heap with time O(n), can we take down a heap also by O(n)? (by delete-max repeatedly). Intuitively, it may feel it is, because it is like the reverse of build it up. (Building a heap can be O(n) -- in Wikipedia). If building a heap is O(n) in the worst case, including the numbers are all adding by ...
I've been following Greedy algorithms in the textbook Jeff Erickson. Here is the following Question I was stuck in proving Proof of Correctness for the following variant of the standard Activity Selection problem. For each of the following alternative greedy strategies, either prove that the resulting algorithm alway...
Using 2SAT and implication graphs, how could I prove the following properties of implication graphs: Suppose there is a directed path between literals l1 and l2 in G_φ. Then there is also a directed path between their complements. Then, there is τ, a truth assignment satisfying φ where τ(l1) is true, then τ(l2) must...
While dealing with quantum finite automata (QFA), I repeatedly come across the statement that measure-many QFA (MM-1QFA, KW97) are strictly more powerful than measure-once QFA (MO-1QFA, MC97); both models are sufficiently described in this Wikipedia article. So far, I found a proof in L19 (p.5, prop.1) which shows that...
I'm trying to implement a compiler for a custom language as part of an assignment. I am still trying to figure out how to build the lexer. From what I understand, for a table-driven lexer, we have 3 tables: Classification Table Transition Table Token Type Table My problem is mainly coming from the fact that the only ...
We want to pre-process a set $S$ of $n$ line segments into a data structure, such that we can answer some queries: Given a query line $l$, report how many line segments in $S$ does it intersect. It is required that the query should be done in $O(\log{n})$ time. The data structure itself should take up to $O(n^{2})$ sto...
Consider the case where you have two types of flow, let's say "red" flow and "blue" flow. You want to send $k_r$ red flow and $k_b$ blue flow through a DAG $G$ from a source $s$ to a sink $t$ in such a way that no edge carries both red and blue flow. Is there an efficient way to determine if an assignment of $k_r$ red ...
I saw this question and its answer on Theoretical Computer Science stack exchange and I can't understand why the complexity of finding the root is the same as that of a multiplication. My thought was that we may need more than $O(1)$ multiplications to find the root (using Newton's Iteration as stated in the answer, si...
I am unable to solve the following lambda expression using both normal order (Call-by-name) and applicative order (Call-by-value) reduction. I keep getting different answers for both. This is the lambda expression that has to be reduced using both techniques: $(\lambda f\ x\ldotp f\ (f\ x))\ (\lambda f\ x\ldotp...
IPv4 addresses run out few years ago. But everywhere I can see mine or someone elses IP address it's in IPv4, not IPv6. I understand that world switched to IPv6? So why we can see address in older format? Does that mean somewhere someone can have same address as I? How can that work?
I'm new learning Arithmetical Hierarchy, my question ask to show that $\Sigma_1$ is Turing recognizable. I'm not sure what's the general way to approach this, but I noticed $A_{TM}$ is in $\Sigma_1$ by described in follows. First note $\Sigma_1$ = the language of the form $\{x | \exists y R(x,y)\}$, where $R(x,y)$ is...
A Münchhausen number is a whole number equal to the sum of its digits raised to powers of themselves. For the purpose of such calculations, the convention is that $0^0 = 1$. For example, in radix 10, the number 3435 is a Münchhausen number, since $3435 = 3^3 + 4^4 + 3^3 + 5^5$. In radix 4, the number 313 is a Münchhaus...
I have a printed answer to a math problem which has weird symbols on it. I figured out that the symbols were just incorrect renderings of usual symbols. Do you know what might have caused this?
Imagine you are designing a TM where $x$ and $y$ are binary representation( $x \ge y$). the TM should accept $1101\#1001$ and reject strings such as $110\#10001$, as well as it could reject if you have more than one $\#$ or less than one $\#$. Now, I have tried doing this. my idea is that: For step one is to mark th...
I have been trying to figure out the Arden's Rule and the equational method to transform DFA's & NFA's to RE. I know what the rule state: if x = s + xr then x = sr*, with $s,r\in$ Regular Expressions With that said, when I'm trying to transform one DFA in a RE this questions pop: For example regarding this DFA The...
I am learning about DPLL and CDCL SAT solvers, and I know that they have time complexity exponential to the number of variables. If I am not mistaken, one of the reasons why most believe P does not equal to NP is that there exists no polynomial-time algorithm for SAT despite tremendous effort from mathematicians and co...
I think one reason a compare is regarded as quite costly is due to the historical research as remarked by Knuth, that it came from tennis match trying to find the second or third best tennis player correctly, assuming the tennis players are not a "rock paper scissors" situation (but has an "absolute 'combat' power"). I...
Are there any known algorithms for uniquely identifying some set of points despite scaling, moving and with some amount of threshold? I have an "ideal" set of points with coordinates and I need to check if other set matches the ideal one. Other set could be rotated, scaled or distorted a bit (points could be placed wi...
Data Description : A database consisting of many Transits. Each transit has its own Path (both forward and backward), and each path has a set of Stops. Each stop consists of the position and the naming. Each stop has a parent, for example, a 4-way intersection with a stop on each corner, where you can dismount transit ...
I try to understand the node ordering at contraction hierarchy. To me, ordering and contracting node looks impossible because when contracting a node, then it influence the other node. Therefore, it looks impossible to calculate the exact node order. Let me explain the node ordering. According to the some parameters su...
MOD-PARTITION: Given a set of integers $A={a_1,...,a_n}$, their weights $w = \{w_1, w_2, \dots, w_n\}$ and the number $k$, does there exist a subset $X$ of $A$ such that: $(\sum_{x \in X} w(x) * x) \mod k \; = \; (\sum_{a \in A \setminus X} w(a) * a) \mod k$? Can some please provide some idea on how to prove the NP-Com...
In other words, was a physical implementation modelling lambda calculus (so not built on top of a Von Neumann machine) ever devised? Even if just on paper? If there was, what was it? Did we make use of its concepts somewhere practical (where it can be looked into and studied further)? -- I'm aware of specialised LISP m...
Alice has a matrix $A \in \{0,1\}^{n \times m}$ such that the sum of each row is $1$. Bob tries to find the indices of the ones (he knows that the sum of each row is $1$). The type of questions Bob can ask Alice is: "Does $\sum a_{i,j} = 0$" for some subset $\{a_{i,j}\}$ of size $n$. How fast (i.e. minimum questions) c...
I just came across the following grammar definition: CommentChar ::       SourceCharacter but not LineTerminator But for discussion, I'll present this similar construct: Digit ::        '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' Zero ::        '0' NonZeroDigit ::        Digit but not Zero Is this "bu...
Donald Knuth demonstrated that the codebreaker in the board game Mastermind can solve the pattern in five moves or fewer using the following algorithm: Create a set S of remaining possibilities (at this point there are 1296). The first guess is aabb. Remove all possibilities from S that would not give the same score ...
Are there any existing programs available to convert smart contracts into Arithmetic Circuits with which I can implement and experiment with Secure Multiparty Computation (MPC) protocols?
Sometimes, to install a program, you have a choice between compiling it yourself or downloading a precompiled binary. In theory (using a new programming language and a new compiler designed specifically for this), is it possible to generate a witness / certificate with the compiled binary such that checking the witness...
In P2P(peer-to-peer) networking, it is possible for the server program(software) and the client program(software) to be running on the same computer. So the two must have the same IP address. I am confused about this. Is there nothing going wrong if both of them uses the same IP address? Please clarify.
I want to reverse an array that was shuffled with the function array<integer> shuffle(arr: array<integer>, f: (integer) -> integer) { for (i: integer = 0; i < arr.length; i++) swap(arr[i], arr[f(i)]); return arr; } The array passed to this function is [0, 1, 2, 3, ... n-1] and function f for any i returns a v...
I'm looking for a high-level explanation although if that isn't possible or difficult, I'd prefer references to books/papers. I understand that modern type theory is inspired by Curry-Howard correspondence. From the Wikipedia article on Curry-Howard correspondence: The correspondence has been the starting point of a l...
Thoughts I am wondering is the language $ab^*$, since $a$ pushes $X$ to the stack and $b$ pops, and if there is an $a$ there has to be a $b$ to get back to the final state? Also, is it right to say $ab^*$ since there is no rule saying that if the top of the stack is $X$ and the input is $a$ I can push another $X$?
I have been reading in the 'computer organization and design' book and I encountered this section: what operations isolate a field in a word I know that the answer is logic operations and shift instructions from the book but. I want to know what does it even mean to isolate a field
Suppose we have file A that has been compressed by the the method B and the output-file is C, now if I am not wrong We can not compress C more by method B, but there might another method=algorithm D that might compress C more and produce compressed file E. Is this kind method of using more than one compression-method ...
For $P(x)=N(\mu,\sigma^2)$ and $Q(x)=N(0,1)$ I am supposed to calculate $KL(P(x)||Q(x))$, here is what I did \begin{align*} KL(P(x)||Q(x)) & = \int P(x) \cdot \log\left(\frac{P(x)}{Q(x)}\right) dx \\ & = \int P(x) \cdot \log\left(\frac{\frac{1}{\sqrt{2\pi \sigma ^2}} \exp{-\frac{(x-\mu)^2}{2*\sigma ^2}}}{\frac{...
given the input (((lambda f (lambda x (f x))) (lambda y (* y y))) 12) what does this step evaluate to: lambda x (f x) I am trying to evaluate this and I have the following tree so far: how do I evaluate this ? looking for guidance on what I might be doing wrong or how to proceed with this.
I'm doing a research on Multi-Armed Bandit (MAB) problem with approx. 1 million arms. In contrast, the number of iterations is of course much larger, about 10-20 million. Most MAB-algorithms require an argmax operator (argmax of the action space) that has to be executed in each iteration in order to select the current ...
Problem statement Given a graph of all the blue squares in the following image where each blue square is connected to other blue squares in all 4 cardinal directions. Given any starting node. What algorithm will allow for finding the longest(ish) path. Considering that each node can only be visited once. Considering th...
I have a pinhole camera model with the following extrinsic (in Earth Centered, Earth Fixed Coordinate, (ECEF) system) and intrinsic parameters. focal length (x,y) = 55000 px, optical center = (2400,540) camera center (x,y,z), (ground coordinates) = -2322996.2171387854 -3875494.0767072071 5183320.6008059494 (ECEF) Rota...
My gut says "no", but I don't know why. For any function $f$ over strings on an alphabet, one can define a language in which every word is just the concatenation of a string $s$, a delimiter, and $f(s)$, or the empty string if $f(s)$ is undefined. So there at least as many languages as functions. How can we define a ...
$f(n)=(\log n)^2+2n+4n+\log n + 50$ I am trying to mathematically prove that $f(n)$ falls under some time complexity big theta. My guess is that it is $(\log n)^2$ because it is the dominant term. I need to come to the conclusion of $f(n)\leq C(\log n)^2$, for some positive constant $C$ and $x\geq k$. What I have tried...
I have a homework problem here. It asks me to use the McNaughton-Yamada algorithm to first convert a regular expression to a DFA, and then minimize this using a partition argument. I can do the latter. My problem is that I cannot access any actual reference on the algorithm. Their original paper is behind a paywall at ...
I know that 2-SAT is solvable in polynomial time and 2-SAT is NP-Hard. I have issue about this statement: MAX 2-SAT is polynomial-time reducible to 2-SAT. Can you explain to me how reduction looks like? I need the only intution about that, but not proof.
Suppose you have a problem which goal is to find the permutation of some set $S$ given in input that minimizes an objective function $f$ (for example the Traveling Salesman problem). A trivial algorithm $E(S)$ that find the exact solution enumerates all the permutations and outputs the one that minimizes $f$. Its time ...
What information and usefulness does knowing the consensus number of a shared object give me?
In this paper Agarwal, Amit, et al. "O (√ log n) approximation algorithms for min UnCut, min 2CNF deletion, and directed cut problems." Proceedings of the thirty-seventh annual ACM symposium on Theory of computing. 2005. Agarwal et al. claim that the following two problems are equivalent. Consider boolean variab...
Given two binary strings of length $n$ and $m$, determine in polynomial time the probability of the first appearance of one string being earlier than the first appearance of the other one in an evenly distributed infinitely long binary sequence. Edit: I didn't consider my attempts at solving this to be relevant, they a...
My question is in continuation to lambda calculus reduction: (((lambda f (lambda x (f x))) (lambda y (* y y))) 12) given the input: ((((lambda f (lambda x ((f x) f))) (lambda y (lambda g (g (* y y))))) 2) (lambda a a)) I want to understand the order of reductions that I should take. in the above mentioned question it...
I read the following in CRLS: I don't understand the text in yellow. Why would radix sort not work so well if we sort by their most significant digit? What extra "piles of cards" is it referring to? Perhaps I'm not able to follow the example with cards, and an example with actual numbers would be best. In case it ...
I have two questions about the proof that Circuit-SAT is NP-Complete from here (just the first 1.5 pages): https://people.eecs.berkeley.edu/~daw/teaching/cs170-s03/Notes/lecture22.pdf The THEOREM 1 states that the size of $C_n$ is bounded by some polynomial in $n$. Where is this necessary in the proof? It seems like w...
Lets say we have an array A of size n. It has 1 as its first index and n as its last index. It contains a value x, with x occurring k times in A where 1<=k<=n If we have a search algorithm like so: while true: i := random(1, n) if A[i] == x break random(a,b) picks a number uniformly from a to b From this we kn...
I know from a general point of view what big O notation is. I have taken an algorithms class before that was all implementations and did well. I am now in an algorithms class that is mostly theory and I cannot answer a basic question... Assume that the cost of multiplying two numbers is $M(n) = O(n^2)$, analyze the asy...
There is an example of applying a substitution to an expression, and I am having a problem with it. Let $\theta = \{ x/f(y), y/z \}$, and $E=p(x,y,g(z))$, then $E\theta = p( f(y),z,g(z) )$. Why is $y/z$ not applied to $E$ after using $x/f(y)$, so that the answer would be $E\theta = p( f(z),z,g(z) )$?
Given a computer that takes 1 microsecond for an operation, I'm trying to find the amount of operations this computer can perform in one second, given an algorithm with complexity $O(n\log n)$. I've tried to solve it by the following ways but always get stuck. Note that one second equals $10^6$ microseconds. I've foun...
When learning about a general unification algorithm, we learned the rule decompose, which states unifying $$G \cup \{f(a_0,...a_k)=f(b_0,...,b_k)\} \Rightarrow G \cup \{a_0=b_0,...a_k=b_k\}.$$ The question of, "What if $f$ is not injective?" stood out to me. Say $f$ is not injective, and we traverse that branch of comp...
I am working on the human following robot. the robot extracts a feature of clothes's texture and distinguishes between the people that they stand up in front of the robot. So, the robot needs that it will be robust and fast.
I once found on Wikipedia a nice technique for encoding $k \in (2^{n-1}, 2^n)$ uniformly distributed integer numbers with less then $\log_2n$ average bits/symbol, thanks to a simple to compute variable length code. Basically it used $\log_2n$ for some symbols and $\log_2n - 1$ for some others. Unfortunately all my Goo...
i was reading stack and i came across the infix, preifx and postfix expression.So i understood that why postfix /prefix expressions are preferred over infix expression ( due to its unambiguous nature) .But i am not getting any enough information about the popularity reason of postifx expression over prefix expression....
I am fairly new to automata, regular expressions and regular grammar. I am struggling to understand how to define the regular expression (abc)* into one or several regular grammar expressions. Following production rules are applied N={S,A,B} Σ={a, b c} S being the start symbol So far i have found these two. S → aA ...
I study Parallel Processing, and I get stuck into how to calculate the maximum degree of concurrency for task dependency graph. I know that the max degree of concurrency is the largest number of concurrent tasks, and I have to calculate the sum of their weights, but in this graph, there are no weights and no fixed numb...
Problem Description I have a data state space: a set of data sets, each of which can be modelled as a collection of arbitrary key-value pairs. These data sets are each a branch of evolution of a parent data set, forming a tree (not a lattice; data sets branch but do not merge.) The root of the tree is an empty data set...
In Kohonen's SOM algorithm, the equation to find the collaboration is: $$ \mathit{Damp}(i,j) = \exp\left(-\frac{\mathit{LDist}(i,j)^2}{2\sigma^2}\right) $$ I know that LDist is the lattice distance and $\sigma$ is the standard deviation. I am just wondering why they are squared? Can anyone help me to visualize the equa...
Say I have a grammar e.g, $$\begin{align}S&\to AB\mid abc\\ A&\to aAb \mid \lambda\\ B&\to bBa \mid ba \end{align}$$ Now it is obvious the notation for this would be something like, $$L(G) = \{a^{i}b^{i}b^{k}a^{k} | i \ge 0, k > 0\}$$ My question is how do I account for the starting state going to abc. How can I repre...
Whenever I increase the number of cores the speedup will increase. with this increasing can I consider the system as scalable? I mean based on the speedup obtained for a different number of cores e.g. 10,20,30, is the system scalable with the increase of cores?
Given a string S of length n and a positive integer k <= n, we want to randomly, and with equal probability, choose a string from the set of all strings of length k that may be formed with a subset of the letters of S. For example, if S = daddy and k = 2, we want to choose each of the strings da, dd, dy, ad, ay, yd and...
A common algorithmic challenge is to generate an object of a certain kind, uniformly at random. For example, generating a random permutation of size $k$ from a given (multi)set of $N$ characters, as in this question. I've noticed that when solving such tasks, any algorithm for calculating the number of such combinatori...
would the code below be considered O(N^3)? while (...) { while (...) { } while (...) { } }
I need to show that the following language is context free: $$L = \{a^\ell b^n c^m | \ell, n, m \in \mathbb{N}^+ \wedge ((\ell \ge n) \vee (\ell \ge m))\}$$
Say, I have a file that is somewhere between 10-20 pages long. I need to extract 10-20 pieces of information from it that I can fairly easily extract using a series of regex-es or by running code that reads things line by line and extract information that way. Is there a way that is necessarily faster than the other? ...
I have the following repetition structure: sum = 0 for (i = 0; i < n; i++) { for (j = 0; j < i*i; j++) { for (k = 0; k < j; k++) { sum++ } } } By the following, I have reasoned the runtime of this structure to be in $O(n^7)$ : $\sum_{i=1}^{n} (\sum_{j=1}^{i^2}(\sum_{k=1}^{j} k))$ $= \sum_{i=...
Starting with two examples: for(i = 1; i<10; i++) {B[i] = 0;} for(i = 1; i<10; i++) {B[2i] = 0;} In the first example, the successive accesses to the array are in contiguous locations whereas in the second example they are at alternating locations. Therefore, the total access time is lesser in the first case. Now,...
Suppose that we have an $m\times n$ matrix $A$ of rank $n$, whose entries are 8-bit unsigned integers obtained from a grayscale image. Now we want to apply SVD to $A$ and to use the first $k$ singular values to construct the the best rank-$k$ approximation of $A$ to accomplish compression for data storage. I understan...
I want design algorithm that allows a student to take important courses quickly up until graduation. no time, room number, professors needed here. just my selected courses I know will allow me to graduate but how best to take them based on prerequisites. the student can decide how many courses to take a semester. And,...
I'm trying to classify and come up with a reasonable solution for the following problem (abstracted from a real world problem). Problem Imagine StackOverflow started offering a subscription where companies could buy X number of impressions per month for a set of tags. For example, you might be interested in running a...
I was wondering why do we need to do the topological sort before performing relaxing of edges. Wouldn't it'd be better if we do : if starting vertex is "s" queue.add(s) while(the queue is not empty) for every adjacent vertex v of u if( dist[v] > dist[u] + weight(u,v) ) dist[v] = dist[u] + weight(u,v) ...
In pseudo direct addressing mode (For the MIPS architecture) the 26 bit of the jump instruction are joined to the upper 4 bits of the PC . how could this help in jumping to relative positions suppose I want to jump backward instead of forward ( i.e. if i want to jump to the beginning of a loop after executing it's bod...
I am seeing two definitions of strongly NP-hard that seem to be slightly different: A problem is strongly NP-hard if a strongly NP-complete problem has a polynomial time reduction to it. A problem is strongly NP-hard if it is still NP-hard when all numbers in the input are bounded by a polynomial in the length of the ...
Consider the decision problem that when given a graph, we need to decide if a particular edge belongs to any optimal solution to the traveling salesman problem on that graph. It may be argued that the complexity of this problem is strictly greater than any co-NP problem. The idea is that it's perhaps impossible to come...
I'm struggling to find the context-free grammar for the following language: $$ L = \{a^sb^tc^m:s,t,m\in\mathbb{N}^+\land1\leq t\leq3\land s\times t=m\} $$ Any help would be appreciated.
I've read that Luk-Vuillemin multipliers are similar to Wallace multipliers but partition their inputs in a different way. How exactly does this partitioning work, how does it change the structure of the multiplier, and why does it give it a more regular structure which is preferred for fabrication?
A set of English words is given. Is there linear or sublinear algorithm to build minimal DFA for the given dictionary? I tried different approaches, and they all were concerned with building Trie and then minimizing such automata. So it is very interesting for me is there some algo using it to solve my problem. P. S. T...
This is probably a very basic question but one that I am having trouble finding a definitive answer for since this kind of thing is skimmed over in most introductory algorithms courses. Take an algorithm like DFS that runs in time polynomial in the number of inputs. In this case your input is a graph with $n$ vertices ...
All of us have saved a file on our computers using a programming language. If I look down through the layers of abstraction, I usually get stuck at a kernel-level call or a C-call like fwrite(); But even at this already deep level things like filesystems and location of storage are hidden from us. For example, one cann...