Click here to Skip to main content
16,018,264 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Process time of the Skipjack and RC5 Pin
Cryptogrpahy27-Mar-08 6:47
Cryptogrpahy27-Mar-08 6:47 
GeneralCombination Generation Problem Pin
s0ren20-Mar-08 20:10
s0ren20-Mar-08 20:10 
GeneralRe: Combination Generation Problem Pin
Luc Pattyn21-Mar-08 1:40
sitebuilderLuc Pattyn21-Mar-08 1:40 
GeneralRe: Combination Generation Problem Pin
CPallini21-Mar-08 11:17
mveCPallini21-Mar-08 11:17 
JokeRe: Combination Generation Problem Pin
David Crow25-Mar-08 10:07
David Crow25-Mar-08 10:07 
GeneralRe: Combination Generation Problem Pin
CPallini25-Mar-08 21:57
mveCPallini25-Mar-08 21:57 
GeneralRe: Combination Generation Problem Pin
CPallini26-Mar-08 0:18
mveCPallini26-Mar-08 0:18 
GeneralRe: Combination Generation Problem Pin
cp987621-Mar-08 13:30
cp987621-Mar-08 13:30 
This is just an awkward way of phrasing a standard combinatorial problem.

Think of your numbers as little rods (some of zero length), now in each combination lay out the rods end to end, note that they combine to length 1. Note that the combination can be expressed by simply listing the finishing locations of each rod, and these occur on the boundaries of the M subintervals.

If you consider the interval [0,1] broken into M subintervals, what you have to do is to enumerate how many ways you can allocate N items into M+1 boxes. Each box is the end of an interval. So if M=10 and one allocation goes {1,2,0,1..} then your numbers are {0, 0.1, 0, 0.2, ..}. They are guaranteed to add to 1 by construction.

The algorithm is probably most easily implemented recursively.

Peter
"Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."

GeneralRe: Combination Generation Problem Pin
Luc Pattyn21-Mar-08 13:50
sitebuilderLuc Pattyn21-Mar-08 13:50 
GeneralRe: Combination Generation Problem Pin
cp987621-Mar-08 14:01
cp987621-Mar-08 14:01 
GeneralRe: Combination Generation Problem Pin
Luc Pattyn21-Mar-08 14:27
sitebuilderLuc Pattyn21-Mar-08 14:27 
GeneralRe: Combination Generation Problem Pin
cp987621-Mar-08 17:58
cp987621-Mar-08 17:58 
GeneralRe: Combination Generation Problem Pin
MidwestLimey25-Mar-08 7:05
professionalMidwestLimey25-Mar-08 7:05 
GeneralRe: Combination Generation Problem Pin
s0ren21-Mar-08 13:51
s0ren21-Mar-08 13:51 
GeneralRe: Combination Generation Problem Pin
Bassam Abdul-Baki24-Mar-08 8:39
professionalBassam Abdul-Baki24-Mar-08 8:39 
GeneralTrifling Problem Pin
soap brain19-Mar-08 1:34
soap brain19-Mar-08 1:34 
GeneralRe: Trifling Problem Pin
Alan Balkany19-Mar-08 4:45
Alan Balkany19-Mar-08 4:45 
GeneralRe: Trifling Problem Pin
Michael Dunn21-Mar-08 10:12
sitebuilderMichael Dunn21-Mar-08 10:12 
GeneralRe: Trifling Problem Pin
Mark Churchill25-Mar-08 3:27
Mark Churchill25-Mar-08 3:27 
Question[Message Deleted] [modified] Pin
Pallab_GT18-Mar-08 12:00
Pallab_GT18-Mar-08 12:00 
QuestionRe: Data Hiding Algorithm Pin
pmarfleet18-Mar-08 12:34
pmarfleet18-Mar-08 12:34 
JokeRe: Data Hiding Algorithm PinPopular
Luc Pattyn18-Mar-08 12:50
sitebuilderLuc Pattyn18-Mar-08 12:50 
GeneralRe: Data Hiding Algorithm Pin
Pallab_GT18-Mar-08 13:29
Pallab_GT18-Mar-08 13:29 
GeneralRe: Data Hiding Algorithm Pin
pmarfleet18-Mar-08 20:40
pmarfleet18-Mar-08 20:40 
GeneralRe: Data Hiding Algorithm Pin
Pallab_GT18-Mar-08 21:06
Pallab_GT18-Mar-08 21:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.