class Fortune::A

Permutation without repetition with select k elements (accommodation) example: 20 different elements and you need select 5 of them (how many ways of selection exists?)

elements is ordered ([a,b,c] != [b,c,a])
A.calc(:elements => 10, :select => 5)

Public Class Methods

new(h) click to toggle source
Calls superclass method
# File lib/fortune/a.rb, line 8
def initialize(h)
  super(h)
  self.value = Math.factorial(self.n)/Math.factorial(self.n - self.k)
end