From 96c29d7c6d3477cfbcce6d3ca949da91445037e2 Mon Sep 17 00:00:00 2001 From: Dave Witte Morris Date: Tue, 15 Oct 2024 12:00:30 -0400 Subject: [PATCH 1/2] fix is_t_design --- src/sage/combinat/designs/incidence_structures.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sage/combinat/designs/incidence_structures.py b/src/sage/combinat/designs/incidence_structures.py index e9964af900c..e4875a231eb 100644 --- a/src/sage/combinat/designs/incidence_structures.py +++ b/src/sage/combinat/designs/incidence_structures.py @@ -1653,7 +1653,7 @@ def is_t_design(self, t=None, v=None, k=None, l=None, return_parameters=False): for i in combinations(block, tt): s[i] = s.get(i, 0) + 1 - if len(set(s.values())) != 1: + if (len(s) != binomial(v, tt)) or (len(set(s.values())) != 1): tt -= 1 break From f3d5c8dde3b605cdd1c66e9b73e7b3c02f865f6a Mon Sep 17 00:00:00 2001 From: Dave Witte Morris Date: Fri, 15 Nov 2024 21:20:54 -0500 Subject: [PATCH 2/2] add doctest --- src/sage/combinat/designs/incidence_structures.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/sage/combinat/designs/incidence_structures.py b/src/sage/combinat/designs/incidence_structures.py index e4875a231eb..3c6170e1ea3 100644 --- a/src/sage/combinat/designs/incidence_structures.py +++ b/src/sage/combinat/designs/incidence_structures.py @@ -1592,6 +1592,13 @@ def is_t_design(self, t=None, v=None, k=None, l=None, return_parameters=False): sage: I = IncidenceStructure(2, [[0],[0,1]]) sage: I.is_t_design(return_parameters=True) (False, (0, 0, 0, 0)) + + Verify that :issue:`38454` is fixed:: + + sage: I = IncidenceStructure(points=[0,1,2,3,4,5], + ....: blocks=[[0,1], [1,2], [0,2]]) + sage: I.is_t_design(return_parameters=True) + (True, (0, 6, 2, 3)) """ from sage.arith.misc import binomial