Project

General

Profile

Design #1067

"Randomize" and "Randomized" obsolete?

Added by John Abbott almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
CoCoA-4 function to be added
Target version:
Start date:
14 May 2017
Due date:
% Done:

100%

Estimated time:
1.55 h
Spent time:

Description

While looking through the CoCoA-5 on-line manual, I noticed that there are references to Randomize and Randomized.
These CoCoA-4 functions have not been ported to CoCoA-5; should we do so, or should we regard them as obsolete?

My preference is to regard them obsolete.


Related issues

Related to CoCoA-5 - Feature #1122: New fn: RandomLinearFormClosed2017-11-15

History

#1 Updated by John Abbott almost 7 years ago

  • Project changed from CoCoALib to CoCoA-5
  • Category deleted (Various)
  • Status changed from New to In Progress
  • Target version deleted (CoCoALib-1.0)
  • % Done changed from 0 to 10

The old CoCoA-4 function Randomize(F) is essentially equivalent to:

sum([random(-CoeffMax, CoeffMax)*t | t in support(F)]);

where CoeffMax is some value (perhaps 2^31?). The vagueness about the value of CoeffMax is one reason I prefer to make these fns obsolete.

Randomize(F) is the same as F := Randomized(F);

If we do decide to make them obsolete then any "see also" references in the manual should be removed.

We could also use my implementations above to define them in obsolescent.cpkg5.

Comments? Other ideas?

#2 Updated by Anna Maria Bigatti almost 7 years ago

  • Target version set to CoCoA-5.2.2

I sometimes miss old Randomized.
I suggest implementing it, but with explicit range: randomized(f, 100); randomizes in the range -100..100.
and maybe also randomized(f, 100, 200); in the range 100..200.

(should work for polynomials and for matrices?)

#3 Updated by John Abbott almost 7 years ago

  • Category set to CoCoA-4 function to be added

I thought Randomize in CoCoA-4 would work only for polynomials (and integers). Did it also work for matrices?

KISS: I do not like Randomize(f, 100,200) and find it hard to imagine when it could be useful.

If we do keep Randomize but with a different interface then the old is still obsolete/obsolescent.

#4 Updated by Anna Maria Bigatti almost 7 years ago

L := DensePoly(P,1); randomized(L, -100,100); is a nice way to make lots of random linear forms.

#5 Updated by John Abbott almost 7 years ago

We could create: RandomLinearForm(P,100) or even RandomLinearForm(P) if coeff ring is finite field.

#6 Updated by Anna Maria Bigatti almost 7 years ago

  • % Done changed from 10 to 50

ok, you convinced me: let's declare Randomize(d) obsolete, and make (in case) explicit functions for random things.

#7 Updated by John Abbott almost 7 years ago

OK, I'll do it and check in tomorrow -- too busy today.

#8 Updated by John Abbott almost 7 years ago

There is also an undocumented fn called Rand in misc.cpkg5.
Should it be made obsolete? Or simply eliminated?

NOTE I should have checked before writing. There is also an exported fn called Rand in BackwardCompatible.cpkg5, and there may be a call to it in regularity.cpkg5. I can easily change the call into a call to random.

But what about BackwardCompatible.cpkg5? How does it differ from obsolescent.cpkg5?

#9 Updated by John Abbott almost 7 years ago

There is a commented out fn called RandomLinearForm in experimental.cpkg5.

#10 Updated by Anna Maria Bigatti almost 7 years ago

John Abbott wrote:

But what about BackwardCompatible.cpkg5? How does it differ from obsolescent.cpkg5?

Undecided, I suppose we can make it obsolescent and this point.

#11 Updated by Anna Maria Bigatti almost 7 years ago

John Abbott wrote:

There is a commented out fn called RandomLinearForm in experimental.cpkg5.

That's a kind of randomized, with huge coefficients. Good thing it is commented out ;-)

these are the "random" functions in cocoa-5:

--> All 8 matches for "rand":
 ? random
 ? randomize
 ? randomized
 ? RandomSubset
 ? RandomSubsetIndices
 ? RandomTuple
 ? RandomTupleIndices
 ? RandomUnimodularMat

I think we could also add RandomLinearForm(P, Lo, Hi)

#12 Updated by John Abbott almost 7 years ago

Why do you want to specify lo and hi for RandomLinearForm?
Is it not enough to specify a single value N and use the symmetric range from -N to N?

What about when the coeff ring has non-zero characteristic? Then it might make sense to allow no range?

#13 Updated by Anna Maria Bigatti almost 7 years ago

John Abbott wrote:

Why do you want to specify lo and hi for RandomLinearForm?
Is it not enough to specify a single value N and use the symmetric range from -N to N?

because it is more similar to random.

What about when the coeff ring has non-zero characteristic? Then it might make sense to allow no range?

well, KISS (nothing personal ;-)

#14 Updated by John Abbott over 6 years ago

#15 Updated by John Abbott over 6 years ago

  • Status changed from In Progress to Closed
  • Assignee set to John Abbott
  • % Done changed from 50 to 100
  • Estimated time set to 1.55 h

I shall close this issue, and create a new issue about creating RandomLinearForm.

Also available in: Atom PDF