Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This returns such a random vector of a given size. However, note that its elements belong to the semi-open interval $\left[0~1\right)\subset\mathbb{R}$, not the closed interval $\left[0~1\right]\subset\mathbb{R}$ :

sage: def randvect(size=4):return vector([random() for t in range(size)])
sage: randvect(3)
(0.8688082291795581, 0.28209569121849476, 0.3112164215493163)

HTH,