Click here to Skip to main content
15,895,792 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Reading text file problem with casting to double Pin
cjengler4-Apr-07 2:36
cjengler4-Apr-07 2:36 
QuestionPermutations of an election result Pin
Colin Angus Mackay31-Mar-07 10:32
Colin Angus Mackay31-Mar-07 10:32 
AnswerRe: Permutations of an election result Pin
Luc Pattyn31-Mar-07 11:05
sitebuilderLuc Pattyn31-Mar-07 11:05 
GeneralRe: Permutations of an election result Pin
Colin Angus Mackay31-Mar-07 11:27
Colin Angus Mackay31-Mar-07 11:27 
GeneralRe: Permutations of an election result Pin
Luc Pattyn31-Mar-07 11:47
sitebuilderLuc Pattyn31-Mar-07 11:47 
GeneralRe: Permutations of an election result Pin
Colin Angus Mackay31-Mar-07 23:03
Colin Angus Mackay31-Mar-07 23:03 
GeneralRe: Permutations of an election result Pin
Luc Pattyn31-Mar-07 23:33
sitebuilderLuc Pattyn31-Mar-07 23:33 
GeneralRe: Permutations of an election result Pin
Luc Pattyn31-Mar-07 12:55
sitebuilderLuc Pattyn31-Mar-07 12:55 
Hi Colin,

also I am not convinced you should concentrate on the table of permutations, because
different lines have different probabilities, so counting the lines does not help.

As an example, assume two voters E and F; they each can vote A/B/C/D/absent/spoiled
(6 possibilities each), so there are in fact 36 different combinations (that you
would group in 30 lines):

A  B  C  D  ab sp  count
2  0  0  0  0  0     1    requires E and F to both vote A
1  0  0  0  1  0     2    requires E to vote A and F to be absent, OR vice versa
1  0  0  0  0  1     2    requires E to vote A and F to spoil, OR vice versa 
0  2  0  0  0  0     1    requires E and F to both vote B
0  1  0  0  1  0     2    requires E to vote B and F to be absent, OR vice versa
0  1  0  0  0  1     2    requires E to vote B and F to spoil, OR vice versa 
0  0  2  0  0  0     1    requires E and F to both vote C
0  0  1  0  1  0     2    requires E to vote C and F to be absent, OR vice versa
0  0  1  0  0  1     2    requires E to vote C and F to spoil, OR vice versa 
0  0  0  2  0  0     1    requires E and F to both vote D
0  0  0  1  1  0     2    requires E to vote D and F to be absent, OR vice versa
0  0  0  1  0  1     2    requires E to vote D and F to spoil, OR vice versa
1  1  0  0  0  0     2    requires E to vote A and F to vote B, OR vice versa 
1  0  1  0  0  0     2    requires E to vote A and F to vote C, OR vice versa 
1  0  0  1  0  0     2    requires E to vote A and F to vote D, OR vice versa 
0  1  1  0  0  0     2    requires E to vote B and F to vote C, OR vice versa 
0  1  0  1  0  0     2    requires E to vote B and F to vote D, OR vice versa 
0  0  1  1  0  0     2    requires E to vote C and F to vote D, OR vice versa 
0  0  0  0  2  0     1    requires E and F to both be absent
0  0  0  0  1  1     2    requires E absent and F spoil, OR vice versa
0  0  0  0  0  2     1    requires E and F to both spoil


Hope this helps.


Luc Pattyn

[My Articles]

QuestionRe: Permutations of an election result Pin
David Crow4-Apr-07 4:11
David Crow4-Apr-07 4:11 
Questionmatlab a function in m-file Pin
akira3231-Mar-07 2:13
akira3231-Mar-07 2:13 
AnswerRe: matlab a function in m-file Pin
rbuchana31-Mar-07 9:48
rbuchana31-Mar-07 9:48 
AnswerRe: matlab a function in m-file Pin
Sean Cundiff31-Mar-07 13:24
Sean Cundiff31-Mar-07 13:24 
Questionbandwidth question Pin
Planker29-Mar-07 19:08
Planker29-Mar-07 19:08 
AnswerRe: bandwidth question Pin
Rilhas19-May-07 10:03
Rilhas19-May-07 10:03 
Questiongenerate unrepeated serials Pin
samira forooghi28-Mar-07 20:05
samira forooghi28-Mar-07 20:05 
AnswerRe: generate unrepeated serials Pin
Nathan Addy29-Mar-07 15:19
Nathan Addy29-Mar-07 15:19 
AnswerRe: generate unrepeated serials Pin
Tim Paaschen29-Mar-07 20:18
Tim Paaschen29-Mar-07 20:18 
GeneralRe: generate unrepeated serials Pin
Nathan Addy30-Mar-07 7:38
Nathan Addy30-Mar-07 7:38 
GeneralRe: generate unrepeated serials Pin
Tim Paaschen1-Apr-07 20:40
Tim Paaschen1-Apr-07 20:40 
GeneralRe: generate unrepeated serials [modified] Pin
cp98761-Apr-07 21:13
cp98761-Apr-07 21:13 
GeneralRe: generate unrepeated serials Pin
Nathan Addy2-Apr-07 8:58
Nathan Addy2-Apr-07 8:58 
GeneralRe: generate unrepeated serials Pin
cp98762-Apr-07 15:38
cp98762-Apr-07 15:38 
Questionhelp me Pin
phowarso28-Mar-07 4:38
phowarso28-Mar-07 4:38 
AnswerRe: help me Pin
Newbie0028-Mar-07 5:34
Newbie0028-Mar-07 5:34 
GeneralRe: help me Pin
phowarso28-Mar-07 5:56
phowarso28-Mar-07 5:56 

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.