<![CDATA[Random numbers with counting columns]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns
Sat, 27 Feb 2021 15:04:48 +0000Sat, 20 Feb 2021 14:30:28 +0000Zend_Feed<![CDATA[How's that to start? l1=Sequence(random(), i, 1, 500)
a=Length(KeepIf(x < 0.4, l1))
b=Length(KeepIf(x >= 0.4, l1))]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-298944
Sat, 20 Feb 2021 18:12:24 +0000<![CDATA[Thanks for the input! The command Keeplf is nice, but because of educational reasons (pedagogics), I want the columns not to show up instantly, but to 'grow up slowly' to the final height, maybe in about 3-5 seconds, if possible. Just like in an opinion poll ... Thanks, Erik.]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-298952
Sat, 20 Feb 2021 22:58:52 +0000<![CDATA[You could build a slider, n, that runs from 1 to 500, which can then be animated. If you create l2=first(l1, n), then refer a and b to l2 instead of l1, then a and b will "grow" as n increases in the animation. , this will]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-298956
Sat, 20 Feb 2021 23:47:55 +0000<![CDATA[or without registering the random() values try to move the blue dot]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-299012
Sun, 21 Feb 2021 13:07:45 +0000<![CDATA[Hi again It took me a while to absorb the information, but after having looked around on the GeoGebra homepage and testing things on my own, I finally made it work. I am totally new on scripting in GeoGebra and I was running my head against the brickwall more than once. Unfortunately some of the GeoGebra tutorials are old and have not been updated. For example I looked after an OK button in the Properties panel, as the tutorial said, but it was not there. I assume something have been updated, so one doesn't need that anymore. Also for a long time, I didn't know why the On Click scripting didn't work for me. I had to watch a YouTube video to find out, that pressing a button only works if one closes the Properties panel! After I closed it, it worked! I guess quite a few tutorials needs an update on the GeoGebra homepage - especially on the scripting side, it needs some documentation. Anyway, I am very pleased with what this program can do. It is for free and the graphics just look "delicious". The creators deserve a lot of credit!! In my attached GeoGebra file, I am using a combination of Borcherds and pirsquared ideas. I have a few questions: a) I will be delighted if you could please tell me if I am doing it in the most appropriate way or it can be simplified? Especially in the On Click scripting associated with the button "Sample". b) I am using a polygon Tool for the column. Assume I had to do with several columns for many parties in an Opinion Poll. Is there a more appropriate way to create the columns in this respect? c) Is there a way to control the Viewing area? I know scrolling and using Ctrl keys will zoom in or out, but I would like to set a "Window" for the most appropriate viewing ... Thanks a lot for the help! Erik]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-299254
Tue, 23 Feb 2021 18:46:30 +0000<![CDATA[Try changing this list1=Sequence(random(), i, 1, N)
H=Length(KeepIf(x < 0.4, list2))
n=1
StartAnimation(n) to UpdateConstruction()
SetValue(n,1)
StartAnimation(n)It's best to avoid "=" in scripts. Have a look at https://wiki.geogebra.org/e... for plotting several rectangles :)]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-299266
Tue, 23 Feb 2021 22:17:40 +0000<![CDATA[OK, thanks a lot. Looks more streamlined indeed. And yes, probably BarCharts are what I need here ... Erik]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-299282
Tue, 23 Feb 2021 23:36:36 +0000<![CDATA[I have been using used your good advice and developed my GeoGebra file quite a lot (attached). First I realized that using a BarChart is the most convenient way by far, especially when using more columns as I am doing in my new version. I have also started using a spreadsheet as a convenient way of controlling input as well as output. The user is assumed to write the letters for a number of different political parties in the A column. In the B column the user is supposed to write the population frequencies (assumed known). When pressing the Sample button, I want GeoGebra to create a simple random sample of size N (user input in a TextField). Given the list of population frequencies I have created a "Population Frequencies Cumulative" list PFC and adding 0 to it. Using that list, I can easily decide which party in the list will get the 'vote' associated with a given random number between 0 and 1. I am still using your brilliant idea of animating the voting process. I still have a couple of questions still though: 1. Is there a way that GeoGebra can by itself read the number of parties written in the spreadsheet. Or do I need to let the user input the number in a Text field as it is now? 2. My variable SampleProcentages is containing the final sample procentages and I want them to be displayed in the pink column C in the spreadsheet. As it is now, I have manually written them as SampleProcentages(1), SampleProcentages(2), etc. in column C. I want however GeoGebra to do it automatically: I don't know how many parties are present! 3. Is the animation process efficient? Yesterday I did some work on the file, and I experienced several instances of GeoGebra getting stuck before n got all the way to N. I had to stop the Java-process from the Joblist and start all over. I did some changes today, and I am not sure what made it work better. It seems to work now, even if I press the Sample button several times (after each animation have been completed). Does the command UpdateConstruction() do some unnecessary updating? I don't have an overview at all over this issue at all ... Thanks a lot for the current help I have received here in this forum! It has been great, and is helping me overcoming obstacles when I get stuck. I have found out quite a lot the recent days. Erik]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-299506
Thu, 25 Feb 2021 22:09:51 +0000<![CDATA[I did succeed in solving the second question above. I also streamlined the document by rearranging the order of commands and adding comments (captions) to objects. That way I have got a much better idea what is going on. I am pretty satisfied now. To make it complete, though, I would like to have the Party letters placed below the columns as labels. The BarChart command doesn't seem to allow this? Also I wonder if it is possible to somehow extract the number of rows being filled out by the user in the spreadsheet. If so the user wouldn't have to enter the number of parties in a text field. Erik]]>
https://help.geogebra.org/topic/random-numbers-with-counting-columns#comment-299630
Sat, 27 Feb 2021 15:04:50 +0000