Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
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 
AnswerRe: How to prevent a child control to be added in usercontrol Pin
BillWoodruff24-Sep-14 6:11
professionalBillWoodruff24-Sep-14 6:11 
GeneralRe: How to prevent a child control to be added in usercontrol Pin
Phil Thomson24-Sep-14 6:49
Phil Thomson24-Sep-14 6:49 
AnswerRe: How to prevent a child control to be added in usercontrol Pin
BillWoodruff24-Sep-14 21:41
professionalBillWoodruff24-Sep-14 21:41 
GeneralRe: How to prevent a child control to be added in usercontrol Pin
Phil Thomson25-Sep-14 10:01
Phil Thomson25-Sep-14 10:01 
GeneralRe: How to prevent a child control to be added in usercontrol Pin
BillWoodruff25-Sep-14 20:46
professionalBillWoodruff25-Sep-14 20:46 
QuestionHow to stop exposing multiple endpoint at client side in WCF Pin
Tridip Bhattacharjee24-Sep-14 4:23
professionalTridip Bhattacharjee24-Sep-14 4:23 
SuggestionRe: How to stop exposing multiple endpoint at client side in WCF Pin
Richard MacCutchan24-Sep-14 5:33
mveRichard MacCutchan24-Sep-14 5:33 
AnswerRe: How to stop exposing multiple endpoint at client side in WCF Pin
Dominic Burford24-Sep-14 5:43
professionalDominic Burford24-Sep-14 5:43 
GeneralRe: How to stop exposing multiple endpoint at client side in WCF Pin
Tridip Bhattacharjee24-Sep-14 21:35
professionalTridip Bhattacharjee24-Sep-14 21:35 
GeneralRe: How to stop exposing multiple endpoint at client side in WCF Pin
Dominic Burford25-Sep-14 1:24
professionalDominic Burford25-Sep-14 1:24 
GeneralRe: How to stop exposing multiple endpoint at client side in WCF Pin
Tridip Bhattacharjee25-Sep-14 2:39
professionalTridip Bhattacharjee25-Sep-14 2:39 
GeneralRe: How to stop exposing multiple endpoint at client side in WCF Pin
Dominic Burford25-Sep-14 3:57
professionalDominic Burford25-Sep-14 3:57 
Questionerror: "Not a legal OleAut"when importing Excel2007 into SQL Pin
Member 245846723-Sep-14 21:51
Member 245846723-Sep-14 21:51 
AnswerRe: error: "Not a legal OleAut"when importing Excel2007 into SQL Pin
Bernhard Hiller24-Sep-14 20:56
Bernhard Hiller24-Sep-14 20:56 
QuestionRegarding a basic question about Serialization Pin
Tridip Bhattacharjee23-Sep-14 21:26
professionalTridip Bhattacharjee23-Sep-14 21:26 
AnswerRe: Regarding a basic question about Serialization Pin
Eddy Vluggen23-Sep-14 21:50
professionalEddy Vluggen23-Sep-14 21:50 

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.