Git Product home page Git Product logo

sinterbot's Introduction

Readme Card

sinterbot's People

Contributors

cristoper avatar

Stargazers

 avatar  avatar

Watchers

 avatar

sinterbot's Issues

Don't require separate smtp.conf

Originally I thought people might want to maintain several santa lists with a single smtp.conf. However, it is a bit complicated and confusing. Better to just include smtp conf in the same config file as santas.

Answer third question in weblog post

The weblog post is incomplete and doesn't talk about counting permutations with more constraints. I need to get a better handle on counting and generating functions and attempt to answer them! I ran out of time this year.

Some draft that got cut from the article:

=== More constraints

Mere derangements are fine, but what if our friends think secret santa is more fun if two people cannot be assigned to each other (that there should be no fixed points or two-cycles)? or that there should be only one cycle?

There can of course be more elaborate constraints and questions, the sorts of things investigated by https://en.wikipedia.org/wiki/Random_permutation_statistics[statistics of random permutations] and https://en.wikipedia.org/wiki/Generating_function[generating functions].

==== Single n-cycle

The easiest case is if we want to restrict assignments to a single cycle that includes all latexmath:[n] elements. A permutation with one cycle is a derangement by definition.
Choose any person in the set. There are latexmath:[n-1] remaining people to choose from to assign as their secret santa. After making that assignment there are latexmath:[n-2] remaining people to assign as the previous choice's santa. Carried out to the end we see that there are

[latexmath]
++++
\begin{align*}
&(n-1)(n-2)\cdots (n-(n-1))\
&= (n-1)!
\end{align*}
++++

possible n-cycle permutations of latexmath:[n] elements. (For five people that means there are latexmath:[4! = 24] possible single cycle secret santa assignments).

==== Counting k-cycles

  • probability of a permutation containing a 2-cycle
  • probability of derangement containing a k-cycle
    • black lists

Explain the probability in rand_derangement()

Currently the weblog post mentions that Martínez et al's algorithm works because of a "specific probability" but it doesn't explain how that is derived from the recurrence relation for Dn.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.