instruction
stringlengths
0
29.8k
⌀
I'm reading Cormen's Introduction to Algorithms 3rd edition, and in examples of Master Method recursion solving Cormen gives two examples 1. $3T( \frac{n}{4} ) + n\log(n)$ 2. $2T( \frac{n}{2} ) + n\log(n)$ For the first example we have $a=3$ and $b=4$ so $n^{\log_4 (3)}=n^{0.793}$ and Cormen says that if we ch...
|algorithms|landau-notation|
Speaking in terms of automata and regular languages, how would it be possible for a string of 2 to equal a string of 3? $L = \{w \in \Sigma^ * \mid ww = www\}$ The only thing I can think of is $w = abab, ww = abababab, www = abababababab$, but I don't think this is correct.
Understanding the meaning of this regular language
|formal-languages|regular-languages|automata|
I don't know the right name for this problem, or if there is a name, but it is inspired by my initial interpretation of the title of [this][1] question (my question is very different, so the link may be misleading). Anyways, my question is this: We are initially given a list of "items" to be filled in a knapsack of ...
I don't know if this is the right place to ask this question, but still i'm trying I need a pool of photos(if possible with description) for my project. I mainly have to perform term extraction for semantic searching. Is there something available out there that is made available for such kinds of thing thanks
Pool of photos for term extraction
|ontologies|
I think you used that method wrong! As mention in [master theorem][1] case 3. In your case you should use case 3 which use **Big Omega** notation which describes **Asymptotic Lower Bound**. So the solution in the book is correct! you used **Big O notion** which is **Asymptotic Upper Bound!**. Be careful about whic...
I don't know if this is the right place to ask this question, but still i'm trying I need a pool of photos(if possible with description) for my project. I mainly have to perform term extraction for semantic searching. Is there something available out there that is made available for such kinds of thing. I'm going...
[{"Id":39,"DisplayName":"Gilles"}]
null
One best way is to use [Flikr][1]. For you project you could use [available Api][2] for downloading photos with related information. If you are using Java you could use these classes on [Google Codes][3]. [1]: http://www.flickr.com/ [2]: http://www.flickr.com/services/api/ [3]: http://code.google.com/p/...
It can be possible because of the empty string $ \epsilon$ which is a part of $\Sigma^*$
|algorithms|time-complexity|amortized-analysis|
null
[Wikipedia says](http://en.wikipedia.org/wiki/Standard_ML): fun factorial n = if n = 0 then 1 else n * factorial (n-1) > A Standard ML compiler is required to infer the static type int -> int of this function > without user-supplied type annotations. I.e., it has to deduce that n > is only used wit...
How can SML infer types like this?
|undecidability|compilers|type-theory|
If you want to learn about the theory behind simulated annealing, you should look for "Markov chain Monte Carlo". You might learn from this how the temperature (schedule) influences the convergence, how it can be monitored (or even controlled) and when you still can expect "progress" of a simulated annealing run. Is...
I think @DaveClark's answer covers pretty much the original question, but I would like to complement it slightly with a few ideas regarding the secondary questions. From an inheritance point of view, nothing prevents the class hierarchy to have several roots. As it has been pointed out by other peoples, C++, as well...
The type inference mechanism which is used in ML like languages is able to derive the types of values in ML statements by using algorithms which establish general types out of expression fragments: - identifiers are first associated with a type variable (or placeholder) - constants are annotated with the type they ...
The type inference mechanism which is used in ML like languages is able to derive the types of values in ML statements by using algorithms which establish general types out of expression fragments: - identifiers are first associated with type variables (or placeholders), - constants are annotated with the types the...
The type inference mechanism which is used in ML like languages is able to derive the types of values in ML statements by using algorithms which establish type templates for expression fragments, and "crosscheck" them in order to figure out their real types. Firstly: - identifiers are associated with type varia...
The type inference mechanism which is used in ML like languages is able to derive the types of values in ML statements by using algorithms which establish type templates for expression fragments, and "crosscheck" them in order to figure out their real types. Firstly: - identifiers are associated with type varia...
The type inference mechanism which is used in ML like languages is able to derive the types of values in ML statements by using algorithms which establish type templates for expression fragments, and "crosscheck" them in order to figure out their real types. Firstly: - constants are annotated with the types the...
Working with types is not as "hard" as working with values with respect to computability. You can know statically that a function will return a `bool` without knowing statically that it will return `true`, for example. Moreover, it's entirely possible and sometimes trivially easy to prove that a _specific given_ functi...
I copied this answer from [computational science][1] There is a theorem that syas that a black box algorithm is guaranteed to find the global minimum of an arbitrary smooth (i.e., twice continuously differentiable) function if and only if it samples points densely in the search space. Here dense is meant in th...
The type inference mechanism which is used in ML like languages is able to derive the types of values in ML statements by using algorithms which establish type templates for expression fragments, and "crosscheck" them in order to figure out their real types. Firstly: - constants are annotated with the types the...
null
I've been tasked with building a library of books on algorithms for our small company (about 15 people). The budget is more than 5k, but certainly less than 10k, so I can buy a fair number of books. All people here have at least a Bachelor's degree in CS or a closely related field, so while I will get some basic textbo...
Algorithm books on a range of topics
|algorithms|reference-request|data-structures|books|
I think @DaveClarke's answer covers pretty much the original question, but I would like to complement it slightly with a few ideas regarding the secondary questions. From an inheritance point of view, nothing prevents the class hierarchy to have several roots. As it has been pointed out by other peoples, C++, as wel...
I think it is important to realise what the type $\mathtt{int \rightarrow int}$ means and does not mean. It does _not_ mean that a program P having that type must return an integer, contrary to what the original poster said. Instead it means **if P terminates on a given input (of type int), P terminates by retur...
I have to generate a grammar for the following language L = { w in { a, b}* , |w| = even and w != wreverse} and say the type of the language. I've generated the grammar S-> aSa | bSb | aAb | bAa A-> abA | baA | aaA | bbA This grammar is a context free grammar.I now can say that L is a context free language....
Context free languages and regular languages
|formal-languages|
null
Here is a random collection of books on advanced algorithms * Approximation Algorithms by Vijay V. Vazirani * The Design of Approximation Algorithms by David P. Williamson, David B. Shmoys * Computational geometry: an introduction through randomized algorithms by Ketan Mulmuley * Randomized Algorithms by Rajeev M...
Regular languages are closed under complement and intersection. The complement of $L$, intersected with the regular $\{w : |w| \equiv 0 \pmod{2}\}$ is the language of even palindromes. If you must, you can easily show that it is not regular using pumping lemma.
Is there an algorithm for the following problem: > Given a Turing machine $M_1$ that decides a language $L$, > Is there a Turing machine $M_2$ deciding $L$ such that > $t_2(n) = o(t_1(n))$? The functions $t_1$ and $t_2$ are the worst-case running times of Turing machines $M_1$ and $M_2$ respectively. What ...
I have to generate a grammar for the following language L = { w in { a, b}* , |w| = even and w != wreverse} and say the type of the language. I've generated the grammar S-> aSa | bSb | aAb | bAa A-> abA | baA | aaA | bbA | e This grammar is a context free grammar.I now can say that L is a context free langu...
|finite-automata|efficiency|nondeterminism|
|proof-techniques|asymptotics|recurrence-relation|master-theorem|
|algorithm-analysis|asymptotics|recurrence-relation|master-theorem|
|algorithm-analysis|asymptotics|recurrence-relation|mathematical-analysis|master-theorem|
|proof-techniques|asymptotics|recurrence-relation|master-theorem|
|asymptotics|recurrence-relation|master-theorem|
How to the examples for using the master theorem in Cormen work?
I think you used that method wrong! As mentioned in [master theorem][1] case 3. In your case you should use case 3 which uses $\Omega$-notation which describes asymptotic *lower* bound. So the solution in the book is correct! You used $O$-notations which is and asymptotic *upper* bound! Be careful about which cases...
First of all, please check what [$O$ and $\Omega$ and the other Landau symbols mean](http://cs.stackexchange.com/questions/57/how-does-one-know-which-notation-of-time-complexity-analysis-to-use/61#61); that should remove some of the confusion. Note that $n \log n \in \omega(n)$, that is $n \log n$ grows *properly fa...
I need a pool of photos (if possible with description) for my project. I mainly have to perform term extraction for semantic searching. Is there something available out there that is made available for such kinds of thing? I'm going to mine the description of these photos, maybe build ontologies and then perform sea...
|machine-learning|data-mining|data-sets|ontologies|
One good way is to use [Flickr][1]. For your project you could use [available API][2] for downloading photos with related information. If you are using Java you could use the classes on [Google Codes][3]. [1]: http://www.flickr.com/ [2]: http://www.flickr.com/services/api/ [3]: http://code.google.com/p/...
Speaking in terms of automata and regular languages, how would it be possible for a string repeating some $w$ twice equal a string repeating that same $w$ thrice? That is, why is the language $\qquad L = \{w \in \Sigma^ * \mid ww = www\}$ not empty? The only thing I can think of is $w = abab, ww = abababab, www =...
How can $ww = www$ hold for any word $w$?
Working with types is not as "hard" as working with values with respect to computability. You can know statically that a function will return a `bool` without knowing statically that it will return `true`, for example. Moreover, it's entirely possible and sometimes trivially easy to prove that a _specific given_ functi...
|compilers|functional-programming|type-theory|type-inference|
I have to generate a grammar for the language $L = \{ w \in \{ a, b\}^* \mid |w| \in 2\mathbb{N}, w \neq w^R\}$ and give the type of the language. I've generated the grammar $\qquad \begin{align} S &\to aSa \mid bSb \mid aAb \mid bAa \\ A &\to abA \mid baA \mid aaA \mid bbA \mid \varepsilon \end{align}$ ...
Give a grammar to show whether a language is regular or context-free
|formal-languages|formal-grammars|context-free|
Language categories are sets, and the context-free language set contains the regular language set. In other words, every regular language is context-free. It's useful to know that context-free contains LR, which contains LL, which contains regular. Your language is regular because its definition conforms to the regu...
Your grammar is almost correct except for the fact that you cannot derive any word. Thus, it produces the empty language. However, as I said, the idea to produce a "difference" and then switch to another nonterminal is correct. To prove that a language (no matter which one) is **not** regular, you can use the [pumpi...
null
[{"Id":98,"DisplayName":"Raphael"}]
[{"Id":98,"DisplayName":"Raphael"}]
[{"Id":98,"DisplayName":"Raphael"}]
I think the accepted answer covers pretty much the original question, but I would like to complement it slightly by throwing in (quite informally) a few ideas regarding the secondary questions. From an inheritance point of view, nothing prevents the class hierarchy to have several roots. As it has been pointed out b...
The type inference mechanism which is used in ML like languages is able to derive the types of values in ML statements by using algorithms which establish type templates for expression fragments, and "crosscheck" them in order to figure out their real types. Firstly: - constants are annotated with the types the...
I've been tasked with building a library of books on algorithms for our small company (about 15 people). The budget is more than 5k, but certainly less than 10k, so I can buy a fair number of books. All people here have at least a Bachelor's degree in CS or a closely related field, so while I will get some basic textbo...
Studying LRU approximation Algorithms I think to have not understand how it works, for example: consider a process with 3 logical pages and 2 frames allocated , an approximation of the Algorithm Last Recently Used based of reference bits where every four references there is a shift and where are co...
clarification about Algorithm of page replacement LRU with reference bits
|operating-systems|paging|virtual-memory|
Here is a random collection of books on advanced algorithms based on what I consider as great book about advanced algorithms. Of course this is only my personal opinion and there are many other good books. * Approximation Algorithms by Vijay V. Vazirani * The Design of Approximation Algorithms by David P. Will...
null
I think you used that method wrong! As mentioned in [master theorem][1] case 3. In your case you should use case 3 which uses $\Omega$-notation which describes asymptotic *lower* bound. So the solution in the book is correct! You used $O$-notations which is and asymptotic *upper* bound! Be careful about which cases...
I've been tasked with building a library of books on algorithms for our small company (about 15 people). The budget is more than 5k, but certainly less than 10k, so I can buy a fair number of books. All people here have at least a Bachelor's degree in CS or a closely related field, so while I will get some basic textbo...
I feel the main difference between recursive and recursively enumerable languages is that Recursive Turing machine halts in non-final state if it does not accepts a string Recursively enumerable Turing machine if it not accepts a string may halt in non final state or loop for ever which is not the case for recursi...
|complexity-theory|terminology|decision-problem|
I always read that finding an independent set of size $k$ in a graph is $\mathsf{NP}$-complete. However, this only requires looking for all combinations of $k$ vertices and this is a polynomial procedure of order $k$. I know that we can reduce directly SAT to independent set, with $k$ the number of clauses. The p...
What is the decision version of independent set?
A *Language* is just a set of strings. Possibly of infinite cardinality. A language is *recursive enumerable* if there exists a TM that keeps outputting strings that belong to the language (and only such strings), such that eventually every string in the language will be in the output. A language is *recursive* i...
I am interested in precise time complexity of distributed algorithm for finding MIS (Maximum Independent Set) of a given graph $G$. I investigate the Slow MIS distributed algorithm (from [these lecture notes](http://disco.ethz.ch/lectures/podc_allstars/lecture/chapter7.pdf), page 2): Every node v executes the...
I've been tasked with building a library of books on algorithms for our small company (about 15 people). The budget is more than 5k, but certainly less than 10k, so I can buy a fair number of books. All people here have at least a Bachelor's degree in CS or a closely related field, so while I will get some basic textbo...
Given a graph with $n \leq 50 $ vertices. Count all $k$-cliques of this graph, where $k = 1, \ldots , n$. I need the most efficient algorithm.
Finding all cliques of a graph
|algorithms|graphs|
You don't specify what your company specializes in, so it's not easy to provide more than general recommendations. On the whole, I think the list you've put together is pretty good, and I wouldn't remove anything from it. Just a couple of additions and comments: 1) Cormen is a standard text. Sedgewick is another sta...
Supposing that you show $\times~(mult)$ is primitive recursive function (you can use addition for that) then: $exp(x,y)={ x }^{ y }$ 1) $exp(x,0)=x^0=1$ 2) $exp(x,y+1)=x^{y+1}=(x^y)\times x=mult(exp(x,y),x)$ for $mult$ you could show that: $mult(x,y)=x\times y$ 1)$mult(x,0)=x \times 0=0$ 2)$\oper...
I am interested in precise time complexity of distributed algorithm for finding MIS (Maximum Independent Set) of a given graph $G$. I investigate the Slow MIS distributed algorithm (from [these lecture notes](http://disco.ethz.ch/lectures/podc_allstars/lecture/chapter7.pdf), page 2). Following is the more detaile...
null
I have not (nearly) read enough books to name $5000 worth of them. Therefore, I will suggest some groups of literature you should cover as well as point you towards selected representatives. I can not claim to have read most of the books myself, so I have to rely mostly on descriptions and reputation. I assume that ...
I have not (nearly) read enough books to name $5000 worth of them. Therefore, I will suggest some groups of literature you should cover as well as point you towards selected representatives. I can not claim to have read most of the books in full myself, so I have to rely mostly on descriptions, cursory impression and r...
$R_{min}$ is the "***Writing Rate in Application Buffer***" (from router in your example). This formula makes sense for different conditions like **$R_{app}=R_{min}$**. In this case the buffer size should be infinite (very large buffer) and it is intuitively correct. **$R_{app} >R_{min}$** makes the size negative w...
I read a [post][1] which talks about pretty much the same problem. But here I simplify the problem hoping that a concrete proof can be offered. There is a set `A` which contains some discrete points (1-dimension), like `{1, 3, 37, 59}`. And I want to pick one point from `A` which can minimize the sum of distances be...