Counting selections with no adjacent positions
Count the ways to choose positions in a row so that no two chosen positions touch, by shrinking the row to remove the required gaps.
The rule that makes the problem harder
Choosing three positions from a row of seven would be 35 options if any positions were allowed. The nonadjacent rule forbids picking two neighbors, so many of those 35 selections are invalid, such as positions 2, 3 and 6. Counting valid ones directly means checking each of the 35 for touching pairs. A shorter route exists. If the chosen positions are i, j and k with i less than j less than k, nonadjacency means j is at least i plus 2 and k is at least j plus 2. That gap requirement is what the mapping removes.
The shift that removes gaps
Map the three positions i, j, k to i, j minus 1, k minus 2. The first value stays, the second is lowered by one and the third by two. Because each later position was at least two beyond the previous one, the mapped values are now at least one apart, so they are distinct and increasing. They also fit inside the smaller range from 1 to 5, since the largest mapped value is at most 7 minus 2, which is 5. Every valid choice maps to one set of three distinct positions in a row of five, and every such set maps back by reversing the shifts.
Reading the result, ten choices
Because the map is a one-to-one correspondence, the number of valid nonadjacent selections equals the number of three-element subsets of a five-position row. The combination calculator gives 5 choose 3 as 10. The 7-position choices without the gap rule number 35, which the calculator returns for n equal to 7 and r equal to 3, so the rule removes 25 of the 35 selections. For example, the mapped set 1, 2, 3 corresponds to the original positions 1, 3, 5, and the mapped set 3, 4, 5 corresponds to the original positions 3, 5, 7. Listing a few such pairs makes the correspondence concrete. Mapped 1, 3, 4 comes from the original 1, 4, 6, and mapped 2, 3, 5 comes from the original 2, 4, 7. In each case the original positions have at least one empty position between them, which is exactly the nonadjacency rule restated.
Formula for k separated positions in n
For k nonadjacent positions in a row of n, the shift removes k minus 1 forced gaps, leaving a row of n minus k plus 1 positions. The count is n minus k plus 1 choose k. For n equal to 7 and k equal to 3, that is 5 choose 3. For two positions in a row of six, the count is 5 choose 2, which is 10. A direct check supports it: all pairs number 15, adjacent pairs number 5, and 15 minus 5 is 10. For four positions in a row of ten, the count is 7 choose 4, or 35. When n minus k plus 1 is smaller than k, the count is zero.
Testing the largest possible case
The extreme case shows where the formula stops. Four nonadjacent positions in a row of seven have n minus k plus 1 equal to 4, so the count is 4 choose 4, or 1, namely positions 1, 3, 5 and 7. Five nonadjacent positions in seven would need 3 choose 5, which is zero, because no placement exists. This is a quick feasibility test before any counting: k nonadjacent positions need at least 2k minus 1 positions in the row. Seven positions allow at most four, and the formula reflects this by dropping to zero afterward. The same test works for any row length: ten positions allow at most five nonadjacent choices, and twelve allow at most six. Run it first whenever a problem asks for many choices in a short row, because an impossible request has a count of zero and no further work is needed.
Circular rows change the answer
The guide counts a linear row, where position 1 and position 7 are not neighbors. If the positions are around a circle, so that the first and last touch, the extra adjacency removes more selections. For three nonadjacent positions around a circle of seven, the count is 7 rather than 10. The circular formula is n over n minus k times n minus k choose k, and for these values it is 7 over 4 times 4, which is 7. Because the boundary rule differs, the linear shift cannot be reused without adjustment. State whether the arrangement is a row or a ring before counting.
Practical settings for the pattern
This count describes seat choices where nobody sits next to another occupant, spacing of stalls in a row of parking spaces, or selecting days in a week with no two consecutive. For seven days and three nonconsecutive days, the answer is 10, assuming the week is treated as a row from Monday to Sunday and not as a cycle. The positions are treated as distinct and each may be picked at most once. Reality adds more rules, such as preferences or capacities, and each one reduces the count. The result gives an upper limit on the schedules a nonadjacency rule allows.
Verifying with the calculator
The combination calculator is used twice in the cases: once for the mapped selection, 5 choose 3, and once for the unrestricted comparison, 7 choose 3. The two outputs, 10 and 35, bracket the answer for the original problem. The mapped value is the valid count, and the larger value is the count when adjacency is ignored. Treat the comparison as context: seeing 10 beside 35 shows that the rule removes more than two thirds of the options for these numbers. The basic calculator gives 35 minus 10 as 25, the number of selections with at least one touching pair. Those 25 can be split further by how many pairs touch, but the page only needs the total, which serves as a cross-check on the 10. Both calculations use unordered selections, because choosing positions 1, 3, 5 is the same selection however you name them.
Assumptions to keep in view
The method assumes a straight line of distinct positions, no position chosen twice, and a plain adjacency rule where neighbors differ by exactly one place. A rule requiring larger gaps, such as at least two empty positions between choices, uses a larger shift: remove two forced gaps per pair and count n minus 2 times k minus 1 positions choose k. It also treats the final selection as unordered. If the three chosen positions get distinct roles, multiply by 3 factorial after counting. For the seven-position example that gives 10 times 6, or 60 role assignments. The shift and the multiplication are separate steps and should be recorded separately, so that a change to either the row length or the role rule is easy to apply later.
Reproduce the checks
Mapped shorter-range selection
Open the Combination calculator and enter:
- Total items n
5- Items selected r
3
Expected output:
Combinations
10Removing two mandatory gaps gives five effective positions.
Unrestricted comparison
Open the Combination calculator and enter:
- Total items n
7- Items selected r
3
Expected output:
Combinations
35The larger count includes adjacent choices.
References and implementation scope
The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.