instruction stringlengths 35 29.1k |
|---|
There's a famous and elegant reduction from the maximum bipartite matching problem to the max-flow problem: we create a network with a source node $s$, a terminal node $t$, and one node for each item to be matched, then add appropriate edges.
There's certainly a way to reduce maximum flow to maximum bipartite matching ... |
I have a set $S$ of pairs $(x_1,x_2)$ with $x_1,x_2 \in X$ for some set $X$.
I want to know whether this defines a total relation on $X$. In other words, whether:
If $(a,b)$ in $S$ and $(b,c)$ in $S$, then $(a,c)$ in $S$. (transitivity)
Exactly one of $(a,b)$ and $(b,a)$ is in $S$ unless $a=b$, in which case they are... |
Assume, an extension of the lambda calculus with terms $t$ and values $v$ is defined in big-step operational semantics with evaluation relation $t \Downarrow v$.
It is intuitive to assume that $\beta$-equivalence holds, e.g.
(λx. t) unit $\equiv_\beta$ t when x is not free in t
It is however unclear to me, how $\equiv... |
I've got a real-world issue that I'm trying to come up with a dynamic programming algorithm to solve. It's similar in appearance to the knapsack problem, but it has more constraints, which has got me stumped. A simplified version of the problem:
Suppose I need to fill a basket with an arbitrary number of items c. The i... |
Is A mapping reducible to B if B = A?
Let's say A is undecidable but Turing-recognizable and also Turing reducible to its complement.
|
I was trying to understand the Wikipedia proof for NP-completeness of subgraph isomorphism by reduction from the clique problem. It's really just one sentence:
Let $H$ be the complete graph $K_k$; then, the answer to the subgraph isomorphism problem for $G$ and $H$ is equal to the answer to the clique problem for $G$ ... |
In discrete math, I have read that lattice is a generalized form of boolean lattice. But those places where boolean algebra is mentioned, they don't tell about lattices (digital logic, binary,...). Whether the meet and join is same as and and or in boolean logic? If we are thinking in terms of lattices how you define 1... |
I'm having trouble proving, or understanding why a two-head one-way finite memory machine could accept a non-regular language– for instance, $(w \mid w \in (a,b)^{*}, w= a^i b^i, i\geq 0)$.
For clarity, a two-head one-way finite memory machine works as follows – it has a finite control and a read-only input tap... |
I am trying to solve n-queen puzzle with an additional stronger condition that no 3 queens can be on the same line.
Right now my algorithm is,
Generate a random permutation of [1..n].
Store "swaps" as "moves" such that it reduces number of conflicts.
Pick a "move" with non-uniform distribution on number of reduced con... |
Is there a difference between an execution model and a computation model? Or the two terms refers to the same things?
Thanks in advance.
|
Consider the regular expression $(a^*b^*)^*$
Does this mean that there are zero or more occurences of the term $(a^*b^*)$ before the term is expanded or that there are zero of more occurences of the term $(a^*b^*)$ after the term itself has been expanded?
Here is an example of what I'm try to say
zero or more occurence... |
I'm trying to learn how communication works in a butterfly network.
The following is a butterfly network of order 3. I'm given the following description:
Each processor is connected to an output switch in rank 0 and to an input switch in rank k (in this case 3). In other words the switch in column j and rank 0 gets i... |
What's the complexity of the above? It's part of a larger problem where the (1/2) comes from the probability of that happenening, so the worst case is:
T(n) = T(n/2) + c
but the average case is:
T(n) = (1/2)T(n/2) + (1/2)c
Our professor told us that the answer to the worst case is O(n), and that the average case is O(n... |
Here is insertion sort:
for i = 1 to length(A)
x = A[i]
j = i - 1
while j >= 0 and A[j] > x
A[j+1] = A[j]
j = j-1
end while
A[j+1] = x
end for
My lecture notes say that the total number of basic computation steps is about
$$T = 1 + ( 5 + t_1 \times 3 ) + \dots + ( 5 + t_{n-1} \times... |
I've been working on finding a regular expression for the following language for quite some time now ($\Sigma =\text{{0, 1}}$):
$
\text{L = {w | the difference between the number of 0's and 1's in each prefix of the word is less than or equal to 1}}$
I haven't been able to find an expression for this particular langu... |
HSV colors are composed of a triple of numbers: hue $\in [0, 360)$ (in degrees), saturation $\in [0, 1]$ and value or brightness $\in [0, 1]$. RGB colors instead are more well-known and are also composed of a triple of numbers all of them in the range $[0, 1]$ or in a byte $[0, 255]$.
I was trying to implement an algor... |
So as learned every DFA is an NFA. I feel like I understand DFA much better than NFA, so I try to convert my regular expressions to DFA, but I want to understand both sides.
For example a|b (a Union b):
However, are we losing anything if we eliminate the epsilon from these expressions, every DFA is an NFA right so wh... |
We can simulate the PDA and parse the language with the following operations (vaguely):
Read the input symbol and top of stack - $O(1)$
Check all the transition rules (must check all for non-determinism) - $O(|Transition rules|)$
Update the stack and the set of states - $O(1)$
Due to non-determinism, the problem si... |
Say you are a program, and you are given some source code but you don't know in what language, it can be C++/Java/Python/Lisp/... all you know is that it is highly structured and LR(1) parse-able, and you want to make some guesses on the corresponding syntactic tree.
How would you try to achieve this, and would you hav... |
I would like to discuss an algorithm to build a "hand" calculation for riichi mahjong game.
I will simplify terms to focus on the algorithm and not on the game specific terms.
Let's imagine that we have a card deck with three suits. Each suit contains cards from 1 to 9 and each card has four copies.
So card deck looks... |
I have a CFG:
S -> $T$
T -> T+T|T-T|T/T|(T)|CX|I
X -> XX |C|N|_|@
C -> a|b|c|....|z|A|B|C|...|Z|_
N -> 0|1|2|....|9
I -> NI|N
Here @ means epsilon.
The above is a valid arithmetic expression in C++.
I have to convert this to a deterministic PDA (does not read @). I do know there exists an algorithm to convert it to NPD... |
I have an algorithm that supposedly solves the matrix chain multiplication problem in $O(n^2)$ time. I have tested it only on trivial cases and they turned out to be correct.
By no means, am I a genius, but I was wondering if you guys could point out where this algorithm lacks.
The algorithm:
Base case:
MCM(A) = 0... |
I need to calculate the edit distance between many pairs of binary trees. Unfortunately this is computationally expensive.
The trees are stored as a flattened list of indices into node and terminal lookup tables. The particular flattening structure is the pre-order encoding format (pseudo code: flat(tree) = [id(root)] ... |
is there any unambiguous grammar on alphabet={a,b} that can produce strings which have equal number of a and b (e.g. "aabb" , "baba" , "abba") ?
|
I have been trying to learn more about amortized analysis. Recently I came across the Disjoint Sets or Union-Find structures. I am using union by rank and path comparison. The potential of such data structures is sum of $\phi(x)$ for all nodes where
$$\phi(x) = \begin{cases}
0, & \text{if }\mathrm{rank}(x)=0 \\
\alp... |
I have a quick question on implementing the Bhandari algorithm. I do not have the textbook where the algorithm is originally given (Bhandari, Ramesh (1999). Survivable networks: algorithms for diverse routing), and the online resources I've found are a little ambiguous on this point...
Say I want to obtain k disjoint ... |
When a computer stores a variable, when a program needs to get the variable's value, how does the computer know where to look in memory for that variable's value?
|
In Pascal For-do loops, there is a rule stating that one cannot modify the counter variable inside the body of the loop.
To exemplify the rule, take the following Pascal for-do, which is not valid, since the counter variable is being modified inside the loop's body:
for i := 0 to 10 do i := i + 1;
My question is: Is ... |
So I'm almost done teaching myself category theory. One of the main take-aways for me is that type constructors (higher-kinded types) are endo-functors.
But it this always the case? What's throwing me off is Haskell's Functor typeclass:
class Functor f :: * -> * where
fmap :: (a -> b) -> (f a -> f b)
If all type co... |
If we have an union-find(disjoint-set) data structure and we are doing an union by rank and path compression for a find operation, how would the depth and height of every node change after the find operation?
I am trying to find the amortized cost of the find operation using the potential function:
$$phi(x) = \sum_{x} ... |
I need to prove the following language is not regular, I think I need to use the pumping lemma. The trouble I am having is that there is multiple variables and I am not used to that.
Could someone tell me if the pumping lemma is the correct proof by contradiction of
$$L = \{a^iba^j|i\ge2j\ge0\}$$
I took $xyz = a^{2p+1... |
Given a string, how to get the its prefix similarity? I use an example to explain what I mean by string prefix similarity. Say, s = "ababaa". We take all its suffixes, that is, "ababaa", "babaa", "abaa", "baa", "aa", "a". Then we count their common prefix length with original string. In this case, it is 6 + 0 + 3 + 0 +... |
let's say that I have:
M - Main point - given by coordinates (lat, long)
C - Collection of points - also given by coordinates (lat, long)
R - Radius - maximum search distance
I'm trying to find all points that are within a radius from main point (neighbors).
algorithm(main_point, collection_of_points, radius) --> ne... |
Recently, I am reading the Fleury's Algorithm part of the document [1]. There is a sentence on page 3 of this document:
Note that, when the algorithm terminates, we must return to $v_{start}$ because every vertex has an even degree.
I don't understand why we must return to $v_{start}$. Could anyone please teach me?
... |
I'm going to try to design an algorithm to find all the rational roots of a polynomial equation in range [a, b]. Can someone please tell me which algorithm currently solves the problem with lowest worst-case complexity? This algorithm will be for a general purpose computer(Turing Machine).
|
What is the optimal way to cut B chocolate bars to share equally between N people?
Here is an example of different cuts for B = 5 chocolate bars and N = 6 people.
Strategy 1: cut each chocolate bar in 6 equal parts and, then, give 5 parts for each person. Number of cuts: 5 x 5 = 25.
Strategy 2: cut 3 bars in 2 equal p... |
I am writing a compiler for a simple subset of standard ML (just for fun) and I am stuck on how to represent the core language (I should mention that I write it in Haskell probably).
Basically what I have already is an expression type that looks like the following:
data Expr' e
= Let Name e e
| Fn Name e
| Val Va... |
I need to define the data-flow analysis equations to determine the value dependencies of an statement.
For example:
a = 9
b = a + 7
c = b * 2
the value of c depends on the value of a.
I'm sure this is a well known problem in data flow analysis, can any one point to the equations solving this? Static Single Assignment... |
On the A taste of linear logic paper, the author claims that:
A rule consists of zero or more judgements written above a line, and one
judgement written below. If all the judgements above the line are derivable, then the judgement below is derivable also.
He then proceeds to show the following rules:
He then descr... |
Before the Question:
Greene, Parnas and Yao presented a scheme which, for binary data chosen uniformily a random,
retrieves all points within Hamming distance r of a given point in time $O(d n^{r/d})$ using $O(d n^{1+r/d})$.
The scheme is based on Turán's graph and the complete description can be found
here.
I was r... |
I'm studying for an algorithms exam and came upon the problem :
for (i = 0; i < n * n; i++) {
i++;
for (j = 0; j < (log(n) * log(n) * log(n)); j++) {
j++;
}
}
I figure that line 1 costs $ c_1(n^2) $, line 2 costs $ c_2(n^2 - 1) $, line 3 costs $ \sum_{j=0}^{n^2} \log(j)^3 $,... |
I found a problem in the dynamic programming section of hackerrank but its not clear why dynamic programming should be used to solve it. The problem is as follows:
Nikita just came up with a new array game. The rules are as follows:
Initially, there is an array, , containing integers.
In each move, Nikita must pa... |
Circuit complexity has connections to many questions in complexity theory.
For a couple examples, Ryan Williams shared some in a recent talk and Section 3 of these notes gives simple relations to $\mathbf{P}$ vs. $\mathbf{NP}$ and $\mathbf{P}$ vs. $\mathbf{BPP}$.
More can be found in the textbook Boolean Function Compl... |
Recently, I was asked to design an algorithm that counts the number of triangulations in a simple polygon without Steiner points. This is pretty simple to do in $O(n^3)$ time using dynamic programming, where $n$ is the number of vertices in the polygon. However, I would like to know if there is an $O(n^{3-\epsilon})$ a... |
If A is not mapping reducible to B then A is not mapping reducible to the complement of B?
Is this true?
|
Is there a proof for the lower bound of the problem to create a sorted list of sums for a given list of integers with length n.
In this [thread][1] people discuss solving this problem by sorting the list of integers first and then creating the sums. However none of the solutions seems to be faster than $O(n^2 \log n)$... |
Consider a simple language:
$$t ::= plus ~ t ~ t ~ | ~ gen ~ t ~ | ~ except ~ N ~ t ~ | ~ N$$
with N constructors plus, gen and except, N being the natural numbers, and $G = \{t_n\}$ a finite, ordered set of terms.
These terms can be evaluated using a small step operational semantics:
$$\frac{G ~ \vdash ~ t_1 \rightarr... |
The classical 0,1 knapsack problem with weights $w$ and unit value for all items $x$:
$
max \displaystyle\sum_{i} x_i, x_i \in \{0,1\}
$
subject to
$
\displaystyle\sum_{i} w_ix_i \leq W
$
for a maximum weight $W$.
Recall that the weights in this version can be negative: we will simply select all items with zero or nega... |
I want to go RD parsing with Shunting Yard for expression (for the sake of easier operator precedences and less left-recusion), is that considered no-good because nobody did that before?
|
I need to describe an algorithm that finds a maximum matching in a given undirected and unweighted graph. The runtime needs to be linear and is a 2-approximation, that is, the matching size (number of edges) should differ from a maximum matching size not more than a factor of two.
The problem I have is coming up with a... |
In CLRS's Introduction to Algorithms,
The following procedure implements quicksort:
QUICKSORT(A; p; r)
1 if p < r
2 q D PARTITION(A; p; r)
3 QUICKSORT(A; p; q-1)
4 QUICKSORT(A; q+1; r)
To sort an entire array A, the initial call is QUICKSORT(A; 1;
A.length). The key to the algorithm is the PARTITION procedure,
... |
The question is to design a DFA that accepts a language in which the count of substring "$110$" is no less than the count of substring "$011$". For example, $110$, "0101", "0111101110" is good but "011011" is bad.
The restriction of the language equivalently means whenever a "011" is encountered, only this pattern "$0... |
I'm reading that 'Prewitt' filter is high-pass filter, which means that it can sharpening the image (via edge highlight).
But I'm not sure to implement the sharpening process (not just edge detection) to the original image in this case.
So I mimic Laplacian process :
x-direction 1st order derivate is define as :
f(x+1... |
I am having a very difficult time trying to understand what exactly this question is asking.
How many valid English plaintexts are there for the ciphertext message CJU using a length-3, one-time pad of cyclic shifts, (i, j, k)?
If the encrypted question message is CJU and the one time pad is i, j, k would there not b... |
I could guess why computers have arithmetic operations like add, sub, and mult instructions. It is to compute numbers, but I don't get why branch and jump instructions exist.
I am asking what theory or purpose for implementing branch and jump instructions is there?
I've tried to get rid of branch and jump instructions ... |
Is existence of registers in CPU an obligation, Or we just do it for performance?
Can we theoretically and practically have computer architectures that don't use registers?
If yes, please name computer architecture and computer models that doesn't have register.
Update: Do stack machines use register? If yes, is it pos... |
Usually I see that in the structural operational semantics representation for the while loop, the program state don't change:
$(while \> B \> do \>S, \sigma) \rightarrow (if \>B \> then \>S; (while \> B \> do \>S) \> else \> SKIP, \sigma)$
For me, this not intuitive, if the state don't change (i.e. the status of the me... |
Can we think of NP using a parallelism model instead of using a "checking relation" without loss of generality?
From what I understand from the problem statement given by Stephen Cook,
The notation NP stands for “nondeterministic polynomial time”, since
originally NP was defined in terms of nondeterministic machine... |
It's written in wikipedia https://en.wikipedia.org/wiki/Turing_completeness#Games that the video game Braid is Turing-complete.
I've played Braid before but I can hardly reconcile it with Turing completeness. In what sense is it Turing-complete?
|
Given the following recurrence relation,
$T(n) = 2 T(\frac{n}{2}) + f(n)$,
where $f(n) = \Omega(n^2)$, I'm asked to prove or disprove that $T(n) = O(f(n))$.
If I'm allowed to restrict my discussion within the special cases in which that $n = 2^k$ for positive integer $k$, how can I prove or disprove the proposed bound,... |
who can help me explain the concepts of "Semantic Web", "Semantic Network", "Semantic Search", "Knowledge graph"(not Google's Knowledge Graph) and "knowledge base" and the relations among them?
|
By non-trivial algorithm, I mean anything besides the trivial "do nothing" algorithm that simply terminates.
This is pretty trivial, but don't algorithms require a notion of monotonic time?
From what I understand, all computation requires a sort of reduction step, from the reduction of the transition function in Turing... |
In my class we have to answer a question:
Having this pseudocode:
XPTO(n)
sum = 0
if even(n)
for i=1 to n
sum = sum + i
else sum = 0
and knowing that even(n) have complexity ϴ(1), we can say the complexity of XPTO is ϴ(n)? Justify.
How do I justify this?
|
When I was reading about counting sort in Introduction to Algorithms for the first time, I stopped reading after the step where they calculate the number of each element in the input array. It's the first thing we do after allocating an auxiliary array.
I was sure the algorithm would look like this:
public static int[... |
Example of Data
This is the data for one monkey. There are many similar but different monkeys.
X(Y,Z) means Y, Z are parent of X.
A(D,E) If monkey see banna (D) and monkey is hungry (E), it squeaks (A).
B(E,F) If monkey is hungry (E), and monkey see other monkey, it jumps(B).
C(D,F) If monkey see banna (D), and it ... |
I'm currently watching a video on the analysis of Krager's Algorithm, and I am confused about something.
The analysis goes as follows:
Fix a min cut $(A,B)$.
Let $k$ = # of edges crossing $(A,B)$ , these edges will be called $F$
Let $S_{i}$ be the event that an edge of $F$ is contracted in iteration $i$.
For the first ... |
I have the following functions:
What is the correct order of these functions in increasing complexity?
I could always start entering values in these functions and check the corresponding output to notice the rate of increase. But is there a better, faster way of ranking these functions in order of increasing complexi... |
When describing the syntax of a given programming language the words "expression" and "term" are often used to seemingly describe the same things. Are these words interchangeable in the context of programming languages?
|
Why do some search trees store all elements in the leaves, while other search trees don't?
One difference that makes is whether a successful search may end up in an internal node.
For m-ary search trees, the former case will need more leaves and more heights than the latter. Is this the benefit of not storing all th... |
I am trying to solve a bounded SSSP problem as follows:
Given a connected weighted graph with non-negative edges (might have
cycles), find the shortest path from a vertex s to a vertex t with
at most k edges.
I have done some research on this problem. All proposed solutions point to using Bellman-Ford's algorithm... |
I have been doing research on the SIFT (scale invariant feature transform) algorithm, and while I have repeatedly read that in order to detect image features that do not vary with respect to scales of visual perspective, a scale space must be constructed from the source image using repeated Gaussian smoothing and takin... |
Let $P$ be a push down automaton $(Q,\Sigma,\Gamma,\delta,q_s,F)$,
where
$Q$ is the set of states,
$\Sigma$ is the input alphabet
$\Gamma$ is the stack alphabet
$\delta$ is the transition function with signature $Q\times(\Sigma\cup\{\epsilon\})\times(\Gamma\cup\{\epsilon\})\to\mathcal{P}(Q\times(\Gamma\cup\{\epsilon... |
In the familiar book of Theory of Computation by M. Sipser, the author proved that for endmarked context-free languages, the set of languages having a LR(k) grammar for a predefined $k \in \mathbb{N}$ (denoted as LR(k) languages) is the set of deterministic context-free languages (denoted as DCFL).
My question is also ... |
What kind of formal semantics can describe HTML and CSS? Are there endeavours to do this. HTML/CSS layouts are espcially complex, so formalization can be of help.
|
How does information theory deal with truth?
Does disinformation or lie have negative amount of bits of information?
|
Some compilers have utility functions that split critical edges in the control flow graph. I assume that this is not done as an optimization in itself, but rather to simplify other analyses and transformations. In what cases would splitting critical edges be useful?
|
Huffman trees are used in a specific application - Huffman coding - for finding the minimum-expected-length binary-coding for a set of strings, with respect to a probability distribution over the string set.
Optimal binary search trees (as defined in CLRS's Introduction to Algorithms) are used for finding the optimal b... |
There is a some question that arise from the proof of Lemma 5.8.1 of Cover's book on information theory that confuse me.
First question is why he assumes that we can "Consider an optimal code $C_m$. Is he assuming that we are encoding a finite number of words so that
$\sum p_i l_i$ must have a minimum value? Here I gi... |
In java, you must explicitly cast in order to downcast a variable
public class Fruit{} // parent class
public class Apple extends Fruit{} // child class
public static void main(String args[]) {
// An implicit upcast
Fruit parent = new Apple();
// An explicit downcast to Apple
Apple child = (Apple)pa... |
Let's take for example this addition: 3 + (-1).
1 in binary is 001, and to obtain it's 1's complement counterpart we
flip the bits. So it is: 110.
3 in binary is 011.
011 + 110 = 1001
That first 1 which is in bold has to be added to the number formed by the last 3 bits as follows:
001 + 1 = 010 (2 in decimal).
Wh... |
I'm currently trying to learn how to infer most general types on lambda calculus, and due to the lack of information on the subject I could find on Google I'm forced to attempt what I think is logical and ask here if it's correct, it's most likely not, so please correct me!
Here's a couple exercises I've got, the idea ... |
Let $A$ and $B$ be two finite sets of the same size $n$. Let $P(A),P(B)$ be the set of all permutations of $A,B$ respectively. A distance function $d(a,b)$ is defined for any $a\in P(A),b\in P(B)$. We want to find $\min \{d(a,b):a\in P(A), b\in P(B)\}$ (note: $d$ is fixed).
For example, suppose we have two sets $\{1,2\... |
Let's say we have a database with a given table named food. The food table has many columns but we are interested in only 3 of them:
buyorsell, which specifies if the food is for selling or buying.
amount, which is the amount of food to be bought or sold.
isVegan, which is set true if the food is vegan.
The goal i... |
Given a set of workers $w_1,...,w_m$ and and a set of tasks $t_1,...,t_n$, and a $m\times n$ matrix $P$ s.t. $P(i,j)$ is the profit of assigning worker $i$ to task $j$. One worker can only be assigned to one task, and one task can only have one worker. We want to find the maximum profit of all possible assignments.
D... |
I am dealing with a sample exam question that I cannot understand which is as follows:
Selection sort takes one millisecond to sort 1000 items (worst-case time) on a particular computer. Estimate the amount of time it would take to sort 100,000 items. If Mergesort took 1 second for 100 items and 15 seconds for 1000 it... |
A deque is a double ended queue of course. So if I can either use 2 stacks, or 2 queues, or 1 stack and 1 queue, which two would I use to have the fastest implementation? Can we derive the complexity for InsertLeft, InsertRight, and RemoveLeft, and RemoveRight?
I was thinking of using 2 stacks. Call 1 stack 'left' and ... |
I am supposed to be changing this to Chomsky Normal Form and then to Greibach form, but I am still having a few difficulties changing it to the first form.
Here is the language:
S → AA|SBBa|b
A → ABa|BS|a
B → BBb|a|λ
I know the first step is to make a new start symbol and thats easy enough
SO → S
S → AA|SBBa|b
A → ABa|... |
This is the problem that I have been given:
Consider the Independent-Set problem, in which the input is an undirected graph $G = (V,E)$ and a
parameter $k$, and the goal is to determine if $G$ has an independent set of size $k$. Suppose we have an
oracle $O$ for solving this decision version of independent set (think o... |
I get how to solve recurrence relations for t(n)= t(n-1) etc etc.
But how would you solve the recurrence of t(n) = t(n/2) + log2(n), such that T(1)=0? I don't understand how the log would behave in this situation.
|
For language $L = \{a^m\, b^n\: |\: m \:\%\: n = 0 \}$, that is, $m$ is a multiple of $n$, I'm trying to find a proof that it isn't a context free. I know it isn't regular, but it also doesn't seem to be context-free to me. However, I am not sure how I would go about proving that it isn't context-free. My quick attempt... |
I am trying to count the exact/total number of iterations these nested for-loops are executed:
procedure P (integer n);
for (i: 1 to n)
for (j: 1 to 10)
for (k: n to n+5)
x := x + 1;
I know that the first for loop runs (n-1) times, the second loop runs 10-1 (9) times, thus making the time complexity so far 9... |
So I have function that I have written to return the maximum value between index i and index x of a given array using recursion as follows:
FindMax( A, i, j )
if (i == j):
return A[i]
else:
k = (i + j) / 2
return max( FindMax(A, i, k), FindMax(A, k+1, j) )
What is the correct way to go abo... |
Having difficulty with the following question.
I can answer parts I and II but having trouble finding a practical example.
Question:
Compute the maximum data rate of the following communication links;
I) 4000Hz bandwidth and a signal to noise ratio(SNR) of 20dB;
II) noiseless channel of 2.4GHz bandwidth with 64 signal... |
What is the most efficient (in terms of running time) algorithm that solves the Chinese remainder theorem (CRT) on a set of integer residues. That is, given a set of moduli $\{m_i\}_{i=1}^{r}$ and set of residues $\{x_i\}_{i=1}^{r}$ such that $X \equiv x_i~mod~m_i$, find $X \in \mathbb{Z}_M$ where $M=\prod_{i=1}^{r}m_i... |
Given an undirected graph, how would one go about calculating the number of squares in the graph? That is, a square is a cycle of length 4.
I know that it is possible to count the number of triangles (cycles with length 3) in polynomial time. Is it possible to calculate the number of squares in polynomial time as well... |
If in a particular DFA , we are looping in a state for n symbols.... Is there any way to keep track of this 'n'?
|
The task is to compare two trees and determine what are the changes. Both trees are represented as an adjacency list (ID, ParentID).
Base tree:
A (ID: 1, ParentID: 1)
B1 (ID: 2, ParentID: 1)
C1 (ID: 6, ParentID: 2)
D1 (ID: 13, ParentID: 6)
C2 (ID: 7, ParentID: 2)
D2 (ID: 14, ParentID: 7)
B2 (ID: 3, ParentID... |
In class our professor showed us 3 methods for proving non-regularity:
Myhill–Nerode theorem
Pumping Lemma for regular languages
Proof of non-regularity, based on the Kolmogorov complexity
Now the first two, Myhill-Nerode theorem and Pumping lemma, I understood well and I was also able to do the exercises to the firs... |
I can't find the standard name for this problem, so lets call it TIMING, it takes as input a Turing machine $F$ with its input $i$, and a number of steps $n$.
It returns yes if $F(i)$ halts in less than $n$ steps, otherwise it returns no.
What is the time complexity of this problem in terms of $n$, is it $n\log n$ as ... |
The diameter-constrained Minimum Spanning Tree (MST) problem is as follows: you have a undirected weighted graph $G = (V,E)$ of different weights where $V$ is the set of vertices and $E$ is the set of edges between vertices, and a constant $d$. The goal is to find an MST such that the diameter (i.e., the maximum distan... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.