### Related

##### make_random_state-set_random_state

s1: make_random_state...

set_random_state (s1);

licznik:random(100);

Calculate

##### make_random_state-set_random_state-true

s1:make_random_state ...

set_random_state (s1);

Ko:(random(10)+11)*100;

Calculate

##### make_random_state-set_random_state

set_random_state (mak...

random (10^9);

Calculate

##### make_random_state-makelist

s1: make_random_state...

clc%makelist(random(5...

Calculate

##### make_random_state-set_random_state

set_random_state (mak...

random (10^9);

Calculate

##### make_random_state

? make_random_state;

Calculate

##### make_random_state

s1: make_random_state...

clear;

Calculate

##### make_random_state

licznik: make_random_...

mianownik:random(5);

Calculate

##### make_random_state-set_random_state-true

s1:make_random_state ...

set_random_state (s1);

Ko:(random(10)+11)*100;

Calculate

##### make_random_state-makelist

s1: make_random_state...

clc%makelist(random(5...

Calculate

### make_random_state

Run Example
```(%i1)make_random_state(true);
(%o1) #S(RANDOM-STATE STATE
#(0 2567483615 624 3738411843 2728175681 3685694833 975388669
1225892821 795743913 2335072691 325796828 3148251604 4177969015
139107534 1694243665 1095014044 3472126206 1238563039
2105343397 2240337348 1238191407 2156859704 960484853
4116874941 1630328587 1863004424 4024904100 4077833723
316209905 377289263 1819990950 26609663 3060899512 2547722624
758903401 3661616269 4224768551 1159681110 199218550 382033330
1121991007 2596007996 1500051101 10930100 3902283309 1735165520
3119077152 4070478486 1930727926 2600191393 227423358 178529254
222445551 1122181245 593636639 3485099119 54225617 710016427
2798032814 3375948564 3197757260 3399680000 1902484586
2293823859 1821303506 2206689405 3402707290 3714062685
504320087 4100604309 1579099761 451680884 2725938185 3947690909
2438517661 3198457091 3383972526 3384357771 2069699827
1658318278 31542992 952199262 1740274533 1213674180 3019207946
4004541562 3577853200 1146657747 1024908335 790824417
1813887772 3936901065 1240186123 3044142924 36055073 1231978081
249117757 2124179823 4062410437 1240978046 602211196 547077198
1129908521 1478427948 2117935142 3647180489 725053465
1418435397 501309 1655061371 4190093709 1511938930 3507462092
2321077273 1330323990 545505923 3970488608 1858496065
2898171827 4164325961 1507283367 4029615348 2134985962
1700404271 1659092127 3021732048 1827638613 2054207136
2325427970 1084994430 3813001370 185664989 3739588018
2441529431 3786770188 927879279 3254395728 1608276805
3986908763 530872640 3515291337 3439597628 1364215910
2050797615 3984335027 1145509374 684336426 30024738 923038715
649074073 2721474288 86777870 1878139931 3029346520 2024982681
3893001360 2496844184 1015946332 2277666023 842957813
1056648518 155013948 224457547 1954553911 826514415 3047714029
2621956590 3719786176 4009365140 882348345 3776105764
3963998219 2752994257 3290441193 1449078781 2753547032
1240599535 1885541268 3248781176 2452682551 1041818 3344629876
2439503526 983341928 248248509 2277591111 349270256 2728525672
2407497611 558670535 2378807358 1037159528 553733573 4102364279
1810517635 4110584842 2805010766 3249635262 2727250772
2183659442 4285337909 1689760020 3184532240 2534756578
3117467945 2939445697 407956922 3745273134 2896015502
1636144138 2788838438 213602052 474698085 1309223595 2484654053
3630015991 4100853273 2947382040 2080930841 4268346960
2808992408 2386461084 3310924337 1253642390 2902809456
3106608856 3039866593 369195887 2913802924 1263838600
1471848688 2405005561 2733117164 1175274188 194384072
3064440784 4155676867 2054489258 878140258 1041006742
4158194203 426028134 2747570989 3857080699 1213574473
2155931226 445118891 871302251 2845245996 805337884 1607896835
1664908994 1107910376 4124845031 4199230959 3434113816
2091431332 189265943 1942630674 1049462911 3143356956
1971188952 11058080 811247396 1496462905 727407902 867355613
3819877433 3086362091 2747639543 1342635188 2498859381
946344960 2143544590 3578226426 940958285 2195226226 807654210
3372133405 4083676906 3079019522 4041542934 3589367648
809944615 3406302588 1541360437 3166929055 3644900365
2749028515 2611782051 620883620 1492446164 2041121066
3653607961 359587685 2181968125 3536506048 2397840661
2057630266 743581039 1283075316 620092115 652165482 1375504894
3631540680 4291486021 780359629 2255051281 3813258672
2587261905 1720174194 233428883 2326051124 2996107652
2298030357 887850571 1003954128 1519771210 2837698514
2421323340 905604099 2276407661 3018264842 2038366568
1018937518 485630952 3692516299 4219606828 1325682128
3339619771 3533529823 3590569492 1456820060 3509327355
1475240995 1502721206 1966292096 3156142387 3478403748
3996091443 1137498177 1229689490 1648787538 113380627
3809694932 4108880169 2303432937 4061534479 359878421 828600739
2474709418 2683756708 1730771163 721377632 2402460735
3532288625 1627138651 1453121764 3800189116 2811095999
1011951606 438397812 299661867 2223650655 28548634 372198316
2983979079 1358074277 3944758049 4182411224 1478020566
1557284419 3931966331 841007050 3289695781 3980821618
2764684042 1978012574 1100928562 1135660695 1097451687
4020699384 3611735938 933326945 1450983618 2801985901
2837152074 1493273320 156336238 904170216 1037629195 3894107099
3654931901 2256929660 187682877 1845022361 1340136321
3652066058 2540141848 2172470990 551820297 2638144027
1803392620 3070734225 604172688 593452898 4065989949 2409271562
3067118013 3588974833 1470622481 2675658472 3376897515
197211682 3693121285 3062670586 1821233013 1411640930
3044346286 219012732 4159513741 2701224872 4057167285
2456148082 1846695381 100029002 2755531481 3968967951
3659369317 3037435624 2042349053 1038940696 922584357
2655606343 704444392 2563831864 1625225875 4262395724
2444559070 1056300672 2157136437 3360995433 587431305
3914193349 833348311 2098630541 1770819575 2503570378 689485733
311083735 2598694802 3983971728 1088008128 1329045991
2078340993 146089796 609739673 615034403 1118990486 2529705051
3619320294 2630188579 3914427856 2779463947 2510125914
3448488838 1483297352 1251314077 115853405 2050413443 794822173
2062741573 3326685353 1922117352 2042705092 4225384593
2242354547 1752799343 3717071681 1469291750 1250265088 8270659
1712199246 3181909515 760906862 1553407816 240937648 1247693140
2848222574 2801924482 3301765479 465945180 3935104053 830216504
1073540355 1488264987 3201315119 112164271 3511172858 203565
1694486450 4042833553 4263334797 606795514 2079669399 356986660
4148944683 628323520 3242709433 3836234332 1657483382
1046138863 3064197704 2740859696 1542321849 4243771544
3584836136 1871454201 2133612251 1055846406 3403803235
3660503526 3092940384 844069042 3318735427 2061010250
2681125794 1347987500 3124064462 906407562 3788552321
2913230682 877115337 3559200095 4036209503 1887099232
4235439706 3529534515 3477102855 2406313132 2249654463
4154683819 652656995 3829221675 3094103781 419076673 2603787972
1839580222 3928303100 3757471421 2834991385 3790900427
1045075213 210486599 413718058 2824796858 3165480129 1084890649
2145434019 577696022 3563316699 2857519206 1710232995
2730114330 2849240233 1128008873 3792627835 630321548
2544646769 526359701 2945943040 3750556418 2980997790 723619270
1636165465 2517262324 657228875 2305382101 2850640914
4084907152 3931902784 2272753329 596419042 239850094 1619584427
1485871192 151174756 1790223292 4212113626 1297758439
1666550537 626992244 2553772049 162106573 3789112368 3248239983
19653101 464714195 2383642002 2865929252 1739715411 1672078256
582455340 1875341236 1047130562 3329963492 734389630 2606103314
3921125293 1067982852 2794637299 1753210229 2787210533
452336069 658872860 3300051824 1569706436 3110285855 3569306840
3449259983 4211655141 260216872 185299507 520510347 3377234756
3898723441 3021778281))
(%i2) ```
Run Example
```build_info();

Maxima version: 5.21.1
Maxima build date: 7:25 9/18/2010
Host type: x86_64-unknown-linux-gnu
Lisp implementation type: GNU Common Lisp (GCL)
Lisp implementation version: GCL 2.6.7

(%o1)
(%i2) /* compute angles for intrinsic Tait-Bryan angles * on axes y-z'-x'', conventionally named pitch, yaw, and roll * (following terminology on Wikipedia page for "Euler angles") * via method expounded by G. Slabaugh: * http://www.staff.city.ac.uk/~sbbh653/publications/euler.pdf * * Argument R is a 3x3 rotation matrix. * Return value is a list of two triples, [[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]], * because there are always two solutions. */intrinsic_yzx (R) :=  if equal (R[2, 1], 1) or equal (R[2, 1], -1)    then intrinsic_yzx_yaw_pi2 (R)    else block ([pitch1, pitch2, yaw1, yaw2, roll1, roll2],      yaw1 : asin (R[2, 1]),       yaw2 : %pi - yaw1,      pitch1 : atan2 (-R[3, 1]/cos(yaw1), R[1, 1]/cos(yaw1)),      pitch2 : atan2 (-R[3, 1]/cos(yaw2), R[1, 1]/cos(yaw2)),      roll1 : atan2 (-R[2, 3]/cos(yaw1), R[2, 2]/cos(yaw1)),      roll2 : atan2 (-R[2, 3]/cos(yaw2), R[2, 2]/cos(yaw2)),      [[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]]);
(%o2) intrinsic_yzx(R) := if equal(R    , 1) or equal(R    , - 1)
2, 1               2, 1
then intrinsic_yzx_yaw_pi2(R) else block([pitch1, pitch2, yaw1, yaw2, roll1,
roll2], yaw1 : asin(R    ), yaw2 : %pi - yaw1,
2, 1
- R         R                         - R         R
3, 1      1, 1                        3, 1      1, 1
pitch1 : atan2(---------, ---------), pitch2 : atan2(---------, ---------),
cos(yaw1)  cos(yaw1)                  cos(yaw2)  cos(yaw2)
- R         R                        - R         R
2, 3      2, 2                       2, 3      2, 2
roll1 : atan2(---------, ---------), roll2 : atan2(---------, ---------),
cos(yaw1)  cos(yaw1)                 cos(yaw2)  cos(yaw2)
[[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]])
(%i3) intrinsic_yzx_yaw_pi2 (R) :=  block ([pitch1, pitch2, yaw1, yaw2, roll1, roll2],    yaw1 : %pi/2,    roll1 : 0, /* could be anything */    pitch1 : -roll1 + atan2 (R[3, 2], R[3, 3]),    yaw2 : -%pi/2,    roll2 : 0, /* could be anything */    pitch2 : roll2 + atan2 (R[1, 3], R[1, 2]),    [[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]]);
(%o3) intrinsic_yzx_yaw_pi2(R) := block([pitch1, pitch2, yaw1, yaw2, roll1,
%pi
roll2], yaw1 : ---, roll1 : 0, pitch1 : - roll1 + atan2(R    , R    ),
2                                        3, 2   3, 3
- %pi
yaw2 : -----, roll2 : 0, pitch2 : roll2 + atan2(R    , R    ),
2                                       1, 3   1, 2
[[pitch1, yaw1, roll1], [pitch2, yaw2, roll2]])
(%i4) set_random_state (make_random_state (1));
(%o4)                                done
(%i5) random_3d_unit () := (random_3d (), %%/norm(%%));
%%
(%o5)             random_3d_unit() := (random_3d(), --------)
norm(%%)
(%i6) random_3d () := makelist (random (10), i, 1, 3);
(%o6)            random_3d() := makelist(random(10), i, 1, 3)
(%i7) norm (v) := sqrt (lsum (x^2, x, v));
2
(%o7)                   norm(v) := sqrt(lsum(x , x, v))
(%i8) u : random_3d_unit ();
5          9          4
(%o8)                  [---------, ---------, ---------]
sqrt(122)  sqrt(122)  sqrt(122)
(%i9) v : random_3d_unit ();
8         3         3
(%o9)                   [--------, --------, --------]
sqrt(82)  sqrt(82)  sqrt(82)
(%i10) R(a,b):= block ([v, s, c], v:cross(a,b), s:norm(v), c:dot(a,b), ident(length(a)) + ssc(v) + (ssc(v).ssc(v))*(1 - c)/s^2, ratsimp(%%));
(%o10) R(a, b) := block([v, s, c], v : cross(a, b), s : norm(v),
(ssc(v) . ssc(v)) (1 - c)
c : dot(a, b), ident(length(a)) + ssc(v) + -------------------------,
2
s
ratsimp(%%))
(%i11) cross(a,b) := [a[2]*b[3]-b[2]*a[3], -(a[1]*b[3]-b[1]*a[3]), a[1]*b[2]-b[1]*a[2]];
(%o11) cross(a, b) := [a  b  - b  a , - (a  b  - b  a ), a  b  - b  a ]
2  3    2  3      1  3    1  3    1  2    1  2
(%i12) norm(v):= sqrt(v[1]^2 + v[2]^2 + v[3]^2);
2    2    2
(%o12)                   norm(v) := sqrt(v  + v  + v )
1    2    3
(%i13) dot(a,b):= a[1]*b[1]+a[2]*b[2]+a[3]*b[3];
(%o13)                dot(a, b) := a  b  + a  b  + a  b
1  1    2  2    3  3
(%i14) ssc(v) := matrix ([0, -v[3], v[2]], [v[3], 0, -v[1]], [-v[2], v[1], 0]);
(%o14)   ssc(v) := matrix([0, - v , v ], [v , 0, - v ], [- v , v , 0])
3   2     3        1       2   1
(%i15) Ruv : float (R (u, v));
[  0.80240796270139   0.58412740488141   0.12221553199131  ]
[                                                          ]
(%o15)   [ - 0.5556446634958   0.80598226750272  - 0.20408721762966 ]
[                                                          ]
[ - 0.21771648840189  0.09585280036434   0.97129386456431  ]
(%i16) intrinsic_yzx (Ruv);

rat: replaced -1.5556446634958 by -7758/4987 = -1.55564467615801

rat: replaced 0.4443553365042 by 4987/11223 = 0.44435534170899
(%o16) [[0.26495004690786, - 0.58913814199809, 0.24800273610235],
[- 2.876642606681936, %pi + 0.58913814199809, - 2.89358991748744]]
(%i17) ```
Run Example
```random(6);
(%o1)                                  2
(%i2) make_random_state(true);
(%o2) #S(RANDOM-STATE STATE
#(0 2567483615 624 3629429270 1732935498 3180354457 4030142250
792728625 678244442 2892643720 3349094777 1292402474 2392141568
940678612 1295366319 2865298098 172169085 1416964447 3471745061
3236136206 4216484658 428059495 2877144758 446075160 682956429
308173495 1824962890 4171054511 2076074229 1252709470
3282411670 324736997 2784819830 2818761698 2419509119
1724488049 3803609425 36224892 888203279 2074383631 3608497323
973416046 446367629 655323081 2255006582 2872621294 2261467463
3640765797 1228865387 1349549824 3579880596 458669763
2963578400 1954583964 437718052 630394472 3398588221 3340671404
4145695042 4216958941 2693935311 1734735387 245629565
1500831885 186352505 3213205499 2116247164 49294481 345124470
1707309776 1250971064 3499469633 3934315343 3314637122
2548236268 3473364782 4190599690 1849751255 1267984569
4125968612 1962041968 929452003 2404581342 3316624924
3646376332 3434515645 1988703561 110988732 489064321 1061060411
3294348702 943782985 2862979622 1506743438 614245318 1205572474
3354067684 748078209 304844868 490753844 254677989 3440797371
1440153339 1562141446 2523058472 2802974712 65849353 2276900085
3036265692 3735835136 2482304666 1438949988 507453254 428723468
2734772779 2409388957 3943775532 2010401533 1069969887
2371109999 3050853494 3266799162 3483293172 4159478251
2215502081 4059652521 1347256973 3410324920 1044012612
223712594 3169504217 649568487 1709120164 3972714651 3385697403
3396213724 2708756096 717206480 529285527 9482267 3692097072
3918284201 3578099357 926178018 2692271543 4054975991
3122130387 3865881861 1419934191 349993336 709174507 3564524619
3552692477 3874896588 3561421634 121498173 561188778 3949799596
1033876646 3224968218 3074455418 2963692278 620394211
2762302255 697185890 1424222028 1137538820 300196509 411381142
2030715604 4003683248 2557147463 1316832738 2936540729
2775068914 2598092636 2511195843 612293587 1349887470 297819899
1888931000 3290220207 3294654095 721979888 2445270117
2826310745 2583149470 1130856772 2699488754 3523301482
225176360 1518612356 3694652726 2826236839 1376415192
2144696413 3341138189 3108798792 3445988597 2094044114
3962256900 4151457929 2216175929 271964175 1917273524
2120179251 2422664325 2027983119 3181099347 1641248451
3662261593 1112313682 271382416 4146707618 3989869912
3971326139 2612191597 641751201 3744997724 412746323 877024920
3258942162 1606907472 4030334929 2748479671 3985997127
3638546611 1271629392 2858702806 3278052230 4235659612
2761132639 3888929942 893338799 2457911538 983338904 4123328481
3134646036 1376645785 2558267108 4248106923 3825638966
817481944 1135597096 4112150558 641253731 2174175234 238512372
296942905 3182455155 3441300364 3795730275 3457769945
2320975356 1523944497 865468396 798442777 710386907 2177515110
1424630388 436418090 778492308 3155168359 3149525469 1139131648
2400928619 817089140 3883070668 3674627508 2511006013
2012855782 2709097519 2452841422 4181888138 2553660444
3623644902 4063448682 1947410815 451585481 2244672097 97043748
1303514186 3923770798 266054489 197934134 1632020584 400532360
4067904964 2518822816 745045512 1122239047 18242750 379995671
2310862645 1851455702 3136306423 1478109902 1122282449
920263223 1200932827 1268548651 3969949628 1125465734
2139679599 1862582675 997556680 1145584919 2362106078 342127613
3047106819 1606662040 380064145 3785410666 3599647651 565268311
231398795 3026570256 3537708628 1260761230 4181995687
1516959217 3814750446 2688650176 4160026314 2000023438
3328445357 2306521833 736133883 4001956172 3404319857
3687099457 2190821714 710000089 768084199 3472892782 2986233933
3631806328 3431430101 3211644605 2234501547 3999597054
3855953699 2368977139 502788457 1759670466 3909343557
1991585781 198279324 465517285 2168048307 538751536 637402700
3999269209 1846522848 2862375460 3074625630 1941615021
4252051006 1388690548 4245747853 2694319979 1948010195
2026656833 1332969128 3925371670 165903795 2565497866
3761881236 1459276800 2284193491 1818069732 947870409
3109249982 3362387614 3239268964 948544279 540387464 1746159390
4025001906 1784603469 103242357 1377980067 1108064613
2526194160 2725089271 49736231 701120994 3745247658 244894254
1975280552 1246217264 3215303129 284430316 1279497634 489899478
645141750 2780687511 1537021267 1654672613 4238367616
1087518524 1361736095 2145280741 1508182404 1746399242
355768553 4260628096 978824771 4172193028 3458053209 498225945
4152503157 1205292327 3024406424 1529490269 2287687912
3573895151 2723272122 1303431991 2583303150 2949065149
2804134141 1975930174 1196175999 1904696155 2982164008
821549625 4179663653 49188263 628966285 678239564 885931176
3161184245 685794593 3868037300 3779922147 3678691857
1626625228 3479317396 1076888391 2744894035 1671955627
342807241 3993353221 2785830423 3424158979 1205435067
2391865118 1697872841 1023795110 1569395773 861346156 535549277
3737449587 966025715 1369092515 780519599 1140250065 2172562647
2001415889 1416022489 4084874242 2304587568 2930674310
3432598497 759489528 2515905191 3905004009 2574327075
3390974167 1871417719 1965198178 1190001380 3479931695
3239867955 3872019144 1001279216 1016305290 932200525
1550685501 2159869577 2291519925 5746194 1765626106 1885620200
1164644815 342312489 2288623889 3294935396 3905308297 398438489
1383020037 870610301 2926395707 496057960 4186654964 817953376
3670026702 3301586128 1339081775 4221306391 1583029206
1924730054 2554956663 2631443486 504347906 1265214913
3533842104 3553647808 3761108457 2082619725 663318776
3715517397 152793964 9263003 2766308647 2258785946 2089518074
1284073226 799509595 2981369068 1975624172 2122824072
1821738517 4132084717 3294881008 3079954666 1539204500
3113079510 1318298546 12542638 3524464310 3612781690 449695439
2995282110 1622591552 3742289082 2440349715 2258307532
1074536030 2845955220 2679580488 1380916301 2775504920
1998007903 1351064372 4060257032 3243053175 3831600101
1710191072 1687181544 2800142097 3474634660 2070140425
1445313359 893494766 372561679 1062789653 2577494388 3835947962
1809908522 883246373 3073906376 618207714 3316591195 70045418
13557381 945158573 205789302 3140406980 361335893 3450920129
2922966211 409973599 1722326454 1089350255 2746064291
3091291075 2586476132 221410942 2613325815 499387115 412947450
3380588006 816982686 1634427036 3327927608 2061780367
1948938575 2357425168 2373480293 3287487727 2274201449
1283906181 96525411 1170010207 3669960039 3458746054 4012268300
2990929471 1040960870 1901961620 477921056 3607513592 485459296
3196059962 1370453363 1848728150 254948784 2505728206 614107
57844167 356406500 1061258326 3942989393 3551099582 1270322166
1566413273 98509983 3489369123 18574089 3579317751 2631997359
4231327405 3277802259 3778293694 3511549184))
(%i3) random(6);
(%o3)                                  0
(%i4) random(6);
(%o4)                                  2
(%i5) ```

### Related Help

Help for Make_random_state