The Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math

Topic: make 100 by using 1, 7, 7, 7, 7
Replies: 41   Last Post: Nov 15, 2007 6:13 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Michael Press

Posts: 2,137
Registered: 12/26/06
Re: make 100 by using 1, 7, 7, 7, 7
Posted: Nov 15, 2007 2:42 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

In article <2007111501402216807-kirakun@earthlinknet>,
Kira Yamato <kirakun@earthlink.net> wrote:

> On 2007-11-14 21:08:03 -0500, Michael Press <rubrum@pacbell.net> said:
>

> >
> > Here is a Perl script that prints out all balanced strings
> > of parentheses. The balanced strings of 2n parentheses
> > can be bijected with the binary trees on n vertices.
> >
> > The script works like this:
> >
> > P_n is the set of balanced strings of 2n parentheses so
> > P_{n+1} = (P_{k}) P_{n - k}.
> >
> > The script is criminally wasteful of time and
> > space, but it is easy to code, an easy to understand. :)
> >
> > ________________________
> > #!/usr/bin/perl


[...]

> > ________________________
>
> Nice work with the recursion!


Thanks. I should have mentioned that the balanced
strings are bijectable with the complete binary
trees on 2n+1 vertices, a more relevant structure.

A sane approach to listing the strings
is by branch and bound, keeping track of
parentheses depth.

--
Michael Press


Date Subject Author
11/12/07
Read make 100 by using 1, 7, 7, 7, 7
dangerousgame95@gmail.com
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Thomas Nordhaus
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
amzoti
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
quasi
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
dangerousgame95@gmail.com
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
magidin@math.berkeley.edu
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Thomas Nordhaus
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
quasi
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Joshua Cranmer
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Raymond Manzoni
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
William Elliot
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
amzoti
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
David R Tribble
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Nat Silver
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Raymond Manzoni
11/12/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Raymond Manzoni
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Adrian Duma
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
benjamin.a.bartsch@gmail.com
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
amzoti
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
David W. Cantrell
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
magidin@math.berkeley.edu
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
David W. Cantrell
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
magidin@math.berkeley.edu
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
briggs@encompasserve.org
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Robert Israel
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Dave Seaman
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
benjamin.a.bartsch@gmail.com
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
amzoti
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
David W. Cantrell
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Jan Kristian Haugland
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Robert Israel
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Kira Yamato
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Kira Yamato
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Robert Israel
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
amzoti
11/14/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Thomas Nordhaus
11/15/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Michael Press
11/14/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Michael Press
11/15/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Kira Yamato
11/15/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Michael Press
11/15/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Rick Decker
11/13/07
Read Re: make 100 by using 1, 7, 7, 7, 7
Raymond Manzoni

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2017. All Rights Reserved.