Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I count special type combinations?

Status
Not open for further replies.

Edu59

Computer
Aug 24, 2011
1
Hi:
I am a computer engineer and I am trying to count the following type of combinations with an unknown built-in function in Matlab:
Let K={1,2,...,20} be the set of the first 20 integers.Consider all combinations of 9 elements selected from the set K.How many of these combinations contain elements that differ by 3?
For example (7,10,11,12,14,17,18,19,20)has elements 7 and 10 whose
difference is 3 while the combination (1,2,6,7,8,12,13,14,19) has no elements with difference 3.
Using Matlab,how many combinations are there that contain elements that differ by 3?
Thank you in advance.
 
Replies continue below

Recommended for you

Status
Not open for further replies.

Part and Inventory Search

Sponsor