# fixed Help with gen-tendency

## Recommended Posts

Hi,

I am having difficulty understanding this new function. When I read the starting statement "The GEN-TENDENCY function generates N samples of given values (floating  numbers)..." I thought, the function will generate N samples from the given list, but it does not do that! It does not directly generate from the "given values". Perhaps it will be of help if the explanation can be elaborated a bit more. For example, what does this do?

(gen-tendency 2 '(0.9 0.1 0.7 0.9))

On my system, it gives => (0.917174 0.100803904)

I immediately thought it will generate two values closest to what is in the given list, but the following proved me wrong.

(gen-tendency 4 '(0.9 0.1 0.7 0.9)) => (0.90942806 0.09511808 0.09851663 0.68883634)

Can you explain the behaviour in greater detail? As a beginner, I am not able to relate the generated output with "tendency" argument.

Regards,

Rangarajan

##### Share on other sites

Quote

(gen-tendency 2 '(0.9 0.1 0.7 0.9))

This is correct. With 2 you get the first two values with the fluctuation of the variance.

Quote
Quote

(gen-tendency 4 '(0.9 0.1 0.7 0.9)) => (0.90942806 0.09511808 0.09851663 0.68883634)

This is a bug and will be fixed in the next update.

##### Share on other sites

Hi,

Are you saying that N should be greater than the size of the tendency list (arg)? What is the rationale? Secondly, with the keyword :list t option, the result is grouped into 3 element sets. What is this grouping?

Regards,

Rangarajan

##### Share on other sites

Version 1.1.18269 fixed the bug.

```(gen-tendency 4 '(0.1 0.4 0.1 0.6 0.45 0.16 0.75 0.8 1.0 0.01))
=> (0.104359165 0.39429432 0.100798346 0.62476647)```

The keyword :list t

```(gen-tendency 200 '(.1 .4 .1 .6 .45 .16 .75 .8 .3 .1 .3) :list t)
=> ((0.099984944 0.11387764 0.12642343 0.15168415 0.16709633 0.17213513 0.20150061 0.20113012 0.22009951 0.24273156 0.24970572 0.26174247 0.29066756 0.2949897 0.3182366 0.32001048 0.36540088 0.38404274 0.37335125 0.395081) (0.40168363 0.4027923 0.3534013 0.36953956 0.33620408 0.32654497 0.31987086 0.2750282 0.26821807 0.25287652 0.2305816 0.23579317 0.21963972 0.19107936 0.17604227 0.16835307 0.14399202 0.13120309 0.12043448 0.10099858) (0.104623474 0.12658577 0.15724719 0.18591632 0.20704637 0.22502314 0.26414487 0.27049297 0.3242868 0.34762508 0.37690502 0.38912776 0.43080842 0.44741648 0.4646992 0.47246978 0.5189676 0.5399884 0.5959707 0.59006417) (0.59877604 0.60479724 0.59807795 0.5648324 0.5628536 0.57000697 0.56562454 0.5500809 0.53328985 0.5401389 0.5340367 0.4983033 0.4960597 0.4741703 0.47969928 0.4706994 0.46525732 0.483455 0.46858826 0.4471839) (0.4514977 0.4515268 0.42210388 0.38424483 0.37056237 0.35909954 0.34682003 0.3376925 0.3404684 0.3257542 0.2869065 0.29342115 0.27931863 0.2496801 0.2260354 0.22754745 0.21243395 0.18543491 0.17326142 0.16407411) (0.16382262 0.19071864 0.22944735 0.2538253 0.2846997 0.30921304 0.33887538 0.3880936 0.4071452 0.42525348 0.49097368 0.478957 0.5473903 0.5486322 0.61640805 0.65693796 0.65814406 0.6791474 0.68797225 0.7805864) (0.7649956 0.7267248 0.7757771 0.78305274 0.78292584 0.7920915 0.7688278 0.7739545 0.74275744 0.80063826 0.8047114 0.77123123 0.7454085 0.821381 0.8253731 0.78862077 0.76019764 0.8322831 0.8030416 0.80841434) (0.8009649 0.8081998 0.7778132 0.68643016 0.6752312 0.6505827 0.64000016 0.6219439 0.5883376 0.5374011 0.53596956 0.5195632 0.48053336 0.46700454 0.45202953 0.38633415 0.38672185 0.36435723 0.3319517 0.3003397) (0.31268612 0.29726848 0.26501524 0.27600855 0.259484 0.25435746 0.2297746 0.21695139 0.21359655 0.20274277 0.18695429 0.18331508 0.16981517 0.15769583 0.15289773 0.14061573 0.13783191 0.12532899 0.10563707 0.09527511) (0.10104806 0.109473445 0.12113774 0.13803397 0.14912757 0.15490127 0.16247588 0.175438 0.175498 0.2026452 0.19566765 0.20675719 0.23508456 0.23689798 0.24815793 0.26074827 0.27547508 0.2826829 0.2997529 0.29699332))
```

List size:

```(mapcar #'length (gen-tendency 200 '(.1 .4 .1 .6 .45 .16 .75 .8 .3 .1 .3) :list t))
=> (20 20 20 20 20 20 20 20 20 20)```

Each given value will generate a list of 20 tendency's values.

```N: = 200
values: (-1 11) = 10
(/ 200 10) = 20```

I hope this clarifies the keyword :list t

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
• #### Browser

• Video Gallery

• Lessons