Skip to content

diegob236/Combinatorics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Combinatorics


A collection of Python scripts that solve combinatorics problems.

This repository contains some Python scripts to do various tasks, as described below.

Contents:

  1. Erdos-Gallai
  2. Numnine

Erdos-Gallai


The Erdos-Gallai theorem is used to find whether a series of numbers is a valid degree sequence. The algorithm is as shown:

\sum^{k}{i=1}d_i\leq k(k-1)+ \sum^n{i=k+1} \min(d_i,k)

erdosgallai.py takes a series of nonnegative numbers separated by spaces as its arguments. It then runs the algorithm to find whether they are a valid degree sequence or not.

Numnine


numnine.py counts how many numbers in a specified range contain the digit 9. This range is between 0 and 10^n - 1, where n is a nonnegative number provided as an argument. For example, entering 3 as an argument will count numbers from 0 to 999.
(Soon to be updated to allow for all digits, not just 9!)

About

A collection of Python programs to solve combinatorics problems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages