Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Worksheets related to Applied Discrete Structures

Views: 15771
Image: ubuntu2004
Kernel: SageMath (stable)
import random
dir(random)
['BPF', 'LOG4', 'NV_MAGICCONST', 'RECIP_BPF', 'Random', 'SG_MAGICCONST', 'SystemRandom', 'TWOPI', 'WichmannHill', '_BuiltinMethodType', '_MethodType', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_acos', '_ceil', '_cos', '_e', '_exp', '_hashlib', '_hexlify', '_inst', '_log', '_pi', '_random', '_sin', '_sqrt', '_test', '_test_generator', '_urandom', '_warn', 'betavariate', 'choice', 'division', 'expovariate', 'gammavariate', 'gauss', 'getrandbits', 'getstate', 'jumpahead', 'lognormvariate', 'normalvariate', 'paretovariate', 'randint', 'random', 'randrange', 'sample', 'seed', 'setstate', 'shuffle', 'triangular', 'uniform', 'vonmisesvariate', 'weibullvariate']
random.sample(d)
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-7-9125a8a13cd4> in <module>() ----> 1 random.sample(d) TypeError: sample() takes exactly 3 arguments (2 given)
y=(1-x)/(1-X-x^2)
taylor(y,x,0,10)
34*x^10 + 21*x^9 + 13*x^8 + 8*x^7 + 5*x^6 + 3*x^5 + 2*x^4 + x^3 + x^2 + 1