instruction stringlengths 0 29.8k ⌀ |
|---|
My preference is for Coq, but I imagine that others prefer Isabelle. One of the strange things I found about Isabelle is that there is a two-level syntax, where some of your definitions need to be inside double quote. No such nonsense is present in Coq.
Ultimately, the one that is most suitable for you may depend on... |
Further to the other answers, one can describe and classify languages in terms of "generators" and closure properties. For example, it makes sense to talk about the smallest <a href="http://en.wikipedia.org/wiki/Abstract_family_of_languages">AFL</a> generated by some language. A good place to start learning about this ... |
|complexity-theory|graphs|np-hard| |
Given the following complexities list :
n^(log log(n) ) ;2^n ;3^n ;n! ; n^3 ;1/n ;(n+1)! ; 4^log(n) ;n^2
n^log(n) ;log(n!) ;nln(n) ; log(2^n )=nlog2 ;(log(2) )^n ;5n^2+6 ; n^log(n!)
I need to sort them by classes .
I sorted part of them by the following order , but I'm still... |
Sorting time complexities |
|time-complexity| |
Tip: draw graphs of these functions using something like [Wolfram Alpha][1].
E.g., try: http://www.wolframalpha.com/input/?i=plot+log+log+n or http://www.wolframalpha.com/input/?i=plot+log%28log%28n%29%29+and+plot+log%28n%29
[1]: http://www.wolframalpha.com/ |
null |
Another tip: sometimes applying a monotone function (like log or exp) to the functions makes things clearer. |
Tip: draw graphs of these functions using something like [Wolfram Alpha][1].
E.g., try: [$\log\log n$](http://www.wolframalpha.com/input/?i=plot+log+log+n) or [$\log n$ vs $\log\log n$](http://www.wolframalpha.com/input/?i=plot+log%28log%28n%29%29+and+plot+log%28n%29).
[1]: http://www.wolframalpha.com/ |
If $c = \lim_{n\to\infty} \frac{f(n)}{g(n)}$ exists, then
* $c=0 \qquad \quad \Longrightarrow f \in o(g)$
* $c \in (0,\infty) \quad \Longrightarrow f \in \Theta(g)$
* $c=\infty \qquad \ \ \Longrightarrow f \in \omega(g)$
With this implications you should be able to order all of your functions.
In addition... |
Given the following complexities list :
$n^{\log \log(n)} \quad 2^n \quad 3^n \quad n! \quad n^3 \quad \frac{1}{n} \quad(n+1)! \quad 4^{\log(n)} \quad n^2$
$n^{\log (n)} \quad \log(n!) \quad n\ln(n) \quad \log(2^n)=n \log 2 \quad \log(2)^n \quad 5n^2+6 \quad n^{\log(n!)}$
I need to sort them by classes .
... |
null |
|time-complexity|asymptotics| |
Tip: draw graphs of these functions using something like [Wolfram Alpha][1].
E.g., try: [plot log(log(n))](http://www.wolframalpha.com/input/?i=plot+log+log+n) or [plot log(log(n)) and plot log(n) from 1 to 100](http://www.wolframalpha.com/input/?i=plot+log%28log%28n%29%29+and+plot+log%28n%29+from+1+to+100).
[1... |
There are plenty of possibilities. Others have already mentioned automata which offer a rich selection. Consider the following frameworks, too:
1. Some languages can be defined directly by *(co)[inductive definitions](https://en.wikipedia.org/wiki/Inductive_definition)*. For instance, the smallest fixpoint of
$\... |
Tip: draw graphs of these functions using something like [Wolfram Alpha][1].
E.g., try: [plot log(log(n)) from 1 to 100](http://www.wolframalpha.com/input/?i=plot+log%28log%28n%29%29+from+1+to+100+) to see an individual graph or [plot log(log(n)) and plot log(n) from 1 to 100](http://www.wolframalpha.com/input/?i=pl... |
I'm trying to prove that a [binary heap][1] with $n$ nodes has exactly $\left\lceil \frac{n}{2} \right\rceil$ leaves, given that the heap is built in the following way:
Each new node is inserted via [percolate up][2]. This means that each new node must be created at the next available child. What I mean by this is t... |
Proving a binary heap has $\lceil n/2 \rceil$ leaves |
There are plenty of possibilities. Others have already mentioned automata which offer a rich selection. Consider the following frameworks, too:
1. Some languages can be defined directly by *(co)[inductive definitions](https://en.wikipedia.org/wiki/Inductive_definition)*. For instance, the smallest fixpoint of
$\... |
I suggest proceeding according to the definitions of various notations. Start with some arbitrary pair of expressions, and determine the order of those, as outlined below. Then, for each additional element, find its position in the sorted list using binary search and comparing as below. So, for example, let's sort $n^{... |
Believe it or not, here's a guy who built logic gates using streams of water...
http://www.blikstein.com/paulo/projects/project_water.html
Apparently, he worked up to a 4-bit adder, though I believe this picture shows only a single half-adder...
) from 1 to 10000](http://www.wolframalpha.com/input/?i=plot+log%28log%28n%29%29+from+1+to+10000+) to see an individual graph or [plot log(log(n)) and plot log(n) from 1 to 10000](http://www.wolframalpha.com/input... |
[What is Automated Theorem Proving?](http://www.cs.miami.edu/~tptp/OverviewOfATP.html)
[The TPTP Problem Library for Automated Theorem Proving](http://www.cs.miami.edu/~tptp/)
|
null |
[Isabelle](http://www.cl.cam.ac.uk/research/hvg/isabelle/) is a generic proof assistant.
**Resources**
- [Isabelle website](http://www.cl.cam.ac.uk/research/hvg/isabelle/)
- [Tutorial on Isabelle/HOL](http://isabelle.in.tum.de/dist/Isabelle2011-1/doc/tutorial.pdf)
- [FAQ](https://isabelle.in.tum.de/communit... |
null |
_Another partial answer._
The approach to semantics taken by the various communities differed, at least originally.
* ACP semantics are axiomatic/algebraic.
* CSP semantics are denotational, generally in terms of traces.
* CCS/$\pi$-calculus semantics are operational, generally in terms of labelled transition ... |
I [read][1] that the number of coin tosses of a probabilistic Turing machine is not a [Blum complexity measure][2]. Why?
[1]: http://blog.computationalcomplexity.org/2004/04/blum-complexity-measures.html
[2]: http://en.wikipedia.org/wiki/Blum_axioms |
Why number of coin tosses of a probabilistic Turing machine is not a Blum complexity measure? |
|computability|complexity-theory|randomness|probabilistic-algorithms| |
Isabelle is a generic proof assistant, which can be used for many different logics. |
null |
Machine-checked, machine-generated or machine-verified proofs |
null |
Automated deduction, also called [automated theorem proving](http://en.wikipedia.org/wiki/Automated_theorem_proving), is the generation of proofs of mathematical statements by computer programs. Some proofs can be built automatically by computer programs, while others require human assistance but are verified by softwa... |
null |
According to the definition on Wikipedia, $T = \{(i,x,t) \mid \varphi_i \text{ tosses } t \text{ coins on } x\}$ has to be recursive if the measure you propose is to be a Blum complexity measure. As the number of coin tosses needed for $\varphi_i(x)$ may very well be random as well, how can the set be decidable?
Pro... |
Probabilistic "functions" are not even functions in the classical sense of the term "function", that is, they do not assign to each member of the domain a specific member of the range. They are not even partial functions. So the requirement of the Blum axioms that the complexity functions be computable cannot be satis... |
null |
Probabilistic "functions" are not even functions in the classical sense of the term "function", that is, they do not assign to each member of the domain a specific member of the range. They are not even partial functions. So the requirement of the Blum axioms that the complexity functions be computable cannot be satis... |
I [read][1] that the number of coin tosses of a probabilistic Turing machine (PTM) is not a [Blum complexity measure][2]. Why?
Clarification:
Note that since the execution of the machine is not deterministic, one should be careful about defining the number of coin tosses for a PTM $M$ on input $x$ in a way simila... |
I [read][1] that the number of coin tosses of a probabilistic Turing machine (PTM) is not a [Blum complexity measure][2]. Why?
Clarification:
Note that since the execution of the machine is not deterministic, one should be careful about defining the number of coin tosses for a PTM $M$ on input $x$ in a way simila... |
null |
I'm trying to prove that a [binary tree][1] with $n$ nodes has exactly $\left\lceil \frac{n}{2} \right\rceil$ leaves. How would I go about doing this with induction?
Edit: for people who were following the last question, it has been moved [here][3].
[1]: http://en.wikipedia.org/wiki/Binary_tree
[3]: http://c... |
Proving a binary tree has at most $\lceil n/2 \rceil$ leaves |
I'm trying to prove that a [binary heap][1] with $n$ nodes has exactly $\left\lceil \frac{n}{2} \right\rceil$ leaves, given that the heap is built in the following way:
Each new node is inserted via [percolate up][2]. This means that each new node must be created at the next available child. What I mean by this is t... |
Proving a binary heap has $\lceil n/2 \rceil$ leaves |
|data-structures|binary-trees| |
Can you build compilers for dynamic languages like Ruby to have similar and comparable performance to C/C++? From what I understand about compilers, take Ruby for instance, compiling Ruby code can't ever be efficient because the way Ruby handles reflection, features such as automatic type conversion from integer to big... |
Can a dynamic language like Ruby/Python reach C/C++ like performance? |
|programming-languages|compilers| |
Can you build compilers for dynamic languages like Ruby to have similar and comparable performance to C/C++? From what I understand about compilers, take Ruby for instance, compiling Ruby code can't ever be efficient because the way Ruby handles reflection, features such as automatic type conversion from integer to big... |
If I get your question correctly, the obtained heap is just an ordered binary-tree, where in ordered I mean that the $k$th level is can be occupied only after the $k-1$ level was occupied, and each level is occupied from left to right, without skipping.
Then the proof goes like this.
1. A full Tree of depth $k$ ... |
> if you can do X in C/C++ with performance Y, can you do X in Ruby/Python with performance close to Y?
Yes. Take, as an example, PyPy. It is a collection of Python code that performs close to C in doing interpretation (not all that close, but not all that far away either). It does this by performing full-program an... |
null |
In general, the field of formal languages studies mathematical and logical properties of and relationships between languages (or sets) of strings (or sequences of symbols) over alphabets (or sets of symbols). Commonly encountered varieties of formal languages are regular languages, context-free languages, context-sensi... |
null |
The basic difference between the C++ statement `x = a + b` and the Python statement `x = a + b` is that a C/C++ compiler can tell from this statement (and a little extra information that it has readily available about the types of `x`, `a`, and `b`) precisely what machine code needs to be executed. Whereas to tell what... |
I'm trying to prove that a [binary tree][1] with $n$ nodes has at most $\left\lceil \frac{n}{2} \right\rceil$ leaves. How would I go about doing this with induction?
*For people who were following in the original question about heaps, it has been moved [here][3].*
[1]: http://en.wikipedia.org/wiki/Binary_tree
... |
If you want rigorous proof, the following lemma is often useful resp. more handy than the definitions.
> If $c = \lim_{n\to\infty} \frac{f(n)}{g(n)}$ exists, then
> * $c=0 \qquad \quad \Longrightarrow f \in o(g)$
> * $c \in (0,\infty) \quad \Longrightarrow f \in \Theta(g)$
> * $c=\infty \qquad \ \ \Longrightarr... |
I [read][1] that the number of coin tosses of a probabilistic Turing machine (PTM) is not a [Blum complexity measure][2]. Why?
Clarification:
Note that since the execution of the machine is not deterministic, one should be careful about defining the number of coin tosses for a PTM $M$ on input $x$ in a way simila... |
I'm trying to prove that a [binary heap][1] with $n$ nodes has exactly $\left\lceil \frac{n}{2} \right\rceil$ leaves, given that the heap is built in the following way:
Each new node is inserted via [percolate up][2]. This means that each new node must be created at the next available child. What I mean by this is t... |
|data-structures|binary-trees|proof-techniques| |
If I get your question correctly, the obtained heap is just an ordered binary-tree, where in ordered I mean that the $k$th level can only be occupied after the $k-1$ level has been completely filled, and each level is occupied from left to right, without skipping.
Then the proof goes like this.
1. A perfect tree... |
null |
Just a quick pointer that outlines the worst case scenario for dynamic languages:
$\qquad$[Perl parsing is not computable](http://www.jeffreykegler.com/Home/perl-and-undecidability)
As a consequence, (full) Perl can *never* be compiled statically. |
Just a quick pointer that outlines the worst case scenario for dynamic languages:
$\qquad$[Perl parsing is not computable](http://www.jeffreykegler.com/Home/perl-and-undecidability)
As a consequence, (full) Perl can *never* be compiled statically.
---
In general, as always, it depends. I am confident that if ... |
I [read][1] that the number of coin tosses of a probabilistic Turing machine (PTM) is not a [Blum complexity measure][2]. Why?
Clarification:
Note that since the execution of the machine is not deterministic, one should be careful about defining the number of coin tosses for a PTM $M$ on input $x$ in a way simila... |
I assume now that the question is the following:
> Given a binary tree with $n$ nodes, prove that it contains at most $\left\lceil \frac{n}{2} \right\rceil$ leaves.
Let us work with the tree definition $\mathrm{Tree}= \mathrm{Empty}\mid \mathrm{Leaf} \mid \mathrm{Node}(\mathrm{Tree},\mathrm{Tree})$. For $T$ such... |
> if you can do X in C/C++ with performance Y, can you do X in Ruby/Python with performance close to Y?
Yes. Take, as an example, PyPy. It is a collection of Python code that performs close to C in doing interpretation (not all that close, but not all that far away either). It does this by performing full-program an... |
> Can you build compilers for dynamic languages like Ruby to have similar and comparable performance to C/C++?
I think that the answer's **"yes"**. I also believe that they can even **surpass** the current C/C++ architecture in terms of efficiency (even if slighly).
The reason is simple: **There's more informatio... |
To all those who said “yes” I’ll offer a counter-point that the answer is **“no”, by design**. Those languages will *never* be able to match the performance of statically compiled languages.
Kos offered the (very valid) point that dynamic languages have more information about the system at runtime which can be used ... |
In a Whitted ray tracer, each ray-object intersection spawns a transmitted ray (if the object was translucent), a reflected ray and a shadow ray. The shadow ray contributes the direct lighting component.
But what happens if the shadow ray intersects a transparent object? Is the direct lighting component ignored? How... |
Is the shadow ray in a Whitted ray tracer occluded by transparent objects? |
|graphics| |
In a Whitted ray tracer, each ray-object intersection spawns a transmitted ray (if the object was translucent), a reflected ray and a shadow ray. The shadow ray contributes the direct lighting component.
But what happens if the shadow ray intersects a transparent object? Is the direct lighting component ignored? How... |
I'm curious. I've been working on this datatype in *OCaml*:
type 'a exptree =
| Epsilon
| Delta of 'a exptree * 'a exptree
| Omicron of 'a
| Iota of 'a exptree exptree
Which can be manipulated using explicitly typed recursive functions (a feature that has been added quite recently)... |
Polymorphism and Inductive datatypes |
|coq|inductive-datatypes| |
To all those who said “yes” I’ll offer a counter-point that the answer is **“no”, by design**. Those languages will *never* be able to match the performance of statically compiled languages.
Kos offered the (very valid) point that dynamic languages have more information about the system at runtime which can be used ... |
null |
I am a little confused by the question. If you are interested in trees with degree at most $3$, which is what Wikipedia says you want, then we run into the problem that a single edge has $n=2$ nodes and $n=2$ leaves, but $n/2 = 1$. Anyway, here is something close that has an easy argument.
Let $T$ be such a tree... |
One of the first things Coq does is building the induction principle associated with the inductive type you just defined and understanding the underlying induction principle is a good exercise.
For example `O : nat | S : nat -> nat` will generate the induction principle `P O -> (∀ n, P n -> P (S n)) -> ∀ n, P n`.
... |
Ralph Matthes describes how to simulate types like this in Coq in "A Datastructure for Iterated Powers" ([code](http://www.irit.fr/~Ralph.Matthes/Coq/MPC06/), [paper](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.104.6650)). |
null |
Is the number of coin tosses of a probabilistic Turing machine a Blum complexity measure? |
Since @Pratik's answer covers good resources for algorithms, I just wanted to mention that since you asked about big-O notation, Peter Braß has written a book on the topic, which you can find here http://www-cs.ccny.cuny.edu/~peter/obook.letter.ps |
null |
Since @Pratik's answer covers good resources for algorithms, I just wanted to mention that since you asked about big-O notation, Peter Braß has written a book on the topic, which you can find [here](http://www-cs.ccny.cuny.edu/~peter/obook.letter.ps). |
|graphics| |
I wonder if it is possible to build compilers for dynamic languages like Ruby to have similar and comparable performance to C/C++? From what I understand about compilers, take Ruby for instance, compiling Ruby code can't ever be efficient because the way Ruby handles reflection, features such as automatic type conversi... |
null |
The short answer is: **we don't know**, ask again in 100 years. (We might still not know then; possibly we'll never know.)
In theory, this is possible. Take all the programs that have ever been written, manually translate them to the most efficient possible machine code, and write an interpreter that maps source cod... |
null |
###Closure Properties###
Once you have a small collection of non-context-free languages you can often use [closure properties](https://en.wikipedia.org/wiki/Context-free_language#Closure_properties) of $\mathrm{CFL}$ like this:
> Assume $L \in \mathrm{CFL}$. Then, by closure property X (together with Y), $L' \in \... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.