sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.32k stars 453 forks source link

Wrong behaviour when `existence=True` for `incomplete_orthogonal_array` and `difference_family` #20919

Open eviatarbach opened 8 years ago

eviatarbach commented 8 years ago

The docstring for designs.incomplete_orthogonal_array claims that if existence=True, the function will return a boolean or Unknown. However, for certain values, it returns the array.

For example,

sage: type(designs.incomplete_orthogonal_array(9,82,[9],existence=True))
<type 'list'>

I encountered this while working on something else, and I have no idea of the math behind this, but it seems to be incorrect. The problem seems to be in the block starting at line 1371 in orthogonal_arrays.py ("From a quasi-difference matrix"); all other branches in the function take into account whether existence is set, but this one does not.

Similarly,

sage: type(designs.difference_family(3, 2, 1, existence=True)[0])
<class 'sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic_with_category'>

CC: @videlec

Component: combinatorial designs

Keywords: days78

Issue created by migration from https://trac.sagemath.org/ticket/20919

eviatarbach commented 8 years ago
comment:1

Similar problem with designs.difference_family(3, 2, 1, existence=True)

eviatarbach commented 8 years ago

Description changed:

--- 
+++ 
@@ -1,4 +1,4 @@
-The docstring for `designs.incomplete_orthogocal_array` claims that if `existence=True`, the function will return a boolean or `Unknown`. However, for certain values, it returns the array.
+The docstring for `designs.incomplete_orthogonal_array` claims that if `existence=True`, the function will return a boolean or `Unknown`. However, for certain values, it returns the array.

 For example,
eviatarbach commented 8 years ago

Description changed:

--- 
+++ 
@@ -8,3 +8,10 @@

I encountered this while working on something else, and I have no idea of the math behind this, but it seems to be incorrect. The problem seems to be in the block starting at line 1371 in orthogonal_arrays.py ("From a quasi-difference matrix"); all other branches in the function take into account whether existence is set, but this one does not. + +Similarly, + + +sage: type(designs.difference_family(3, 2, 1, existence=True)[0]) +<class 'sage.rings.finite_rings.integer_mod_ring.IntegerModRing_generic_with_category'> +