Talk:Population count: Difference between revisions

added a vertical histogram (histograph) of the integers 0──►256.
(→‎task requirements change: added comments about popcount confusing.)
(added a vertical histogram (histograph) of the integers 0──►256.)
 
(One intermediate revision by the same user not shown)
Line 10:
 
I thought I'd seen a way of highlighting a draft task (the ''requirements'' in this case) in some manner.   If somebody could inform me how to do that (or change it directly), I would be obliged.   As this is a draft task, my attempt should suffice in the interim. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 14:16, 18 March 2014 (UTC)
 
I finally found it (a way to highlight a draft task that may new review by authors/programmers of the examples entered. &nbsp; It is: &nbsp; <nowiki>{{clarified-review}}</nowiki> &nbsp; &nbsp; &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 14:12, 24 March 2014 (UTC)
 
: Having written a few tasks in the past, I advise that you shouldn't get too prescriptive as to the nature of the output unless the producing of that output in that exact form is the ''sole'' reason for the task; it isn't here, since there's also the calculation of the Hamming weight itself. “Printing a list of numbers” isn't really very significant for most languages these days, after all. (Should we change the name of the task to reflect the wikipedia name for this sort of thing? “Population count” is more likely to be confused with something else.) –[[User:Dkf|Donal Fellows]] ([[User talk:Dkf|talk]]) 21:37, 19 March 2014 (UTC)
 
:: The form (list the numbers on one line as opposed to a vertical list) was asked for to more easily see the commonality of the three sets of outputs, thus, using a common format. &nbsp; Since it is trivial for most computer languages to show each set on a single line, I didn't think it was unreasonable to have that as a requirement. &nbsp; It wasn't the sole reason, but simply a matter of visual convenience. &nbsp; In the task, ''population count'' was described in the first sentence (and I'll make that even clearer forthwith), and should clearly identify the reference. &nbsp; ''Hamming weight'' has other uses, and for the binary case, it would be then equivalent to a ''popcount''. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:13, 19 March 2014 (UTC)
 
 
== a vertical histogram/histograph ==
 
The vertical histogram/histograph &nbsp; (shown below) &nbsp; illustrates the &nbsp; ''population count'' &nbsp; of the integers &nbsp; '''0&nbsp;──►&nbsp;256''':
 
(Shown at three-quarter size.)
<pre style="font-size:75%>
■ ■ ■ ■ ■ ■ ■■│
│ │ │ │ │ │ │││
│ │ │ │ │ │ │││
│ │ │ │ │ │ │││
│ │ │ │ │ │ │││
■ ■ ■ ■ ■ ■■│ ■ ■ ■ ■ ■■│ ■ ■ ■ ■■│ ■ ■ ■■│ ■ ■■│ ■■│■│││
│ │ │ │ │ │││ │ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││
│ │ │ │ │ │││ │ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││
│ │ │ │ │ │││ │ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││
│ │ │ │ │ │││ │ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││
■ ■ ■ ■ ■■│ ■ ■ ■ ■■│ ■ ■ ■■│ ■ ■■│ ■■│■│││ ■ ■ ■ ■■│ ■ ■ ■■│ ■ ■■│ ■■│■│││ ■ ■ ■■│ ■ ■■│ ■■│■│││ ■ ■■│ ■■│■│││ ■■│■│││■│││││││
│ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││
│ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││
│ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││
│ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││
│ │ │ │ │││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││
■ ■ ■ ■■│ ■ ■ ■■│ ■ ■■│ ■■│■│││ ■ ■ ■■│ ■ ■■│ ■■│■│││ ■ ■■│ ■■│■│││ ■■│■│││■│││││││ ■ ■ ■■│ ■ ■■│ ■■│■│││ ■ ■■│ ■■│■│││ ■■│■│││■│││││││ ■ ■■│ ■■│■│││ ■■│■│││■│││││││ ■■│■│││■│││││││■│││││││││││││││
│ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││
│ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││
│ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││
│ │ │ │││ │ │ │││ │ │││ │││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││
■ ■ ■■│ ■ ■■│ ■■│■│││ ■ ■■│ ■■│■│││ ■■│■│││■│││││││ ■ ■■│ ■■│■│││ ■■│■│││■│││││││ ■■│■│││■│││││││■│││││││││││││││ ■ ■■│ ■■│■│││ ■■│■│││■│││││││ ■■│■│││■│││││││■│││││││││││││││ ■■│■│││■│││││││■│││││││││││││││■│││││││││││││││││││││││││││││││
│ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
│ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
│ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
│ │ │││ │ │││ │││││││ │ │││ │││││││ │││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
■ ■■│ ■■│■│││ ■■│■│││■│││││││ ■■│■│││■│││││││■│││││││││││││││ ■■│■│││■│││││││■│││││││││││││││■│││││││││││││││││││││││││││││││ ■■│■│││■│││││││■│││││││││││││││■│││││││││││││││││││││││││││││││■│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
│ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
│ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
│ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
│ │││ │││││││ │││││││││││││││ │││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││ │││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
■■│■│││■│││││││■│││││││││││││││■│││││││││││││││││││││││││││││││■│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││■│││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││■
││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││││
─┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴┴
01121223122323341223233423343445122323342334344523343445344545561223233423343445233434453445455623343445344545563445455645565667122323342334344523343445344545562334344534454556344545564556566723343445344545563445455645565667344545564556566745565667566767781
</pre>