instruction stringlengths 35 29.1k |
|---|
There are lots of questions about how to analyze the running time of algorithms (see, e.g., runtime-analysis and algorithm-analysis). Many are similar, for instance those asking for a cost analysis of nested loops or divide & conquer algorithms, but most answers seem to be tailor-made.
On the other hand, the answers t... |
I was reading up on Dynamic Programming when I came across the following quote
A dynamic programming algorithm will examine all possible ways to
solve the problem and will pick the best solution. Therefore, we can
roughly think of dynamic programming as an intelligent, brute-force
method that enables us to go th... |
I met a recurrence equation for my algorithm
$$ f(n) = 2\cdot \left( f(n-1) + f(\frac{n}{2}) \right)$$
with $f(1)=1$, $f(2)=4$, $f(3)=10$.
I guess it is $\Theta((2+\epsilon)^n)$, where $\epsilon$ ban be arbitrarily close to 0.
I want to have an asymptotic formula of $f(n)$. I do not know how to prove or disprove my ... |
I saw the answer in one of the solutions and I cannot figure out how they got the answer. The question is asked if the word is in the language or not for CNF...
How did they get the answer so that ab is in the language and aaaa is not in the language here ?
S -> aSb |ab
ab Yes
aaaa No
aabb Yes
edit:
is aaaa N... |
I don't know the proper mathematical expression for for-loops, especially those that carry two distinctly behaving variables with each iteration.
For example, assuming n is previously defined and holds some positive integer, how I would I represent the set printed by this for-loop in mathematical notation?
// prints a ... |
I am trying to use the pumping lemma to show this language is not context free:
$L = a^nb^{n+1}c^{2n} : n \ge 0$
So I took $z = a^mb^{m+1}c^{2m}$ where $|z| = 4m+1 > m$. We can decompose $z = a^mb^{m+1}c^{2m}$ to $z = uvwxy$ for $|vwx| \le m$ and $|vx| \ge 1$.
I am confused about what cases to consider to show this is ... |
Dijkstra's algorithm is often quoted as being used to find the shortest path route however I was surprised to know that there exist A* search which is a extension of Dijkstra's algorithm.
How is it that A* search algorithm is able to perform better compared to Dijkstra's algorithm , what sort of technique does it used... |
In an assignment I've been asked to find a CFG for $a^x b^y a^z b^w$, where, $x,y,z,w \in \mathbb{N}^+$, $y > x$, $z > w$, and $x+z = y+w$. A hint was given, think of the language as $(a^p b^p)(b^q a^q)(a^r b^r)$.
I've had a go at it, and have come up with
S -> A
A -> aAbB | ab
B -> bBaC | ba
C -> aCb | ab
This ... |
Is there any specific name for strings of data that have well defined format ? For example URLS, domain names, IP Addresses, Email addresses, File Paths etc. are all having well defined delimiters and data formats. What are these special strings in general called ?
|
The link in wikipedia about kd-trees store points in the inner nodes. I have to perform NN queries and I think (newbie here), I am understanding the concept.
However, I was said to study Kd-trees from Computational Geometry Algorithms and Applications (De Berg, Cheong, Van Kreveld and Overmars), section 5.2, page 99. T... |
I am working on an algorithm that requires me to interpolate a couple trillion positive discrete points with f(x) having low finite value (for example 0 - 5). It there a specialized algorithm specific for this reduced problem that can provide 0 error interpolation?
Could you maybe point me to a few papers?
EDIT: I noti... |
So in complexity theory, I've run across different definitions for NP problems --
Decision problems where a solution can be verified by a DFA in polynomial time
Decision problems where a solution can be found by an NFA in polynomial time
Is there one of the above that is generally more accepted as the "go-to" defini... |
I read that in a 2D space, the two points farthest away must be in the convex hull (CH).
Intuitively, I can see why. If the two farthest points are not in the convex hull, then there must be a point that is outside the convex hull (contradiction). I know that a vertex of CH has two adjacent edges that converge at that ... |
Has the following problem been studied before? If yes, what approaches/algorithms were developed to solve it?
Problem ("Maximum Stacking Height Problem")
Given $n$ polygons, find their stable, non-overlapping arrangement
that maximizes their stacking height on a fixed floor under the
influence of gravity.
Exampl... |
I'm trying to understand/show that DNF VALID is coNP-hard. I have given an algorithm for the complement of DNF VALID and shown that this is in NP (since the complement of a language in NP is in coNP), but I'm really struggling to show that DNF VALID is coNP-hard.
The complement of DNF VALID = {ϕ | ϕ is not in DNF OR ... |
My research is in the area of Document Image Analysis. To be specific, the topic of my thesis is to automatically recognize and index characters in a set of hand-drawn objects, e.g. given a volume of comics --> how to localize, recognize then index the characters in it (e.g. return "Lucky Luke" position in some random ... |
I'm working on making patterns for a digital lava lamp (essentially, making interesting patterns using a 4x10 grid), and I've been looking into cellular automata. I tried implementing some variations on Langton's Ant but it tends to loop in very boring ways. Does anyone have any suggestions for interesting automata on ... |
I am curious as to what steps one would reasonably need to take to perform an extraction-based text summarizer.
I've taken a look at some papers I've found on Google such as this one, which explains that UPGMA is the best clustering algorithm (out of the tested set). I've also found this one to be interesting, regardin... |
The original problem of Domino Tiling and Wang Tile has great theoretical interest on computability theory... However, the great emerging problem on application of Wang Tile in material science and physics requires the tiling to satisfy one more condition:
The tiling should satisfy some proportionality, say, Tile 1 sho... |
Real world background: There are 2 independent sources of polygon definitions, with arbitrary parameters. Meaning each source has it's own floating point precision, starting point and orientation of vertices.
The problem is to find an algorithm, that would receive those 2 polygon definitions and by a certain margin dec... |
Giving the following Grammar:
S → ^ | SaSMSM | SMSaSM | SMSMSa
M → b | c
^ means eopsilon.
How can i check whether its ambgious or not?
My intuition is that its not: every time you derive,the a is placed in different places between the M's.
Can you give me a clue to get a better prove? Or give an example for its ... |
A (now closed) question on SO made me think about the following problem:
Given an arbirtary number of points (2D), draw a path that consists of
straight lines between points, visits each point exactly once and does
not intersect with itself.
I came to the conclusion that this is easy if I can chose starting and e... |
This is about basic machine learning which I do not understand clearly.
I have 2 Gaussian models $G_1$ and $G_2$ and given a list of data as below.
(1, 3, 4, 5, 7, 8, 9, 13, 14, 15, 16, 18, 23)
I do not know which numbers were generated by which $G_i$ model, but I want to do Expectation Maximization for clustering.
So,... |
What is the time complexity of Halley's Method?
I am thinking ${\cal O}(\log(n)F(n))$, or something very similar to Newton-Raphson, but I feel as though there should be some change to the complexity in order to yield the greater convergence. However, I can't seem to find any solid ground to support any of my ideas (as... |
Is there any way to determine inner angle of twisted polygon? (Here's a picture of "normal" and "twisted" polygon http://courses.be.washington.edu/ARCH/481/1.Tapestry%20Reader/1.Data/6.Problems/graphics.invis/fulltwist.gif )
I know how to determine inner angle of polygon if I know its orientation (CW or CCW), however t... |
Say we have a set of numbers $A=\{a_1, a_2, \dots, a_n\}$, and we wish to sum over all possible combinations of $k$ terms to compute
$$
\sum_{\substack{C \subseteq \{1,2,\dots,n\} \\ |C|=k}} \prod_{c \in C} a_c
$$
Naively this requires $O(k\binom{n}{k})$ operations.
This is different from from computing the permanent w... |
I have a problem which essentially reduces to this:
You have a black-box function that accepts inputs of length $n$.
You can measure the amount of time the function takes to return the answer, but you can't see exactly how it was calculated.
You have to determine whether the time-complexity of this function is polynom... |
To understand the effectiveness and/or efficiency of a protocol implemented in distributed storage systems, it is often desirable to evaluate it in a quantitative way under a hypothetical model.
Obviously, every model is an approximation to the reality and there is not an all-purpose one. I expect to do a mini survey ... |
In my first lecture of "Theory of Automata", after giving some concepts of Alphabet, Language, transition function etc. and a couple of simple automata of an electric circuit with one and two switches, is this question.
I understand what an Alphabet as well as the Language of a DFA is, but are there any rules or steps... |
Which of the following interrupts has the highest priority in 8086 micro-processor:
Overflow,
NMI or
Type 255?
The book I read suggests that type 255 has highest priority.
But most of the searches on google showed that it is NMI. Which is true?
|
Trying to understand the concept of NP-completeness, I came across this pearl on Wikipedia:
From NP-complete:
A decision problem L is NP-complete if it is in the set of NP problems
and also in the set of NP-hard problems.
From NP-hard:
A problem H is NP-hard if and only if there is an NP-complete problem
L that is... |
Using gradient descent in d dimensions to find a local minimum requires computing gradients, which is computationally much faster than Newton's method, because Newton's method requires computing both gradients and Hessians.
However, gradient descent generally requires many more iterations than Newton's method to conver... |
I'm trying to find reduction from 3-SAT to Max-2-SAT, so far no luck.
Let me first describe it.
3-SAT: Given a CNF formula $\varphi$, where every clause in $\varphi$ has exactly 3 literals in it, one should determine if there exist an assignment that satisfies it.
Max-2-SAT: Given a CNF formula, where every clause in ... |
Suppose I have an algorithm that has a performance of $O(n + 2)$. Here if n gets really large the 2 becomes insignificant. In this case it's perfectly clear the real performance is $O(n)$.
However, say another algorithm has a performance of $O(n^2/2)$. Here if n gets really large then $n^2/2$ is exactly half of $n^2$, ... |
I have the following algorithm
void NQueen(int k,int n)
{
int i;
for(i=1;i<=n;i++)
{
if(place(k,i)==1)
{ x[k]=i;
if(k==n)
{
printf("Solution\n");
printboard(n);
}
else
NQueen(k+1,n);
}
}
}
int place(... |
All data recovery companies, regardless of skill, unanimously say that if the memory chip of a device has just a hair line crack, data recovery is impossible. Not unlikely, not expensive, but impossible. One company even stated that even the FBI can't retrieve the data. Is this true?
Why is this? I find it hard to beli... |
What is the fastest way to get one of the value from set of intervals which occurs most frequently?
For example if I have interval (0, 3) and (2, 4) the most frequent value can be 2 or 3.
|
In my computation book by Sipser, he says that since every language that can be decided in time $o(n \log n)$ is regular, then that can be used to show $TIME(n \log (\log n))\setminus TIME(n)$ must be the empty set. Can anyone show me why this is?
both $TIME(n\log(\log n))$ and $TIME(n)$ are regular. I think that only ... |
I'm taking a class on graph theory that uses "Graph Theory (Graduate Texts in Mathematics)" by Bondy and Murty. One of the questions is about Cayley graphs and the n-cube, and I don't understand how to interpret it. It runs as follows:
Let $\Gamma$ be a group and $S$ be a subset of $\Gamma$ not including the
identit... |
In mathematics , an $n$-ary relation is subset of cross product on $n$ sets took under consideration.
Let us take $A_1,A_2,A_3 \cdots A_n$ be the n sets.
Then relation $R \subseteq A_1\times A_2\times A_3 \times A_n$ .
Here $X$ represents cross product betwen two sets.
If we consider first $k$ sets as input domain and ... |
I always thought that TSP currently requires time exponential in the number of cities to solve.
How, then, has Concorde optimally solved a TSP instance with
85,900 cities?!?
Is this a typo? Is the base of the exponential 1.0000000000000001 or similar? Was it an instance specifically constructed to be solvable easil... |
According to Introduction to algorithms by Cormen et al,
$$T(n)=2T(n/2)+n\log n$$ is not case 3 of Master Theorem. Can someone explain me why?
And which case of master theorem is it?
|
mexp ::= (< mexp >) | < mexp >< mathlowop >< mexp > | < mulexp > | < float > | < var >
mulexp ::= < mexp >< mathhighop >< mexp >
mathlowop ::= + | -
mathhighop ::= / | *
That's the BNF I've come up with for parsing simple mathematical expressions where the operands can only be floats or variables. I've looked at a numb... |
How to think about dynamic algorithms which allows negative integers in input (where it's problematic, because obviously it's not always the case)?
Examples:
Partition Problem with negative numbers in set allowed
Knapsack problem with negative weights are allowed
Is there some general idea to handle these or other si... |
I understand this is a slightly vague question, but there are results for P vs. NP, such as the question cannot be easily resolved using oracles. Are there any results like this which have been shown for P vs. NP but have not been shown for P vs PSPACE, so that there is hope that certain proof techniques might resolve ... |
I have the following simple algorithm to find duplicate characters in a string:
for i = 1 -> n
for j = i + 1 -> n
if A[i] == A[j] return true
return false
Why is the running time of this algorithm $\mathcal{O}(n^2)$?
If the first iteration is $n$ steps then, $n-1, n-2,n-3,..,1$ it seems to me that
adding... |
Say that $f(n) = \cal O(n^2)$ and $g(n) = \cal O(n)$.
If $h(n)=f(n)/g(n)$, is it true that $h(n) =\cal O(n)$?
Is it mathematically correct to say that $h(n) = \cal O(n^2)/ O(n) = O(n)$? if not, what would be the correct way to show this?
|
I have a question about the common course "Computer Architecture".
How is it possible to have a LOCAL Branch Predecitor with 1024 entries, 3 bits for HISTORY but without a TAG.
As I understand,in that way i will get a Global branch predictor because i dont have a way to map a branch to an entry. Am I right? If not,How ... |
Subset sum is given by this question:
"The problem is this: given a set (or multiset) of integers, is there a non-empty subset whose sum is zero?"
My question is: If the numbers in the set are functions of other numbers, is that still subset sum? For example
The set {1,2,3} where the first number is X, the second is X+... |
What is the difference between maximal flow and maximum flow. I am reading these terms while working on Ford Fulkerson algorithms and they are quite confusing. I tried on internet, but couldn't get a reasonable answer. I believe maximum flow is quite clear as it means maximum amount of flow that can be transferred from... |
In proving Parikh's Theorem, my Theory of Computer Science textbook defines a linear set as:
$u_0 + \langle u_1, \dots, u_m \rangle = \{u_0 + a_1u_1 + \dots + a_mu_m \mid a_1, \dots, a_m \in \mathbb{N}\}$ where $u_i$ are vectors of natural numbers.
and a semi-linear set as a union of finitely many linear sets. It goes ... |
In Sipser's Introduction to the Theory of Computation, there is an exercise that asks to prove $T$ decides $A_{TM}$, which is the language
$$A_{TM} = \{ \langle M,w \rangle | M \text{ is a TM and $w \in L(M)$}\}.$$
$T$ is a TM defined as follows. On input $\langle M,w \rangle$,
Write the description of a TM $R$ that ... |
I am confused regarding the statements provided by one of our faculty regarding
"Is it compulsory that every infinite set is non regular
though every finite set is a regular set".
Providing this example:
$$L= \{ 0^n 1^n | n>=0 \} $$ its formal as $\Sigma=\{0,1\}$ and
thus we've a formal meaning as $\{... |
Given
weighted directed graph $G = (V,E,w)$, where $w : E \to \mathbb R^+$
source vertex $v \in V$
vertex subset $U \subset V$
how to find a shortest directed path from $v$ containing all vertices from $U$? Note that such path may contain vertices that are not in $U$.
Does such problem have a name?
How to find a sol... |
I am currently reading Fuss, Futexes and Furwocks: Fast Userland Locking in Linux and came across this quote:
In a fair locking scheme the lock is granted in the order it was
requested. This can have negative impact on throughput due to the
increased number of context switches. At the same time it can lead to
th... |
I'm just starting to get into the theory of computation, which studies what can be computed, how quickly, using how much memory and with which computational model.
I have a pretty basic question, but am really hoping some of you guys can help me understand the concept behind it:
Why is everything centered around the n... |
Suppose we have an $N \times N \times N$ 3-d sorted array meaning that every row,column, and file is in sorted order. Searching for an element in this structure can be done using $O(N^2)$ comparisons. However are $\Omega(N^2)$ comparisons needed in the worst-case? For an $N \times N$ 2-d sorted array I recall a proof t... |
I was asked to give a formal description of a Turing machine I have no experience with this, and was wondering what "formal description" entails.
|
I will try to give the motivation behind this problem and later the math formality.
Given a grayscale image (1 Channel - M by N Matrix).
Someone marks some pixels as anchors.
Now, you need to interpolate the other pixels (Which are not anchors) by minimizing a given cost function s.t. the end result is an image which h... |
If $A \leq_m B$ and $A$ is not mapping reducible to $co\text{-}B$, then $A \leq_T co\text{-}B$.
Is this true?
My intuition is false even if we can find some special case to make it true such as $A=B=co\text{-}A_{TM}$. However, I still can't find a counterexample.
Could anyone give me a little hint?
|
I'm having trouble grasping this the concept of reductions. I found the solution and it looks like this:
Assume that $M_5$ is a Turing Machine that can decide if a given Turing Machine $M$
accepts any string of length $5$, i.e., $L(M)$ contains a string of length $5$. The above figure shows how we can use this to cons... |
I'm writing an algorithm to solve a research problem involving searching for numbers on very large arrays.
I encountered a sub-problem that requires me to break up sums of numbers which are power of 2, i.e. how to find combinations of these numbers that sum up to a certain value. The sum and the combination size are gi... |
In section 9.2 of CLRS (Introduction to Algorithms; page 185 in the 2nd edition and page 215 in the 3rd edition), a randomized selection algorithm is presented.
For its analysis, $T(n)$ is a random variable denoting the time required on an input array $A[p \cdots r]$ of $n$ elements and $X_k$ is an indicator random va... |
In the coursera NLP course, Dan Jurofsky says you might want to extract relations from text to serve as input to other algorithms. What are examples of ways that researchers have used or might use relations extracted from text as the input for later "downstream" algorithms?
|
When learning about the architecture of computers and how it works, we are thought that the lowest language that we can find that the machine understands is binary as 1&0. And anything that we input will have to be transformed/converted to binary, but being binary numbers wouldn't that mean that we would need another i... |
I am trying to figure out what the big o estimate of the following for loop is.
for(int i = 10; i to 100; i++){
for(int j = 1; j to i; j++){
for(int k = 1; k to j; k++){
s=s+i+j;
}
}
}
I was thinking that the two inner loops run n times but I am unsure about the first loop.
What would the Big O estimate be for this c... |
Suppose I have a array of real numbers with $n$ rows and $m$ columns. I want to consider possible ways of dividing that array into rectangular regions of three different possible types: a constant value over the entire region, a linear gradient across rows or a linear gradient across columns.
For example, the array
$\... |
For $L_1,L_2 \in RE - R $ , I want to prove or disprove if the following can occur:
$L_1 \cap L_2 \in R$
$L_1 \cup L_2 \in R$
$L_1 \cap L_2 \in R$ and $L_1 \cup L_2 \in R$
What I did:
I think any two disjoint languages suffice, since the empty set is decidable.
I think something along the lines of a language and its... |
If I have 2 CPU's of the same manufacturer... say AMD
Both are Quad-Core, Both are rated at 3.6Ghz
1 is 100W, the other is 65W
Will the one with the higher wattage out-perform the lower one and why?
|
With regards to introductory (beginner) Von Neumann computer architecture, how does a program change the order in which instructions are executed?
I know the control unit is responsible for retrieving the instruction from memory and then decodes and executes the instruction. Their connected by a bus. The control unit a... |
Here's the code for the algorithm:
Foo(n)
lcm = 1
for i = 2 to n
lcm = lcm*i/Euclid(lcm,i)
return lcm
The running time of Euclid$(a, b)$ is given as $O(\log(\min(a, b)))$
So the running time of the for loop will be $O(n)$, so would this be the final running time? or do I have to take the $O(\log(\min(a, b... |
For instance, the tape on a Turing machine is infinite, where as we usually only have a finite amount of available memory. Secondly Turing machines are not really convenient IMHO for proving things about everyday algorithms on an everyday computer.
I want a model that makes computations in a ring, namely $\Bbb{Z}_p\ti... |
Thanks to Yuval Filmus, I got to read these lecture notes by Trevisan. At the bottom half of Page 5,
The capacity of cut $S$ is the number of edges that go from $S$ to $\overline{S}$, that is $\text{Capacity}(S) = |L_2|+|R_1|+\text{edges}(L_1, R_2)$.
Here, $L_1 = S \cap L$, $L_2 = L \setminus S$, $R_1 = S \cap R$ an... |
I'm studying Distributed Systems and synchronization and I didn't catch this solution of totally ordered multicast with Lamport timestamps. I read that it doesn't need ack to deliver a message to the application, but
"It is sufficient to multicast any other type of message, as long as that message has a timestamp larg... |
Given a program $P$ which takes a binary string as input, can one always (effectively) construct a program $P'$ such that $P'(0x)$ runs $P(x)$ and $P'(1x)$ outputs the source code of $P'$? I didn't find anything with some googling, but it seems like the kind of thing that could be known.
|
Let $L = \{ <M> | M$ halts on every input $x$ in at most $200 * |x|$ steps $\}$.
Is $L$ decidable? Recognizable?
Given that membership in $L$ asserts something about $M$'s behavior on an infinite set of strings, it seems extremely unlikely to me that $L$ could be either. I have shown that co-$L$ is Turing-recognizable... |
Sorry for the trivial question; has the following decision problem an "official" (possibly short) name?
Given two $n \times m$ $\text{0-1}$ (binary) matrices $M_1, M_2$ check if they are the same up to row and column permutations.
(something like the short names used in complexity theory for decision problems: e.g. ... |
On the matter of the Heartbleed bug, Bruce Schneier wrote in his Crypto-Gram of 15th April:
'"Catastrophic" is the right word. On the scale of 1 to 10, this is an 11.' I read several years ago that a kernel of a certain operating system has been rigorously verified with a modern program verification system. Could hence... |
I am trying to find out accept, loop and reject in this Turing Machine because it doesnt have any...I am not sure if I completely understand it but this is the turing machine I am talking about...
so accept state would be --> Accept(T2) - all words with a a
loop state would be --> Loop (T2) - /\
... |
On math.stackexchange, someone asked how to count the number of ways to place $1$'s into a $10 \times 10$ matrix so that every row and column has $5$ $1$'s. Each element of the matrix must be either zero or one.
I came up with a recursive solution for an $N \times 10$ matrix. Subproblems are indexed by the counts $c_... |
Wikipedia shows how one can determine the minimum vertex cover in a bipartite graph ($G(X \cup Y, E)$) in polytime from a maximum flow using alternating paths. However, I read that the (S,T) cut (extracted from the final residual network) can also be used to determine the minimum vertex cover:
$$(X\cap T)\cup(Y\cap S)$... |
I read that Category Theory has alot to do with how programs and information can be organised.Can Category theory simplify various programming strategies? If a specific Category is represented as a directed graph is this similar to flow charts used in programming?
|
Could most categories , or a finite part of them be represented on a subset of a complete graph of N vertices (Kn) which is connected. and partly directed? Could all the axioms of category theory be written for such graphs?
|
Is the language $L = \{a^nb^m : n = 2^m\}$ context-free?
Assume L is a context-free language. Then $\ \exists p\in \mathbb{Z}^{+}:\forall s\in L\left | s \right |\geq p. s = uvxyz,\left | vy \right |\geq 1,\left | vxy \right |\leq p. s_i = uv^{i}xy^{i}z\in L\forall i\geq 0\ $.
Let s = $\ a^{2^p}b^{p}\ $
Pumping i times... |
I have N events, each repeats after some time ti. I want a queue where I can pop out next event.
For example, I have events A,B,C with intervals 2,3,5 At the beginning they all are in the queue with values:
A-2, B-3, C-5
When I take out event, it should be A, after that I put it back, but add +2.
B-3, A-4, C-5
Next is ... |
I was reading a paper for recognizing interval graphs. Here is an excerpt from the paper:
Each interval graph has a corresponding interval model in which two intervals overlap if
and only if their corresponding vertices are adjacent. Such a representation is usually far
from unique. To eliminate uninterest... |
I'm looking for a sweep line algorithm for finding all intersections in a set of line segments which doesn't necessarily require the general position constraint of Bentley-Ottman's algorithm (taken from Wikipedia):
No two line segment endpoints or crossings have the same x-coordinate
No line segment endpoint lies upon... |
I have done the proof until the point when $T(n) \leq cn^{\log7}$.
But when it comes to finding the value of constant $c$, I am getting stuck.
The given recurrence relation is $T(n) = 7T(n/2) + n^2$.
Since we already calculated the solution above which is $cn^{\log 7}$.
Inductive step:
Now we have to prove that $T(n) ... |
I am in an entry-level algorithms class, and for our final project we are coding and thoroughly analyzing 6 different sorting methods. Part of the analyzation is timing the methods and comparing the runtime results depending on the original order of the array (in order to more fully grasp the concept of constant costs,... |
I was searching through Google and I couldn't find anything.
Can a Post machine have more than one accepting state?
|
Suppose there is a travelling salesman who wants to travel through N cities in k countries(k <= N). For convenience, he will travel all the cities within a certain country and then move to another. In each country, he wants to find out the shortest simple path to traverse through all the cities.[Classic TSP problem]
Q... |
According to information theory, the logic gates AND, NAND, OR, NOR all lose 1.189 bits of information each with two bits of information at their inputs and with all inputs being independently and uniformly distributed.
When gates are used in combination with other gates in a circuit, to calculate the entropy loss for ... |
Considering above terminologies for drawing control flow graphs for any program, it is very simple. For example :
While A
if B
do ..
else do ..
end while
For above example, while doing decomposition, I can say its
D2 (D1)
i.e while and then inside while, its if-then-else.
Considering same situation. How can you r... |
I am reading The Algorithm Design Manual, 2nd Edition.
The book gives an example task and then explains how to solve it step by step.
(The task and solution is detailed here)
But I don't follow one step from the solution. That step doesn't contain enough details for me so I don't understand it. I'm asking if someone c... |
let's consider a table with
carID | hireDate | manufactory | model | custID | custName | outletNo | outletLoc
I want to evaluate all the functional dependencies to bring in first, second and then third normal form.
Functional dependencies
carID,hireDate -> custID
Partial dependencies
carID->manufactory, model, outle... |
Say I want to compute a covnex hull of given points on the plane. I would like to write an algorithm, that only compares the points and doesn't do any arithmetic operations. Wikipedia states, that:
The standard $\Omega(n \log n)$ lower bound for sorting is proven in the decision tree model of computing, in which only ... |
I am wanting to create a map where the key contains multiple elements and the elements can be empty/null. The empty values are treated as "anything". I want to lookup function to match when the stored key is the lookup value or it is a generalised version - index key has empties where lookup value has values. I think t... |
I'm creating a sudoku solver, and I'm wondering at what point, with a simple backtracking sudoku solving algorithm, does the result take way too long to compute? I'm thinking like more than 30 minutes? I'll probably try to implement some heuristics, but I want to know at what point should I not expect a solution within... |
Suppose we have $n$ balls and $n$ bins. We put the balls into the bins randomly. If we count the maximum number of balls in any bin, the expected value of this is $\Theta(\ln n/\ln\ln n)$. How can we derive this fact? Are Chernoff bounds helpful?
|
I'm trying to construct a deterministic multi-tape turing machine for the following language in order to show that $L$ is in $DTIME(n)$:
$$L = \{ www \mid w \in \{a,b\}^+ \}$$
I'm not sure how to get started. Any hints would be appreciated.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.