- require 'pp'
- def partition(i, tau)
- if(i == 0)
- 1
- else
- pk_last = partition(i-1, tau)
- pk_this = ((1/(1.0-tao)) * pk_last).ceil + 1
- end
- end
- tau = 0.3
- 0.upto(6) do |i|
- pp [i, partition(i,tau)]
- end
- puts "should be: 1, 3, 6, 10, 15, 22, 31, 43, 59, 80"
- # but it is wrong it is rather: 1 3 6 10 16 24 36