Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 65205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:54:36+00:00 2026-05-10T18:54:36+00:00

Someone asked me a question via e-mail about integer partitions the other day (as

  • 0

Someone asked me a question via e-mail about integer partitions the other day (as I had released a Perl module, Integer::Partition, to generate them), that I was unable to answer.

Background: here are all the integer partitions of 7 (the sum of each row equals 7).

7 6 1 5 2 5 1 1 4 3 4 2 1 4 1 1 1 3 3 1 3 2 2 3 2 1 1 3 1 1 1 1 2 2 2 1 2 2 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 

Now if we look at the lengths of each partition and count how many there are of each length:

1 1 2 3 3 4 4 3 5 2 6 1 7 1 

… we see one partition has a length of 1 (7), one has a length of 7 (1 1 1 1 1 1 1). There are 4 partitions that have a length of 3: (5 1 1), (4 2 1), (3 3 1), (3 2 2).

For larger numbers of N, if you graph the distribution of partition lengths, an asymetric curve emerges, skewed towards the origin. If you’re curious, graph the following partition length counts for N=40.

1 20 133 478 1115 1945 2738 3319 3589 3590 3370 3036 2637 2241 1861 1530 1236 995 790 627 490 385 297 231 176 135 101 77 56 42 30 22 15 11 7 5 3 2 1 1

If you’re interested in generating these distribution counts, here’s the code I used:

#! /usr/local/bin/perl  use strict; use warnings;  use Integer::Partition;  my $n = shift || 1;  while (1) {     my $start = time;     my $i = Integer::Partition->new($n);     my %size;     while (my $p = $i->next) {         $size{scalar @$p}++;     }      open my $out, '>>', 'bucket-count.out';     for my $s (sort {$a <=> $b} keys %size) {         print $out '$n\t$s\t$size{$s}\n';     }     close $out;     my $delta = time - $start;     print '$n\t$delta secs\n';     ++$n; } 

(note: on my computer, N=90 takes about 10 minutes to generate).

So my question is: what equation can be used to match the observed distribution curve? Is it a Gauss (can a Gaussian distribution be asymetric?) or Poisson distribution, or something else?

How do I solve it for N? If I remember my maths from high-school, I can determine the peak by solving when the derivative intersects 0. How do I produce the derivative? I’ve searched the web but all I get back are abstruse mathematical papers. I just need some code 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:54:37+00:00Added an answer on May 10, 2026 at 6:54 pm

    I think a poisson distribution is a reasonable estimate. Given that presumption your problem now turns to one of fnding the maximum frequency, k, given N. I think you have two approaches:

    1. figure it out from a mathematical standpoint (I would start by looking at combinatorics, but that may not be a particularly good steer)
    2. presume it is poisson and measure the peak for any given N, as you have above.

    Once you have the peak (k), estimating lambda should be straightforward (try a few out) and you have your curve.

    Another approach is to work the whole thing up in python and ask on the numpy or scipy boards 🙂

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 67k
  • Answers 67k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer I'm afraid this isn't supported for web sites, you'll need… May 11, 2026 at 12:01 pm
  • added an answer Stack growth doesn't usually depend on the operating system itself,… May 11, 2026 at 12:01 pm
  • added an answer There is no expert who can give you a rule… May 11, 2026 at 12:01 pm

Related Questions

Someone asked me a question via e-mail about integer partitions the other day (as
Someone asked me how familiar I am with VC++ and how familiar I am
Today someone asked me what was wrong with their source code. It was obvious.
Can someone explain to me why this code prints 14? I was just asked
In this question someone asked for ways to display disk usage in Linux. I'd
I was just browsing a forum and someone asked about a PHP file they
(The original question was asked there : http://www.ogre3d.org/phpBB2/viewtopic.php?t=44832 ) Someone asked : While I
Recently, someone asked about an algorithm for reversing a string in place in C
Someone at work just asked for the reasoning behind having to wrap a wait
When I asked for tools to profile Rails apps, someone pointed at DTrace .

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.