instruction
stringlengths
0
29.8k
⌀
|algorithms|algorithm-analysis|space-complexity|lower-bounds|
In Sipser's textbook "Introduction to the Theory of Computation, Second Edition," he defines nondeterministic time complexity as follows: > Let $N$ be a nondeterministic Turing machine that is a decider. The **running time** of $N$ is the function $f : \mathbb{N} \rightarrow \mathbb{N}$, where $f(n)$ is the maximum...
|complexity-theory|time-complexity|terminology|nondeterminism|
The machine in this definition is a *decider*, that means it does halt on all inputs and accepts if and only if the input is in its language. That means that the maximum lengths of all computation makes sense, and should be the measure investigated. You are probably thinking of *acceptors*. Those are Turing machines...
|complexity-theory|time-complexity|terminology|turing-machines|nondeterminism|
Take the language to be $L=\Sigma^*$. $L$ can be solved trivially, so there is a polytime NTM that doesn't use any nondeterminism and solves $L$, call it $M$. The counting function for $M$ is $\#M(x)=1$ which is trivial. Take $N$ be the following polytime NTM: $N :=$ on input $x$, 1. nondeterministicly guess $...
I don't know if you can do selection with $O(n)$ time and $O(1)$ extra memory cells. But you can come pretty close to this. Munro and Raman proposed an [algorithm for selection][1] that runs in $O(n^{1+\varepsilon})$ time while using only $O(1/\varepsilon)$ extra storage (cells). This algorithm leaves the input unch...
null
null
I haven't done the analysis to confirm how uniform (or not) this would be, and it could be adjusted to be a true shuffle, but could you just choose, from a starting array of the `i`th index = `i + 1`, the `(k + RandNum50() + RandNum50() - 1) mod (100 - k)` index, with removal, for `k` = 0..99? This "pushes" the peak...
Let me first rephrase your problem as I understand it. You have a tree of random events. Every event consists of choosing one of a set of child events; every child has the same probability but may have different child events of their own. The children are grouped by some classifier. You want to have efficient access to...
I only know very little about this topic. But from the algorithmic point of view there is a [very nice review article][1] from Susanne Albers, which is probably a good starting point. [1]: http://cacm.acm.org/magazines/2010/5/87271-energy-efficient-algorithms/fulltext
I haven't done the analysis to confirm how uniform (or not) this would be, and it could be adjusted to be a true shuffle, but could you just choose, from a starting array of the `i`th index = `i + 1`, the `(k + RandNum50() + RandNum50() - 1) mod (100 - k)` index, with removal, for `k` = 0..99? This "pushes" the peak...
The previous solutions are not optimal. The complexity is exactly $n\log n + O(1)$ in calls to RandNum50 and is described in some detail [here][1], using as a source of random bit (as suggested by Vor): if ( rand50() > 25 ) then b = 1 else b = 0 // random bit The basic idea is that you save a lot of bits if...
Since other folks have given approximate solutions and solutions involving taking indeterminate numbers of deviates, how about a proof that there is no such algorithm that's guaranteed to only require a finite number of `RandNum50()` calls? As others have noted, printing the numbers from 1-100 in random order is equ...
[KS][1] explains the mathematical concept behind KS entropy. $h ( T ) =\sup\limits_{\xi} \, h ( T , \xi )$ defines the formula for KS where the L.H.S is nothing but the Shannon's entropy. In many papers I have seen that KS is defined as the sup over source entropy. These conflicting views raises the followin...
Source entropy and other questions related to information theory
|reference-request|information-theory|
I want to encode strings as real numbers while preserving order. The order of the strings is the lexicographic order (as used in phone books); the order of the numbers is the standard order. Is there an general (i.e. no additional conditions such as e.g. known max string size) encoding with this property?
Order preserving encoding of strings to numbers
|order-theory|
(I assume that by lexicographic order, you mean lexicographic order. Phone books may have all kinds of oddities due to ordering proper names, such as sorting `McDonald` near `MacDonald`.) Suppose your strings only contained the characters `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8` and `9`. The mapping from the string $s...
I would take a look at the free book by Bondy and Murty: [Graph Theory with Applications][1] [1]: http://book.huihoo.com/pdf/graph-theory-With-applications/
(I assume that by lexicographic order, you mean lexicographic order. Phone books may have all kinds of oddities due to ordering proper names, such as sorting `McDonald` near `MacDonald`.) Suppose your strings only contained the characters `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8` and `9`. The mapping from the string $s...
null
$\newcommand\ldotd{\mathinner{..}}$Given that $A[1\ldotd n]$ are integers such that $0\le A[k]\le m$ for all $1\le k\le n$, and the occurrence of each number except a particular number in $A[1\ldotd n]$ is an odd number. Try to find the number whose occurrence is an even number. There is an $\Theta(n\log n)$ algorit...
[KS][1] explains the mathematical concept behind KS entropy. $$h ( T ) =\sup\limits_{\xi} \, h ( T , \xi )$$ defines the formula for KS where the left-hand side is nothing but the Shannon's entropy. In many papers I have seen that KS is defined as the sup over source entropy. These conflicting views raises the f...
null
There is a time series of 100 data points(say). I wish to assign symbols of 0 1 2 for each unique data point. The issue is I have tried but got stuck since no matter I specify the symbols,the program just outpits probability of 1's and 0's. The following are the Qs 1. How to find probability / correct my code so th...
[Kolmogorov-Sinai entropy][1] (KS) explains the mathematical concept behind KS entropy. $$h ( T ) =\sup\limits_{\xi} \, h ( T , \xi )$$ defines the formula for KS where the left-hand side is nothing but the Shannon's entropy. In many papers I have seen that KS is defined as the supremum over source entropy. Thes...
null
Right now I am trying to understand Clustering-methods. What I understood by now: 1. In supervised learning the categories, data is assigend to are known before computation. So they are being used in order to 'learn' the parameters that are really significant for those Clusters. 2. In unsupervised learning ...
What exatclty is the difference between supervised and unsupervised learning?
|machine-learning|
What exactly is the difference between supervised and unsupervised learning?
Right now I am trying to understand Clustering-methods. What I understood by now: 1. In supervised learning the categories, data is assigned to are known before computation. So they are being used in order to 'learn' the parameters that are really significant for those Clusters. 2. In unsupervised learning ...
The difference is that in supervised learning the 'categories' are known. In unsupervised learning, they are not, and the learning process attempts to find appropriate 'categories'. In both kinds of learning all parameters are considered to determine which are most appropriate to perform the classification. Whether ...
null
The difference is that in supervised learning the 'categories' are known. In unsupervised learning, they are not, and the learning process attempts to find appropriate 'categories'. In both kinds of learning all parameters are considered to determine which are most appropriate to perform the classification. Whether ...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original golden ratio base helped me to think about a binary encoding more effectively. I want to note however th...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original golden ratio base helped me to think about a binary encoding more effectively. I want to note however th...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
null
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
I'm going to try to answer this myself, in the hope that my answer will give others a better idea of what I'm after and lead to better answers than mine. I found that framing the problem in terms of the original [golden ratio base](http://en.wikipedia.org/wiki/Golden_ratio_base) helped me to think about a binary enc...
Have a look at (the non free) Algorithmic Graph Theory by Alan Gibbons. It's an oldie but quite widely used in CS, it has a computational approach but does also cover the theory. At around 250 pages it's not too intimidating and is well respected.
null
For digraphs in particular, there's Band-Jensen & Gutin's ["Digraphs: Theory, Algorithms and Applications"][1]. It covers quite a bit of material. The first edition is free to download now that the second edition is out (There's a link to the pdf on their page). Of course if you've got access to a Springerlink accou...
null
The answer is given in the technical perspective piece for the article in question [1]. The problem under consideration is the area of tension between general and specific code: > Programs can be written to be either general-purpose or special-purpose. General-purpose code has the advantage of being usable in a vari...
null
The idea of "stack" and "heap" is incoherent in my view. It is best not to think in those terms. The real difference is between - locations that are named by (variable) symbols in the program (call them **named locations**) and - locations (or groups of locations) whose references are stored in ...
To the best of my knowledge, the term *staged computation* was first used by Bill Scherlis in [this paper](http://dl.acm.org/citation.cfm?id=512652). Prior to that, the term "[partial evaluation](http://en.wikipedia.org/wiki/Partial_evaluation)" was used for much the same concept, but the idea of staged computation is...
I've been looking for a way to represent the [golden ratio ($\phi$) base](http://en.wikipedia.org/wiki/Golden_ratio_base) more efficiently in binary. The standard binary golden ratio notation works but is horribly space inefficient. The Balanced Ternary Tau System (BTTS) is the best I've found but is quite obscure. ...
I've been looking for a way to represent the [golden ratio ($\phi$) base](http://en.wikipedia.org/wiki/Golden_ratio_base) more efficiently in binary. The standard binary golden ratio notation works but is horribly space inefficient. The Balanced Ternary Tau System (BTTS) is the best I've found but is quite obscure. ...
Although the other answers are technically correct, I don't think they give a correct understanding of why computer scientists are interested in staged functions. By creating staged functions, you define programs that generate programs. One of the big goals of modern practical language theory is to maximise potenti...
There is the book "Managing and Mining Graph Data" from Charu C. Aggarwal. It contains (among others): - Graph Mining: Laws and Generators - Graph Data Management and Mining - Graph Indexing - Graph Reachability Queries - Graph Matching - Graph Classification As the title suggests it concentrates on...
It is an open problem if you can do selection with $O(n)$ time and $O(1)$ extra memory cells without changing the input (see [here](http://www.kurims.kyoto-u.ac.jp/~kyodo/kokyuroku/contents/pdf/1641-05.pdf)). But you can come pretty close to this. Munro and Raman proposed an [algorithm for selection][1] that runs in...
[Kolmogorov-Sinai entropy][1] (KS) explains the mathematical concept behind KS entropy. $$h ( T ) =\sup\limits_{\xi} \, h ( T , \xi )$$ defines the formula for KS where the left-hand side is nothing but the Shannon's entropy. In many papers I have seen that KS is defined as the supremum over source entropy. Thes...
It is an open problem if you can do selection with $O(n)$ time and $O(1)$ extra memory cells without changing the input (see [here](http://www.kurims.kyoto-u.ac.jp/~kyodo/kokyuroku/contents/pdf/1641-05.pdf)). But you can come pretty close to this. Munro and Raman proposed an [algorithm for selection][1] that runs in...
Although the other answers are technically correct, I don't think they give a correct understanding of why computer scientists are interested in staged functions. By creating staged functions, you define programs that generate programs. One of the big goals of modern practical language theory is to maximise potenti...
At work I’ve been tasked with inferring some type information about a dynamic language. I rewrite sequences of statements into nested `let` expressions, like so: return x; Z => x var x; Z => let x = undefined in Z x = y; Z => let x = y in Z if x then T els...
Inferring refinement types
|type-theory|type-inference|
null
For digraphs in particular, there's Band-Jensen & Gutin's ["Digraphs: Theory, Algorithms and Applications"][1]. It covers quite a bit of material. The first edition is free to download now that the second edition is out (There's a link to the pdf on their page). Of course if you've got access to a Springerlink accou...
I would take a look at the free book by Bondy and Murty: [Graph Theory with Applications][1]. The book is a less-algorithmic and more graph-theoretical than other resources recommended here. There is also [a never version of the book][2], which is not available for free on the net, but is extremely well-written and wit...
Doing so is very difficult, if not imposible, without giving up confluence. Which is to say, I suspect you are right about a hairy meta-theory. On the other hand, it is possible to design a combinator calculus that can express all turing computable functions, and that has full ability to inspect its terms: see [Jay a...
null
Note that there are more than 2 degrees of supervision. For example, see: http://wortschatz.uni-leipzig.de/~cbiemann/pub/2007/Biemann07diss_Structure-Discovery-final.pdf pages 24-25 (6-7) Which identifies 4 degrees: supervised, semi-supervised, weakly-supervised, and unsupervised, and explains the differences...
There is a time series of say $100$ data points. I wish to assign symbols of $0, 1, 2$ for each unique data point. The issue is I have tried but got stuck since no matter I specify the symbols, the program just outputs probability of $1$'s and $0$'s. The following are the questions: 1. How to find probability or co...
Note that there are more than 2 degrees of supervision. For example, see the pages 24-25 (6-7) in the PhD thesis of [Christian Biemann, Unsupervised and Knowledge-free Natural Language Processing in the Structure Discovery Paradigm, 2007.](http://wortschatz.uni-leipzig.de/~cbiemann/pub/2007/Biemann07diss_Structure-Disc...
Several favorite references which would be accessable to a highly motivated or advanced teenager. [1] <a href="http://www.amazon.com/The-New-Turing-Omnibus-Excursions/dp/0805071660">New Turing Omnibus</a> by AK Dewdney. Has a grab bag of some of the more interesting key concepts of CS. A very visual approach. AK Dew...
null
I believe this is a question at the frontier of knowledge, i.e. basically a research question. From a quick google search, it appears to be mostly open. Also, for many years I have believed it to be important and linked to complexity theory lower bounds. You don't mention directly a statistical analysis but that is wha...
###Worst-case complexity **Insert**: $\mathcal{O}(1)$ **Find-min**: $\mathcal{O}(1)$ **Decrease-key**: $\mathcal{O}(1)$ **Delete**: $\mathcal{O}(\log \log n)$ **Space**: $\mathcal{O}(n)$ ###Proof > THEOREM 1. *We can implement a priority queue that with n integer keys in the range $[0 , N )$ in linear ...
I have a very specific question about SEMANTIC clustering. I have a list of words/phrases. I want to run an intelligent SEMANTIC clustering algorithm on this list. Please let me know what the available options are. Definitely I am looking for NLP based algorithms. Simple, open-source, easy-to-use solutions will b...
SEMANTIC clustering
|algorithms|
I am teaching myself program verification and am currently learning [proof assistants][1]. I have the book [Handbook of Practical Logic and Automated Reasoning][2] which gives the proofs necessary for the understanding of such a system, but more importantly for me it also gives an implementation of the necessary algori...
Model Checking : Looking for book that derives and constructs a model checking application
|formal-methods|proof-assistants|model-checking|
|reference-request|formal-methods|proof-assistants|model-checking|
I have a very specific question about semantic clustering. I have a list of words/phrases. I want to run an intelligent semantic clustering algorithm on this list. Please let me know what the available options are. Definitely I am looking for NLP based algorithms. Simple, open-source, easy-to-use solutions will b...
Semantic clustering
|algorithms|strings|string-metrics|natural-language-processing|ontologies|
The central concept here is [Kolmogorov complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity), and more specifically [compressibility](http://en.wikipedia.org/wiki/Incompressible_string). To get a intuitive feeling of compressibility, consider two strings $A \in \mathbb{B}^*$ and $B \in \mathbb{B}^*$, where $...
Looking for a book that derives and constructs a model checking application
There are a lot of different approaches that you could take. While the commenters are right, coming up with a distance metric is important, based on my own experience, finding good representations of your words/phrases is going to be significantly more important. Most of the "semantic" clustering algorithms that imm...