instruction stringlengths 35 29.1k |
|---|
I'm having difficulty trying to use the pumping lemma in order to show that $L= \{0^i \mid \ i \text{ is a power of 2 }\} $ is not context free.
I"m starting by stating that $ s = 0^p$ and then $ s = uvxyz $ and that in order for a language to be context free it must follow the 3 conditions: $|vy| > 0$ , $|vxy|\le p$ a... |
how does that recursion work
#include <stdio.h>
int ack(m,n)
int m,n;
{
int ans;
if (m == 0) ans = n+1;
else if (n == 0) ans = ack(m-1,1);
else ans = ack(m-1, ack(m,n-1));
return (ans);
}
int main (argc, argv)
int argc; char ** argv;
{ int i,j;
for (i=0; i<6; i++)
for (j=0;j<6; j++)
printf ("ackerman (%d,%d) is:... |
I am currently studying linear congruential generators, and there was an example in which I didn't get the code:
public class Random {
static final int a = 48271;
static final int p = 2147483647; //2^31 - 1
static final int q = p/a;
static final int r = p%a;
int state;
public Random() {
this ( (int)(System.curren... |
I am reading this text and it is making absolutely no sense to me. It as if it assumed I will understand. Not to mention the writer apparently had a book made and his grammar is poor. Some of the plain English sentences do not even make sense or have the letter s on the end of words where they should not be. please hel... |
I don't see why $n, n/2, n/4, n/8, \dots, 1$ takes $\log_2 n$ steps. Is there a more general statement on this repeated division?
|
Suppose we have input $s_1,\dots,s_n \in \mathbb Z$ and $t \in \mathbb Z$. We want to know if there exist variables $x_1,\dots,x_n$ in which each $x_i=1/2^k$, where $k \in \{0,1,2,3,4,\dots,\infty\}$, such that $s_1x_2+\dots+s_nx_n=t$.
Is this problem NP-complete? Is it solvable in polynomial-time?
|
I'm so confused by some of the theorems online about tree heights. Does tree height mean the number of edges or nodes? if nodes, does it include the node it is counting from? Can the height of a tree start from 0?
|
I'm not an expert of the theory of algorithm, so please forgive me if this problem is nonsense, but I want to find good algorithm to solve below problem.
There is a array of integer each of which has been assigned with random initial value such like [1,5,-3,4] or [123, 543, 295, -703, …]
You move values from one elemen... |
Having a bit of an issue with this question and deciding which of these situations requires dynamic programming and which are NP-complete. In all of these situations the input is a "tip jar" consisting of some number of coins/bills of the various types in D (e.g., five nickels, a dime and three quarters) and the proble... |
I am faced with the following question:
Design a Turing Machine that recognizes the language $L = \{1^{2n+1}\mid n \text{ is a non-negative integer}\}$. Show the state diagram.
I started doing this using $Q \times \Gamma \rightarrow Q \times \Gamma \times \{L, R\}$, and setting up a 7 tuple but I cannot come up with ... |
I am trying to solve the following problem from Aho, et al., Compilers: Principles, Techniques, & Tools (2nd ed.), exercise 2.2.2e:
What language is generated by the following grammar? $S\rightarrow\textbf{a | }S\textbf{ + }S\textbf{ | }S\textbf{ }S\textbf{ | }S\textbf{ * | ( }S\textbf{ )}$
This looks like some combi... |
If an algorithm has running time of $\Theta(n^2)$, is it possible to have a best-case running time of $\Omega(n)$? Or is the fastest running time only $c n^2$ for some constant factor $c$?
|
Manually self-migrated from stack overflow.
A set of objects of a type T is often represented using its indicator function (set T = T -> bool). However, for practical purposes this representation isn't necessarily very useful. For instance, if T is the natural numbers, there's no way to print0 out all of the numbers ... |
Firstly, I'd like to apologize for any misused terms or ways I could have made the description much more succinct. It's been a while since I took machine learning during my bachelor's.
I have two disconnected, directed graphs that I am attempting to merge together. Each node in the graph represents a set of data. Each ... |
My textbook shows that when setting up a recursion tree for a recurrence, like
$$T(n) = 3T\big(\frac{n}{4}\big) + cn^2$$
you place the cn^2 term at the root to represent the cost of at the top level of recursion and the three subtrees of the root represent the costs incurred by the subproblems of size n/4.
Why do you p... |
What is the complexity of the Canadian traveller problem variant where the only thing that is seen is a single node ahead on a directed acyclic graph so that we cant go back once we go to a new node and there are some nodes that have a probability associated and we dont know the probability of others?
|
I've just done a mini test and scored 9/10, however, from my understanding, I think this question is incorrect.
Here is the only question which I don't understand how it can be correct:
So I joined up the relations and get this:
A | R.B | S.B | C | D
1 | 2 | 2 | 4 | 6 //this meets theta-condition R.A<S.C AND ... |
The question has been discussed here but unfortunately is closed.
Reference : m-element random sample being equally likely ...(CLRS 5.3-7)?
My question is as follows.
Suppose $n = 5, m = 3$. This implies that we need to randomly select a $3$-subset out of $5$ elements. The algorithm makes $3$ recursive calls. The proba... |
In a previous question What exactly is an algorithm?, I asked whether having an "algorithm" that returns the value of a function based on an array of precomputed values was an algorithm.
One of the answers that caught my attention was this one:
The factorial example gets into a different model of computation,
called... |
A soft question, when I was in high school and in University I took scientific writing classes and people told me I should use passive voice as much as possible to sound objective, but when I entered grad school people told me I should not use passive voice unless I work in Chemistry. So Which one should I follow?
|
This is in context of hashing of strings. I'm not sure why a string like, CS, could be represented as CS = 'c'*256 + 's'
Does anyone know about this?
|
I've been reading about fixing up after an insertion into a red black tree. (http://web.cse.ohio-state.edu/~lai/2331/0.Red-Black%20Trees.pdf)
The most surprising part is not that there are 6 things that we need to do after inserting into a red black tree. i.e. if both parent, uncle red, then parent, uncle black, grandp... |
Is there a difference between perfect, full and complete tree? Or are these the same words to describe the same situation?
|
Our teacher gave us the following definition of Big O notation:
O(f(n)): A function g(n) is in O(f(n)) (“big O of f(n)”) if there exist
constants c > 0 and N such that |g(n)| ≤ c |f(n)| for all n > N.
I'm trying to tease apart the various components of this definition. First of all, I'm confused by what it means for g(... |
Given a set of integers $\{x_0, x_1, ... , x_{n-1}, x_n\} \subseteq \mathbb{Z}$, a set of integer variables $\{y_0, y_1, ... ,y_{n-1}, y_n\} \subseteq \mathbb{Z}$ and an integer $m \in \mathbb{Z}$ is the following equation an instance of an integer linear program (ILP):
$
(x_1\cdot y_1) + (x_1\cdot y_1) + \cdots + (x_{... |
I have been struggling trying to write a regular expression for a binary number that includes "10" and has an odd number of 0's, so far I have (1) * (00) * 10(1010) * (00) * (1) * but it doesn't accept 0100 for example or 010101 etc, also if I write a finite automata for this how do I prove its correctness ?
|
On the wikipedia page for the knapsack problem it says that the runtime is $\mathcal{O} (nW)$ and goes on to say that this doesn't violate its classification as NP because the input size is related to $\log W$, where, I believe, $W$ is the size of the knapsack. Why is the size of the input related logarithmically to $W... |
I am currently at student at Turing and I would like to learn more about algorithmic design while studying programming. Our school mainly deals more with web software, Ruby, and Rails, but I would like to gain an education in algorithms and data structure while here.
Do you have any books for beginners on algorithms or... |
I'm learning how to use recursion trees to solve recurrence relations and while I know how to solve it for the form
$$T(n) = aT\big(\frac{n}{4}\big) + n$$
I'm stuck when the equation has a numerical term, like
$$T(n) = aT\big(\frac{n}{4}\big) + 3$$
Using a recursion tree, what gets multiplied at the first, second, thir... |
Wikipedia says that the following recurrence is inadmissible since there is a non-polynomial difference between $f(n) = \frac{n}{\log n}$ and $n^{\log_b a}$:
$$ T(n) = 2T\left(\frac{n}{2}\right) + \frac{n}{\log n} $$
In human language, what does non-polynomial difference mean? Why was $n/\log n$ compared to $n^{\log_ba... |
This statement is Theorem 1.1 (page 39) of Computability, Complexity and languages by Martin Davis:
If function $h$ is obtained from the (partially) computable functions $f$, $g_1$, $g_2$, ..., $g_k$ by composition then $h$ is (partially) computable.
What I understand from this theorem is if there is at least one par... |
So I am learning about DFA and NFA, and I need some clarification for it.
DFA
accept empty set
transition for every element in the alphabet
path are deterministic
NFA
accept the empty set and empty string
path are not deterministic
My question is does NFA need a transition for every element in the alphabet? If ... |
I was reading binary search and suddenly realized that it would be very difficult for a binary search tree to find the middle value and then split in two. Are these related at all?
|
I do not have a background in Computer Science, work as a Software Engineer, and am attending college for my Master's degree in Computer Science. I have a data structures and algorithms course that I am taking currently with the "Introduction to Algorithms" text book by Cormen, Leiserson, Rivest, and Stein (CLRS). This... |
When applying the pumping lemma to $L = \{ 0^n \mid n>0\}$ I do the following:
$S = 0^p$
$x = \varepsilon$
$y = 0^p$
$z = \varepsilon$
so $S = xyz = (\varepsilon)0^p(\varepsilon)$
For $x y^i z$ if i choose $i = 0$ (pumping down)
i get $S = \varepsilon$, which is not an element of $L$.
Therefore according to the pumping... |
I was learning about NP problems. I read that for many problems, like Clique, we can easily convert its decision problem to derive a solution of search problem. (For Clique problem, you only need to enumerate the vertices of $G$ and delete any vertex that if your decision function tells you is not in the clique) But fo... |
I'm looking for a particular case of longest common substring (LCS) problem. In my case I have two really big strings (tens or hundreds of milions byte characters) and need to find the LCS and other long strings.
A simplified example
$S_0$ = ABBCADGGHEEASSSCC
$S_1$ = ABDCADGGHMEASSSAC
the LCS = CADGGH (6 chars) and o... |
Is there any difference between a $\lambda$-term and a $\lambda$-expression?
Looking at the recursive definitions on Wikipedia of
$\lambda$-term and $\lambda$-expression, they are equivalent. But I am confused as they are slightly different and refer to what they define by a different name.
|
I'm learning to use a Karnaugh map, but I'm not sure if I obtained the simplest expression possible. Have a look at this example:
Truth table (inputs are A B C; output is F):
A B C | F
0 0 0 | 1
0 0 1 | 0
0 1 0 | 1
1 0 0 | 0
0 1 1 | 1
1 0 1 | 1
1 1 0 | 0
1... |
Let a real polynomial representing a boolean function be $P(x_1,\dots,x_n) = \sum_{a\in\{0,1\}^n}c_ax^a = \sum_{a\in\{0,1\}^n}p(a)\prod_{i\in 1_a}x_i\prod_{j\in \bar{1}_a}(1-x_j)$ where $1_a$ is the set of $i$ such that $a_i=1$ and $\bar{1}_a$ is the complement of $1_a$. How do you represent $c_a$ in terms of $p(a)$?
I... |
We recently in computational complexity class dealt with approximation algorithms and I was wondering how one would prove a heuristic having a certain ratio in regards to the optimal version. Looking at some notes it seems that one has to relate the approximation to an intermediate algorithm, right?
|
I'm looking for a data structure / algorithm to store an unordered set S of binary strings of a fixed length n (i.e. all matching the following regular expression: [01]{n}).
Insertion and lookup ("Is element x in the S?") should maximally take polynomial time to |S|.
The space complexity should be logarithmic to |S| fo... |
I'm wondering if somebody can please help me to understand how I go about converting this grammar to an unambiguous grammar. If you can point me in the right direction, I would greatly appreciate it.
S -> AB | aaB
A -> a | Aa
B -> b
|
I know this question might seem weird, maybe I'm just overthinking, but this is really troubling me because I've been a computer engineer for some time now and conditionals (if statements for instance) always seemed pretty clear and intuitive!
I mean, let's assume that I have a program which starts at
int main(int arg... |
Initially the ambiguous grammar is as follows (with some cropped production rules):
<STMT> --> <IF-THEN> | <IF-THEN-ELSE>
<IF-THEN> --> if condition then <STMT>
<IF-THEN-ELSE> --> if condition then <STMT> else <STMT>
To resolve the ambiguity, the previous grammar is transformed into the following one i... |
When applied to domains that are episodic and have a "final" state but no final action, like a game, how does SARSA update the Q-values?
e.g. A game agent would receive this series:
$$
s_0,a_0,r_0,s_1,a_1,r_1,.....s_{N-1},a_{N-1},r_{N-1},s_N
$$
Based on the traditional definition, which updates the current Q-value ... |
I was doing some complexity theory exercices and I came over this one:
$AlwaysHalt = \{R(M) | M$ halts with all $x \in \{0,1\}^*\}$
Is $AlwaysHalt$ recursively enumerable?
I would say YES and construct the following TM that accepts this language:
Enumerate all $x \in \{0,1\}^*$ starting with length 1 and then increasin... |
Approximating the traveling salesman problem (TSP) within a constant factor $k$ is hard. The standard proof shows that the existence of such an approximation allows the Hamilton Cycle problem to be decided. This standard proof is discussed in many places including accepted answers on cs.stackexchange here and here.
B... |
For simplicity assume that both have the same size N.
the lengh of this subsequence can be at most N, so maybe it's
max(C(N,1), C(N,2), ... , C(N,N))?
|
So basically, there are several (finite number of) Turing machines being able to read off and write to the same set of tapes (the number of tapes is finite, but each tape may have infinite tape spaces). And then we consider a group/machine of these machines to solve a problem. Would this machine be Turing machine-equiv... |
Modern non-cryptographic 32- and 64-bit valued hash functions, for example, lookup3, MurmurHash3 and CityHash, have quite sophisticated loops, each iteration of which include many multiplications, XORs and rotates. Why this is needed, since there are good avalanche procedures (32 -> 32 and 64 -> 64 bits), which mix the... |
I'm looking for an algorithm that -- given a positive integer $n$ -- outputs a positive integer $\bar{n}$ with the following two properties:
$(\bar{n}+1)^2>n$;
$(\bar{n}-1)^2<n$;
So we have $\bar{n}=\lfloor\sqrt{n}\rfloor$ or $\bar{n}=\lceil\sqrt{n}\rceil$ for every $n$. The point is that I don't care which it is, a... |
The Y combinator has the type $(a \rightarrow a) \rightarrow a$. By the Curry-Howard Correspondence, because the type $(a \rightarrow a) \rightarrow a$ is inhabited, it must correspond to a true theorem. However $a \rightarrow a$ is always true, so it appears as if the Y combinator's type corresponds to the theorem $a$... |
From https://en.wikipedia.org/wiki/Abstract_machine
A typical abstract machine consists of a definition in terms of
input, output, and the set of allowable operations used to turn
the former into the latter.
The best-known example is the Turing
machine.
In a Turing machine, what is its set of operations?
Is $... |
Procedure: Start a secondary TM in parallel with the first, but have the second perform exactly 1 step each 2 steps the first TM performs (i.e. it runs at half speed). If the second machine ever reaches the same configuration as the first, a loop was detected (obviously).
Claim: All infinite local loops in a TM can be... |
I just started a course called 'Automata and Formal Languages'.
I'm having difficulty in proofing\disproofing this equality.
$ (L_{1} \circ L_{2})^{+} = L_{1}^{+} \circ L_{2}^{+}
$
Where:
$ L_{1} $, $L_{2}$ are Languages.
$\circ$ is the concatenation operation between two languages.
$+$ is the Kleene plus closure d... |
I'm doing some practice papers for revision for my finals and I came across this question:
"This question is about recursion. A recursive method can always be implemented by an iterative method that uses a stack to keep track of intermediate values. Could the stack be replaced by, for example, a queue? Explain (no exp... |
When bulk-loading R-tree with points one can simply sort the elements by some coordinate and split to equal-sized chunks. But if the elements have some extent, sorting them by their coordinate value (whether minimum, average or maximum) can still lead to large overlap if there are some large elements involved.
(Update)... |
Turing Test definition taken from wikipedia:
The Turing test is a test of a machine's ability to exhibit
intelligent behavior equivalent to, or indistinguishable from, that of
a human. In the original illustrative example, a human judge engages
in natural language conversations with a human and a machine designe... |
I need someone help me about . how can compute time complexity for this algorithm (Menezes-Vanstone Elliptic Curve Cryptography).
I have spent much time reading journals and papers but as yet have been unable to find any record of that performance complexity.
It is known that the algorithm is
encryption function is :
$... |
Problem: Find optimal values for four parameters which are used to tune an algorithm under the constraints of accuracy, time and memory.
I have an indexing scheme used to search for the K-nearest neighbors of a point in many dimensions. This indexing scheme has four adjustable parameters. For each given fixed problem s... |
There is at least one (1) distributed version propsosed for the push-relabel maximum-flow algorithm. I wonder if and how this algorithm can cope with nodes leaving or enterig the graph during runtime. Is there any work about this?
1 Andrew V Goldberg and Robert E Tarjan. A new approach to the
maximum-flow problem. Jour... |
Kolmogrov complexity is known to be uncomputable. Why can't we enumerate all programs of size i = 0 in lexicographical order - if any produce string s, that is the Kolmogrov complexity; if not, increment i and iterate? Won't that prove that no program of length < i generates string s?
|
Does anyone have a good reference to pseudocode for Monge-Elkan string comparison algorithm?
I have access to the two original papers, but they do not show the pseudocode of the actual algorithm. Also, I have seen some implementations in Java (preference), but they are part of the larger package and with a complex inh... |
Having a hard time formulating the proof for this. The professor kinda breezed through the problems and I just want an explanation on how best to tackle this and how one would prove what it's desiring:
"Consider the following heuristic for building an approximate TSP cycle for a graph that satisfies the triangle inequ... |
An algorithm is a finite sequence of operations on an abstract machine. (Correct me, if I am not correct).
If two algorithms can take the same set of inputs, and for each input, they generates the same sequence of intermediate and final results/output, are they the same algorithm?
What I am thinking is if an algorithm ... |
I have a set of numbers S of cardinality N, and a collection of sets each containing some subset of S. The cardinality of each of these sets can be anywhere from 1 to N. The number of sets is variable, but is necessarily at least N.
e.g.
$S = \{1, 2, 3, 4, 5, 6, 7, 8, 9\}$
Sets:
$\{3, 6\}$
$\{1, 2, 5\}$
$\{5\}$
$\{2,... |
An algorithm on an abstract machine is a finite sequence of operations of the machine. (Correct me if I am not correct.)
However, there are
different kind of algorithms, such as deterministic, non-deterministic,
and randomized algorithms, and possibly others.
Are these algorithms running on deterministic Turing Machine... |
I have an arbitrary 2d area on the xy plane. I want to cover it with N discs such that all points in the area have at least one disc overlapping it. A disc with center (xc, yc) placed inside this area has a radius r that is a function of (xc,yc).
I am looking for references or algorithms that can help me to minimize N ... |
Given a Bayesian network, say a -> b -> c, all binary random variables (I won't show the CPTs, assume they are given). You are told b and c are true. How do you calculate the P(a=True)?
|
Given a sequence of numbers $a_1, a_2, ..., a_n$, a number $a_i$ is called the $k$ local maximum $\iff i > k$ and $a_i$ is the largest number among the $(k+1)$ numbers $a_{i-k}, a_{i-k+1}, ..., a_i$. Given a sequence of $n$ numbers $a_1, a_2, ..., a_n$, and an integer $k$, I am requested to find all $k$ local maximums ... |
I am trying to classify the Differential Evolution algorithm according to the framework in the book:
Introduction to Evolutionary Computing
The authors classify the field of evolutionary computation into 4 paradigms:
Evolutionary programming
Genetic programming
Evolutionary strategies
Genetic algorithms
I have rule... |
in one of my algorithm courses i'm studying the FM-Index.
In one of the exercise I'm trying to do I was asked to give a procedure to search patterns of the form w* (where * indicates any character) using backwards search (see here).
How could this be possible? It seems to me that the algorithm already returns all the p... |
If the runtime of a recursive algorithm could be expressed as
$T(n) = \begin{cases}O(1) & n \leq c \\ k * T\left(\frac{n}{k}\right) + \left(k + n * k \right)\end{cases}$
what would be the result of the asymptotic analysis (the Landau class)? $k \in \mathbb{N}, k \neq 0 $ is a constant value.
I would say that $k$ even ... |
We want an algorithm that, given an array of length $n$ of integers, find the minimum difference between two integers in the array.
One such algorithm is to sort the array and check adjacent pairs of numbers. This takes time $O(n\log n)$.
Is there a faster way, e.g., an $O(n)$ algorithm?
|
Looking for Newton's method in Wikipedia, I read the following:
In numerical analysis, Newton's method (also known as the
Newton-Raphson method), named after Isaac Newton and Joseph Raphson,
is a method for finding successively better approximations to the
roots (or zeroes) of a real-valued function.
After desc... |
I'm aware of prime decomposition and parallel approaches to calculating one factorial; however, if I want the factorials of all numbers up to $n$, is there anything more efficient than the naive approach? As far as I can tell, at least the prime decomposition algorithms aren't any more useful here than the naive approa... |
We want an algorithm that, given an array $A$ of length $n$ of integers (indexed by $A[0],A[1],\ldots,A[n-1]$, determine values $i<j$ that maximizes $j-i $ subject to $A[j]>A[i]$ (if such values $i,j$ exist.)
One possibility is as follows: First check whether the array is non-increasing. If so, no such $i,j$ exist. Els... |
Assuming we have an array with $n$ Elements and want to find an unique element by randomly (uniformly) choosing. What would be the average case runtime?
My thoughts so far:
The chance to find the element is $\frac{1}{n}$ in every step. Thus, to find the element after $k$ steps is $(\frac{1}{n})^k$. Now we can calculate... |
In one of his conference talks Jim Weirich derives the applicative form of the y-combinator by refactoring a partial definition of factorial. The starting point in his talk is different than what follows here but the ideas are all the same.
Let's start with the following function
# partial definition of factorial
f = \... |
I know how to calculate the CPI or cycles per instruction from the hit and miss ratios, but I do not know exactly how to calculate the miss ratio that would be 1 - hit ratio if I am not wrong. I know that the hit ratio is calculated dividing hits / accesses, but the problem says that given the number of hits and misses... |
In computation theory, when talking about the computability and complexity of a
problem, what is the definition of a problem?
How specific should a problem be? For example, can the followings
all be function evaluation problems?
evaluate $f$, where $f(x)=x^2, x \in \mathbb R$
evaluate any function in $\mathbb R^{\ma... |
My definition of an algorithm is a finite sequence of operations
provided by an abstract machine, where the operations are executed
one after another in the order specified by the sequence.
Different machines may provide different sets of operations, so the
definition of an algorithm depends on the abstract machine an... |
Let $x$, $u$, $v$, $w$, $y$, $x'$, $u'$, $v'$, $w'$, $y'$ be words. If
$y'x' = xy$
$y'u'x' = xuy$
$y'v'x' = xvy$
$y'w'x' = xwy$
$y'v'u'x' = xuvy$
$y'w'v'x' = xvwy$
all hold, then I need to prove that $y'w'v'u'x' = xuvwy$.
I'm a little confused how to prove this, How can I form $y'w'v'u'x'$ from the equations above?
|
Is there a generalization of maximal satisfaction (MAX-SAT) based on infinitely many variables? One natural occurrence of such problem is the general Ising model in material science.
|
I am trying to understand what hamming distance of a code is needed to detect a d-bit error, or to correct a d-bit error.
This is what I have found around the web:
If two codewords are Hamming distance $d$ apart, it will take $d$ one-bit
errors to convert one into the other.
To detect (but not correct) up to $d$ er... |
I need some help with the following recursion:
$T\left(n\right)=T\left(\log_{2}n\right)+O\left(\sqrt{n}\right)$
More specifically I wish to find and prove the upper bound on it.
I have a hunch it is $O\left(\sqrt{n}\right)$ but have gotten stuck proving it really is this.
Any help is appreciated
Thank you!
|
I want to normalize elements in an array. The solution I found is to take the sum of the elements and divide each element with this total. Can you find more efficient way of doing this?
The runtime I achieve is 2N. Any better idea?
normalize(array)
{
sum = 0;
for i = 0 to array.size() do
sum += array[i];
... |
What is the lower bound for finding the third largest in a set of $n$ distinct elements?
For the case of finding the second largest, we have the tight lower bound of $n + \lceil \lg n \rceil -2$. The adversary argument can be found in this lecture, which also provides an optimal algorithm using the "Tournam... |
What is the difference between the LZW and Huffman's coding of text compression ?
I've read this and
this , but I'm not able to distinguish ?
|
Background Information
I am currently doing research for my final year project in college. I am planning on building an ambulance booking system that will ease the process of booking an ambulance for patient transfer - that is to transfer a patient from one hospital to another.
A subsystem of the overall booking system... |
In the second edition of the book of Cormen "Introduction to Algorithms" appears the following example (in the left part is the residual network while in the right part shows the flow results):
I have a problem understanding the part (c). The augmenting path is $s\rightarrow v_2\rightarrow v_1\rightarrow v_3\rightarro... |
In the Paxos consensus protocol, a fact that follows from its construction is "any two majority sets of acceptors will have at least one acceptor in common". This observation can be extended to any N majority sets of acceptors having either at least one acceptor in common, or acceptors that are distinctly present in ea... |
This question repeats one that was closed.
Let $x, u, v, w, y, x', u', v', w', y'$ be words satisfying
$y'x' = xy$.
$y'u'x' = xuy$.
$y'v'x' = xvy$.
$y'w'x' = xwy$.
$y'v'u'x' = xuvy$.
$y'w'v'x' = xvwy$.
Show that $y'w'v'u'x' = xuvwy$.
|
This is an extension of a previous question asked by a different user earlier:
Let $x, u, v, w, y, x', u', v', w', y'$ be words satisfying
$y'x' = xy$.
$y'u'x' = xuy$.
$y'v'x' = xvy$.
$y'w'x' = xwy$.
$y'v'u'x' = xuvy$.
$y'w'v'x' = xvwy$.
Then $y'w'v'u'x' = xuvwy$.
Now, using the above result, show that a regular la... |
Note that this is not shuffle but perfect shuffle, defined as follows:
Let $w = a_{1}a_{2} \ldots a_{n}$ and $x = b_{1}b_{2} \ldots b_{n}$ be two strings of the same length. Then the perfect shuffle of $w$ and $x$ is defined as $a_{1}b_{1}a_{2}b_{2} \ldots a_{n}b_{n}$.
So the question is: are context free languages clo... |
I don't know what is meant by "decision version of integer programming".
I know ILP, but this terminology has me confused.
|
Define $FH(L) = \{x \in \Sigma^* : \exists y \in \Sigma^* \text{ with } |x| = |y| \text{ such that } xy \in L\}$. In other words, $FH(L)$ is the set of first halves of even length strings in $L$. Given this, if $L$ is context-free, must $FH(L)$ be context-free?
Here's my attempt at a proof:
Since $L$ is a CFL, the... |
Suppose we are given a collection of $n$ strings, $S_1,\dots,S_n$. I would like to know whether any of those strings is a substring of any other string in the collection. In other words, I'd like an algorithm for the following task:
Input: $S_1,\dots,S_n$
Output: $i,j$ such that $S_i$ is a substring of $S_j$ and $i\n... |
I'm taking an introductory quantum computations class and I am attempting to solve the following question(s), but we haven't touched on black box algorithms like this in class, and I honestly don't know how to solve the question at all. Would it be possible to help me through the steps?
Question. Consider the set of ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.