Skip to content

Commit 83d7435

Browse files
author
Release Manager
committed
gh-38973: is_t_design needs to verify that every t-tuple is in at least one block <!-- ^ Please provide a concise and informative title. --> <!-- ^ Don't put issue numbers in the title, do this in the PR description below. --> <!-- ^ For example, instead of "Fixes #12345" use "Introduce new method to calculate 1 + 2". --> <!-- v Describe your changes below in detail. --> <!-- v Why is this change required? What problem does it solve? --> <!-- v If this PR resolves an open issue, please link to it here. For example, "Fixes #12345". --> Fixes #38454. In a t-design, every t-tuple needs to be contained in the same number of blocks. The code for `is_t_design` did not verify this correctly, because it only checked the t-tuples that are contained in at least one block. We fix this by verifying that the number of t-tuples that appear in at least one block is equal to the total number of t-tuples. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [x] The title is concise and informative. - [x] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #38973 Reported by: DaveWitteMorris Reviewer(s): David Coudert
2 parents a8a6485 + da21ad7 commit 83d7435

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/sage/combinat/designs/incidence_structures.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,13 @@ def is_t_design(self, t=None, v=None, k=None, l=None, return_parameters=False):
15921592
sage: I = IncidenceStructure(2, [[0],[0,1]])
15931593
sage: I.is_t_design(return_parameters=True)
15941594
(False, (0, 0, 0, 0))
1595+
1596+
Verify that :issue:`38454` is fixed::
1597+
1598+
sage: I = IncidenceStructure(points=[0,1,2,3,4,5],
1599+
....: blocks=[[0,1], [1,2], [0,2]])
1600+
sage: I.is_t_design(return_parameters=True)
1601+
(True, (0, 6, 2, 3))
15951602
"""
15961603
from sage.arith.misc import binomial
15971604

@@ -1653,7 +1660,7 @@ def is_t_design(self, t=None, v=None, k=None, l=None, return_parameters=False):
16531660
for i in combinations(block, tt):
16541661
s[i] = s.get(i, 0) + 1
16551662

1656-
if len(set(s.values())) != 1:
1663+
if (len(s) != binomial(v, tt)) or (len(set(s.values())) != 1):
16571664
tt -= 1
16581665
break
16591666

0 commit comments

Comments
 (0)