Wednesday, May 24, 2017

Randomnes Tester - Ver 3 - C Sharp - 170524We

  Randomnes Tester ver 3  
.
(Written by me in c#)
Version: 170524We
.
Some years ago while working in the beautiful Borland Turbo C IDE and using Random numbers, for doing something, I thought why not test how many times any number comes in a list of Random numbers. So I then made a C program for testing that. At watching the result of that program I was a little surprised.
.
In first version that program generated 100 random numbers and displayed them on screen/CRT. I was surprised to see that some numbers were generated more than once and some never. So I made another version of that program and I changed it's working a little from the first version. Now although it was still generating random numbers between 0 and 99 but a lot of times and was storing how many times a number was getting generated in an array of 100 elements. In fact it was generating random numbers multiple of 100 times between 0 and 99. Now again I was surprised to see it's result. This time almost all numbers were generated 1 percent of times. All of this looked very interesting to me.
.
Few months ago I planned/decided to put that program on my this blog but because that program was in Pentium 3 and because that Pentium 3 was no longer working so after thinking and thinking I re-made that program and this time in c# in visual-studio 2010 for putting/sharing on my this blog. I named this new application 'RandomnesTester'.
.
Randomnes-tester’s user interface is simple and easy to use. At top right it shows a button with text 'Help'. Click this button for viewing Help information about this application. Next to 'Random number count' enter how many random numbers are required. It is a UInt32 field. Next to it is 'Max value' button. Click it to get max number entered in 'Random number count' field automatically. Helpful alert messages will display on invalid inputs. Click 'Start' button for starting process. Click 'Stop' button for stopping/cancelling process any time while it is running. On success result will display Under 'Randomnes Test Result'. Column 'Number' will show all numbers it generates from 0 to 99. Column 'Count' will show how many times each number is generated. Column 'Percentage' will show how many percent of times a number is generated. Under these is footer. Footer will show total numbers in 'Number' column under 'Number' column, total of 'Count' column under 'Count' column and total of 'Percentage' column under 'Percentage' column. Different text messages will show in bottom left telling what application is doing. Process status will show in text in bottom left and in Progressbar in bottom right.
.

.
Following are the screen shots of 'RandomnessTester' version 3 application with explanation.
.
Application looks like this when it is loaded.
.

.
This is application's Help screen. It displays basic information about application under 'About' section, purpose under 'Purpose' section and how to use under 'How to Use' section.
.

.
If input number is not valid then application displays this alert message giving user 2 options as discribed in it.
.

.
This alert message is displayed when input number is not multiple of 100 telling it will be made so.
.

.
Application looks like this when (1st) Valid number in entered , (2nd) 'Start' button is clicked and (3rd) It begin processing. During processing helpful information is displayed in status line at bottom
.

.
Application looks like this when during processing 'Stop' button is pressed, Cancelling process. helpful information is displayed in status line at bottom
.

.
Application looks like this when processing ends successfully, helpful information is displayed in status line at bottom
.

.
In above image result of process is displayed under 'Randomnes Test Result'. And from this it can be observed that all numbers betwen 0 and 99 are generated near 1 percent of times.
.

.
Enjoy Complete Source code of application written and compiled in visual studio 2010 Ultimate by me. Download it. Extract it. Read 'ReadMeFirst.txt' file and do as is explained in it.
.


No comments:

Post a Comment