|
||
Title: Not-totally random set generation Post by hoogle on Dec 10th, 2008, 12:05am I would like generate a data set that is not totally random. I have an idea . Please comment about its flaws. If you have any other function suggest that too. Suppose A is an array, of size n, that needs to be filled with numbers. As I told you it shouldn't be totally random. The function I thought of is follows: A[i]= rand(0,1) + slope*(i) ; 0<=i<=n and slope<1/n Explanation of the function: When slope tends to zero the above function becomes just like random number generator(between 0 &1) rand(0,1) generates a random number between 0 and 1 This is one of the data sets I am planning to consider in my project. Can you please tell me the advantages and disadvantages of this function. Can anyone tell me if they have a better not-totally random set generation function. |
||
Title: Re: Not-totally random set generation Post by towr on Dec 10th, 2008, 1:10am What do you want to do with your dataset? Personally I'd stick a parameter in front of the "rand(0,1)" as well. It makes sense to take Data+Noise, where you can manipulate the amounts of both. Or perhaps use an overall amplitude, plus a factor for the noise: A(D+f*N) On the other hand, it may make sense to put noise on the magnitude of the data, A*D*(1+f*N) Or to combine the two A*(D*(1+f1*N1)+f2*N2) But without knowing what you are using the dataset for, it's like trying to recommend tourist attractions without knowing what country you're in. |
||
Title: Re: Not-totally random set generation Post by hoogle on Dec 10th, 2008, 7:31am Quote:
I am working on analysis of parallel sorting algorithms. (Hyperquicksort and parallel merge sort) I worked on these two input formats (data set): 1) Random data set 2) Fully sorted data set I also wanted to work on a data set which is not totally random. @towr Thanks for your help Any more comments now |
||
Title: Re: Not-totally random set generation Post by Grimbal on Dec 10th, 2008, 7:56am Another case of partially-random data that can happen in the real world is a set of perfectly sorted elements with a number of random elements appended at the end. |
||
Title: Re: Not-totally random set generation Post by towr on Dec 10th, 2008, 11:02am You could start with a sorted array (or the reverse), then make K random swap, for some value of K (for example, you could swap ~25% of all elements, or just 10 in total) |
||
Powered by YaBB 1 Gold - SP 1.4! Forum software copyright © 2000-2004 Yet another Bulletin Board |