Tuesday, December 28, 2010
Python Keyboard ShortCut
- Backspace deletes to the left; Del deletes to the right
- Arrow keys and Page Up/Page Down to move around
- Home/End go to begin/end of line
- C-Home/C-End go to begin/end of file
- Some Emacs bindings may also work, including C-B, C-P, C-A, C-E, C-D, C-L
- C-C interrupts executing command
- C-D sends end-of-file; closes window if typed at a >>> prompt
- Alt-p retrieves previous command matching what you have typed
- Alt-n retrieves next
- Return while on any previous command retrieves that command
- Alt-/ (Expand word) is also useful here
NLTK Home
- News - NLTK Cookbook by Jacob Perkins [December 2010], NLTK book in third printing [November 2010], Japanese translation of NLTK book published [November 2010], Version 2.0b9 released [July 2010], Version 2.0b8 included in Ubuntu 10.4 [February 2010]
- Code - functionality provided by NLTK in over 100,000 lines of Python code, distributed under the Apache License
- Data - ~60 corpora, grammar collections, and trained models that come with NLTK
- Quotes - what people have said about NLTK
Getting Started
- Documentation - book, articles, guides, reviews
- Download - instructions for downloading and installing Python and NLTK on all platforms
- Getting Started - simple things to try, including NLTK's demonstrations
- Subscribe - sign up for important announcements - approx 1 post per month
Getting Help
- FAQ - answers to frequently asked questions
- HOWTO - guides for a variety of NLTK packages, including many examples
- User forum - mailing list for discussion amongst NLTK users
- Chatroom - #nltk on irc.freenode.net (not often staffed)
- API Documentation - complete documentation of all NLTK modules
- Source - browse the Python source code
- Google Code - the home of the NLTK development work (submit a feature request or bug report)
- People - the NLTK development team
- API Documentation - complete documentation of all NLTK modules
- Source - browse the Python source code
- Google Code - the home of the NLTK development work (submit a feature request or bug report)
- People - the NLTK development team
Education and Research
- Courses - ~100 courses in 23 countries using NLTK (artificial intelligence, computational linguistics, information retrieval, machine learning)
- Projects - ideas for student projects
- Teaching - information for instructors teaching courses using NLTK
- Research - hundreds of research papers that mention or use NLTK, via Google Scholar
Saturday, December 25, 2010
Some Mathematical Gifts
Gifts of all kinds: a site, theorems, and proofs
Ron Rivest is one of the most famous computer scientists in the world. While he has done many important things in many aspects of computer theory, he is best known as the “R” in RSA. This is the renowned public key system based on the hardest of factoring created by Ron and Adi Shamir and Len Adleman. They won the Turing Award for this terrific achievement.
One of the “gifts” is from Ron, and the others are from various places and people. It is near the end of the year and the winter solstice is coming up soon: it is on December 21, at 6:38 pm EST. This time of year various cultures also have holidays, festivals, and rituals that celebrate this time. Of course this is the time also for gifts of all kinds, since many holidays involve gifts or celebrations: Chinese New Year, Christmas, Hanukkah, Kwanzaa, New Year, St. Lucia Day, and many others.
In this spirit I hope you enjoy a small number of fun items that I view as gifts from mathematics to all of us.Gift I
Daniel Kirsch’s gift.One of the coolest sites I have seen in years is this. Go to the site and then draw with your mouse any symbol at all, anything at all, and magically the site lists a number of LaTeX commands that it thinks are what you want. I drew this
Very cool. Does everyone know about this great site—am I the last to discover it?
(Let us not forget that TeX itself was a gift. And LaTeX and AMSTeX and all the rest too. That is on a scale beyond the margins of this post.)
Gift IIRon’s gift.
Ron had a brilliant idea that help solve an important open problem called the Aanderaa-Karp-Rosenberg Conjecture. It is still not completely resolved, but I want to highlight his idea—actually the work was joint with Jean Vuillemin. Suppose that is a boolean function. There are many ways to define the complexity of such a function:
- the size of its smallest general circuit;
- the size of its smallest circuit of a given constant depth;
- and so on.
The depth of the decision tree is the length of the longest path in the tree from the root to a leaf. This is the measure that Ron’s idea works on—note the size of the tree is also quite interesting, but that for another day.
Call a boolean functionThe natural question is how does one prove that various functions are elusive? In general this can be quite hard, but Ron’s beautiful idea resolves it for many functions.
Theorem: Let be a boolean function. Suppose that the number of
so that
is odd. Then the function
is elusive.
Next we note that the following identity is true:
This is one of the most elegant counting arguments, in my opinion. Perhaps in each case there is an alternative proof, perhaps one based on an adversary. But this counting is so nice. As a simple example consider the majority function on inputs: it is
when there are two or more
‘s in its input. This happens
ways, so the function is elusive.
Gift III
Bettina Richmond’s gift.Imagine that you are given a black box . It has a slot where you can put any real number, after you place one, it makes some sound, vibrates a bit, and returns a value. Inside the box is a secret polynomial
: if you put in
, you get out
.
The proof of this is quite neat. Ask the black box for the value
. Then ask it for the value at
. A moments thought will show that this essentially yields the coefficients of the polynomial: one just converts the answer to radix
and reads off the coefficients. Note it works precisely because the coefficients are all non-negative natural numbers.
Gift IV
Pythagoras’ gift.Well not quite. There is an interesting discussion on MathOverflow whether or not there is a proof that is not rational that does not use “proof by contradiction.” See also Tim Gowers’ interesting discussion on this and more.
I need two basic facts about integers:
Any non-zero integer is of the form
I claim these both are provable by induction. To prove (1) use simple induction. It is clearly true for
Let’s start the proof. Fix and
, not both zero and let
. Our goal is to show
is not zero.
Suppose
and
. Then
is clearly non-zero.
Suppose that both
and
are not divisible by
. Then
modulo
is
which is not zero. Thus
is not zero. This uses (1) and the fact that
.
Suppose that
and
by (2) above. Then,
So assume that . Then
is equal to
The last sub-case is . Then
is equal to
Open Problems
Is the proof of irrationality of