Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • 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
Joined
Aug 24, 2011
Messages
1
Location
MX
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top