Skip to main content
Advice
2 votes
11 replies
167 views

I need to construct a regex given an integer n that matches any partition of n with a leading +. For example, if n=10, it should match +10, +9+1, +1+9, +1+8+1 etc. Since there are only finitely many ...
nonhuman's user avatar
  • 140
0 votes
2 answers
225 views

I have seen loads of posts on this topic, but none are exactly what I am looking for. I want to find all ways a positive integer N that is greater than 1 can be expressed as the sum of at most N ...
Ξένη Γήινος's user avatar
0 votes
2 answers
358 views

I'm trying to generate a random set of numbers that add up to a specific total, and a specific maximum value that the numbers can reach. However each approach I seem to have come across have some flaw ...
Connor Moran's user avatar
3 votes
2 answers
79 views

I want to create all nested partitions of an integer - with all possible permutations of numbers and brackets (nests) at all possible positions. For example, for n = 3, I would like to have (3,) (1, 2)...
Jake B.'s user avatar
  • 465
2 votes
1 answer
170 views

Given a set of numbers, I want to check if it is possible to produce the full set of numbers by repeatedly splitting one single starting number into its halves and doing the same for each of the ...
Kevin's user avatar
  • 61
1 vote
2 answers
226 views

Another phrasing is: randomly partition N identical items into k buckets, allowing some buckets to be empty. For this discussion: an "integer partition of N", to match the usual definition ...
PPenguin's user avatar
  • 329
0 votes
0 answers
431 views

I have a simple DAG, where I am calling BigQueryInsertJobOperator Is there any way to create a partitioned table? article= BigQueryInsertJobOperator( task_id="article", ...
Archie's user avatar
  • 149
1 vote
1 answer
327 views

Following this thread python-integer-partitioning-with-given-k-partitions I want to find the number of such partitions (where the minimum part is equal to 1), but the following solution (in the thread ...
linuxbeginner's user avatar
4 votes
3 answers
218 views

How can I determine the rank/index of a partition of integer n with length k? For instance, if n=10 and k=3, the possible partitions (sorted in reverse lexicographic order) are: 0 (8, 1, 1) 1 (7, 2, 1)...
Sochima Biereagu's user avatar
0 votes
1 answer
157 views

I am trying to randomly generate integer partitions (N into M parts) in pytorch with a minimum partition size of 1. For example, (3, 1, 1) and (4, 1, 0) are both partitions of 5 into 3 parts but (4, 1,...
Tom Huntington's user avatar
1 vote
0 answers
179 views

I'm working on a music related problem and I need some help with a crucial step. I have four lists of numbers from 0 to 11 (including). These lists are to be thought of as vertically aligned. I want ...
Pedro Proença's user avatar
1 vote
1 answer
142 views

I have an integer N and I wish to generate one of its possible partitions uniformly at random. For example, N=5 has 7 partitions: (5) - K=1 part (4, 1) - K=2 parts (3, 2) - K=2 parts (3, 1, 1) - K=3 ...
lucasvb's user avatar
  • 11
1 vote
0 answers
92 views

I am trying to translate a Python generator into a function in C. If it's worth mentioning, I'm trying to write a program that partitions an integer n, into l distinct parts. I believe that I've got ...
murage kibicho's user avatar
4 votes
3 answers
858 views

with the following code, I count the restricted integer partitions(each number can only occure once in each partition) with k numbers in each partition, each number is equal or greater than 1 and not ...
TTho Einthausend's user avatar
2 votes
2 answers
809 views

I want to count the number of ways we can partition the number n, into k distinct parts where each part is not larger than m. For k := 2 i have following algorithm: public int calcIntegerPartition(int ...
TTho Einthausend's user avatar

15 30 50 per page