Skip to main content

Questions tagged [combinatorics]

Combinatorics is a branch of mathematics concerning the study of finite or countable discrete structures.

4votes
1answer
147views

The Permutations Algorithm using BubbleSort and stack in PicoBlaze assembly language - attempt #2

So, this is improved code from my previous attempt to implement the permutations algorithm in PicoBlaze assembly language. You can see it live here: ...
FlatAssembler's user avatar
4votes
1answer
256views

The permutations algorithm in PicoBlaze assembly language

You can see it live here: ...
FlatAssembler's user avatar
1vote
1answer
158views

Java program for calculating probabilities of die combinations in Yatzy

Yatzy Yatzy is a dice rolling game where players aim to get particular die combinations. This program counts probability of each such combinations. They are: All five ones, All five twos, Same for ...
coderodde's user avatar
3votes
2answers
119views

Buy units of a good - If you buy them together, you get a discount - Find the cheapest way to purchase all goods available

The problem is as follows: A user needs to be able to purchase goods. He has a total of five distinct goods available: I've called them '1', '2', '3', '4', and '5', If the user buys them in sets, he ...
Andrew Bailey's user avatar
4votes
1answer
81views

<Programming in Lua - 4th> exercise 2.2 - place 8 queens

About exercise 2.2 Place N queens on N*N board, 1 queen per line, so that all queens are safe. Use permutation to improve the provided implementation from book. The ...
Eric's user avatar
  • 161
1vote
1answer
106views

Finding the number of distinct decompositions a number has using only repdigits

This is a problem from a previous semester that I am trying to upsolve. I am trying to solve a problem involving the total number of ways of decomposing a number using only repdigits. A repdigit is a ...
Lesserrafim's user avatar
3votes
2answers
184views

Find the join of two set partitions

Two partitions of a set have a greatest lower bound (meet) and a least upper bound (join). See here: Meets and joins in the lattice of partitions (Math SE) The meet is easy to calculate. I am trying ...
Watchduck's user avatar
3votes
1answer
82views

Number of partitions of (a,b) into k distinct parts which sum up to (a,b)

Problem set This is somewhat a generalization of the famous partition of integer n into k parts. Given two integers ...
linuxbeginner's user avatar
4votes
1answer
129views

Repetition-Limited Multiset Coefficient function

This is a simple multiset coefficient calculator in python, that will calculate both standard multiset coefficients, as well as multiset coefficients with repetition limits, used initially as part of ...
Lee Davis-Thalbourne's user avatar
2votes
1answer
144views

Combinations of elements in array

I wrote this code to get all possible arrangements for an array containing 3 elements: ...
John's user avatar
1vote
0answers
62views

Video Poker with luck modifier

While grinding for coins on the GTA San Andreas casino poker machines I started to wonder how exactly one might implement a luck modifier to a video poker game without it being completely obvious to ...
TorbenPutkonen's user avatar
0votes
0answers
106views

Generating group permutations: an extended Heap's algorithm in Java

Suppose we have a sequence of sequences <1, 2> <3, 4>. There, we have two groups: <1, 2> and ...
coderodde's user avatar
6votes
2answers
108views

Schedule a series of 1:1 contests so that each entrant plays against every other

My sister is organizing a Majong tournament. She wants to set up a set of round-robin rounds. There will be 16 players at 4 tables; 4 players per table. Players will play 5 rounds. She wants every ...
JDT's user avatar
  • 81
2votes
1answer
154views

Find the list of combination (with repetition) given rank and number of items. (Lexicographic ordering)

The problem involves the fastest possible method to generate a list of combinations which repeats from all the possible combinations with repetition allowed. I know there needs to be a way to ...
Reptorian's user avatar
3votes
1answer
161views

String Permutation Implemention

The objective is simple: List all possible permutations for a given a String. I looked at some implementations from popular sources. I decided to build this to the flow: The Code for Review ...
Amal Krishnan's user avatar

153050per page
close