Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
Questionintegrate any bill acceptor in my c# application Pin
MaurizioFiorentino24-Sep-14 7:19
MaurizioFiorentino24-Sep-14 7:19 
AnswerRe: integrate any bill acceptor in my c# application Pin
ZurdoDev24-Sep-14 10:05
professionalZurdoDev24-Sep-14 10:05 
GeneralRe: integrate any bill acceptor in my c# application Pin
MaurizioFiorentino30-Sep-14 6:47
MaurizioFiorentino30-Sep-14 6:47 
AnswerRe: integrate any bill acceptor in my c# application Pin
ZurdoDev30-Sep-14 7:15
professionalZurdoDev30-Sep-14 7:15 
QuestionCoding music rhythms Pin
Navid Abyazi24-Sep-14 5:27
professionalNavid Abyazi24-Sep-14 5:27 
QuestionRe: Coding music rhythms Pin
ZurdoDev24-Sep-14 5:53
professionalZurdoDev24-Sep-14 5:53 
AnswerRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:00
professionalNavid Abyazi25-Sep-14 7:00 
QuestionRe: Coding music rhythms Pin
ZurdoDev25-Sep-14 7:17
professionalZurdoDev25-Sep-14 7:17 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult24-Sep-14 6:09
mvePIEBALDconsult24-Sep-14 6:09 
GeneralRe: Coding music rhythms Pin
BillWoodruff24-Sep-14 22:06
professionalBillWoodruff24-Sep-14 22:06 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult25-Sep-14 6:22
mvePIEBALDconsult25-Sep-14 6:22 
GeneralRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:15
professionalNavid Abyazi25-Sep-14 7:15 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult26-Sep-14 8:08
mvePIEBALDconsult26-Sep-14 8:08 
AnswerRe: Coding music rhythms Pin
Pete O'Hanlon24-Sep-14 8:40
mvePete O'Hanlon24-Sep-14 8:40 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult24-Sep-14 8:44
mvePIEBALDconsult24-Sep-14 8:44 
GeneralRe: Coding music rhythms Pin
Bernhard Hiller24-Sep-14 20:49
Bernhard Hiller24-Sep-14 20:49 
GeneralRe: Coding music rhythms Pin
Pete O'Hanlon24-Sep-14 20:58
mvePete O'Hanlon24-Sep-14 20:58 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult25-Sep-14 6:23
mvePIEBALDconsult25-Sep-14 6:23 
GeneralRe: Coding music rhythms Pin
Navid Abyazi25-Sep-14 7:19
professionalNavid Abyazi25-Sep-14 7:19 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult26-Sep-14 2:55
mvePIEBALDconsult26-Sep-14 2:55 
GeneralRe: Coding music rhythms Pin
PIEBALDconsult30-Sep-14 10:52
mvePIEBALDconsult30-Sep-14 10:52 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki3-Oct-14 5:57
professionalBassam Abdul-Baki3-Oct-14 5:57 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki3-Oct-14 7:19
professionalBassam Abdul-Baki3-Oct-14 7:19 
AnswerRe: Coding music rhythms Pin
Bassam Abdul-Baki5-Oct-14 11:42
professionalBassam Abdul-Baki5-Oct-14 11:42 
General solution for generating unique sequences (in increasing order or decreasing denominators) (e.g., {(1/4, 1/4, 1/2)}):

Let S1 = {(1)} and S2 = {(1/2, 1/2)} ∪ S0.

Then S2n = The set of every element in S2n-1 beginning with 1/2n-1 and ending with 1/2k concatenated with every set element in S2n-1 greater than or equal to 1/2k and every element fraction gets halved ∪ S2n-1.

If we omit the first underlined condition, we wouldn't be able to use the union of the previous set as a shortcut. If we omit the second underlined condition, we won't get the uniqueness and we won't get every permutation either.

So S4 = [ {(1/2, 1/2), (1/2, 1/2)} & {(1/2, 1/2), (1)} ] / 2 ∪ S2 = {(1/4, 1/4, 1/4, 1/4), (1/4, 1/4, 1/2)} ∪ S2.

This will not generate (1/4, 1/2, 1/4) or (1/2, 1/4, 1/4), etc.

And, thus, S8 = {(1/4, 1/4, 1/4, 1/4) concatenated with each set in S4 then halved, and (1/4, 1/4, 1/2) concatenated with each of the two sets in {(1/2, 1/2), (1)} and halved, and all of S4 once more}.

To get the count of them, you'd need to count all the permutations.
16C16       16 16's
15C14,1     14 16's   1 8's
14C12,2     12 16's   2 8's
13C12,1     12 16's           1 4's
13C10,3     10 16's   3 8's
12C10,1,1   10 16's   1 8's   1 4's
12C8,4       8 16's   4 8's
11C8,2,1     8 16's   2 8's   1 4's
10C8,2       8 16's           2 4's
 9C8,1       8 16's                   1 2's
11C6,5       6 16's   5 8's
10C6,3,1     6 16's   3 8's   1 4's
 9C6,1,2     6 16's   1 8's   2 4's
 8C6,1,1     6 16's   1 8's           1 2's
10C4,6       4 16's   6 8's
 9C4,4,1     4 16's   4 8's   1 4's
 8C4,2,2     4 16's   2 8's   2 4's
 7C4,2,1     4 16's   2 8's           1 2's
 7C4,3       4 16's           3 4's
 6C4,1,1     4 16's           1 4's   1 2's
 9C2,7       2 16's   7 8's
 8C2,5,1     2 16's   5 8's   1 4's
 7C2,3,2     2 16's   3 8's   2 4's
 6C2,3,1     2 16's   3 8's           1 2's
 6C2,1,3     2 16's   1 8's   3 4's
 5C2,1,1,1   2 16's   1 8's   1 4's   1 2's
 8C8                  8 8's
 7C6,1                6 8's   1 4's
 6C4,2                4 8's   2 4's
 5C4,1                4 8's           1 2's
 5C2,3                2 8's   3 4's
 4C2,1,1              2 8's   1 4's   1 2's
 4C4                          4 4's
 3C2,1                        2 4's   1 2's
 2C2                          	      2 2's
 1C1                                          1 1's 

Count(S1) =1
Count(S2) =2
Count(S4) =6
Count(S8) =56
Count(S16)=5272


Generating the count for 32 and 64 is not all that difficult manually or programmatically. Would rather do it manually myself. Generating every permutation is still an interesting exercise.


modified 26-Oct-14 14:33pm.

QuestionHow to prevent a child control to be added in usercontrol Pin
Phil Thomson24-Sep-14 4:43
Phil Thomson24-Sep-14 4:43 

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.