wu :: forums
« wu :: forums - Not-totally random set generation »

Welcome, Guest. Please Login or Register.
Nov 28th, 2024, 2:47am

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   general
   wanted
(Moderators: Grimbal, ThudnBlunder, Icarus, towr, william wu, Eigenray, SMQ)
   Not-totally random set generation
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Not-totally random set generation  (Read 1760 times)
howard roark
Full Member
***





   


Posts: 241
Not-totally random set generation  
« on: Dec 10th, 2008, 12:05am »
Quote Quote Modify Modify

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.
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Not-totally random set generation  
« Reply #1 on: Dec 10th, 2008, 1:10am »
Quote Quote Modify Modify

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.
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
howard roark
Full Member
***





   


Posts: 241
Re: Not-totally random set generation  
« Reply #2 on: Dec 10th, 2008, 7:31am »
Quote Quote Modify Modify

Quote:
What do you want to do with your dataset?  

 
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
IP Logged
Grimbal
wu::riddles Moderator
Uberpuzzler
*****






   


Gender: male
Posts: 7527
Re: Not-totally random set generation  
« Reply #3 on: Dec 10th, 2008, 7:56am »
Quote Quote Modify Modify

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.
IP Logged
towr
wu::riddles Moderator
Uberpuzzler
*****



Some people are average, some are just mean.

   


Gender: male
Posts: 13730
Re: Not-totally random set generation  
« Reply #4 on: Dec 10th, 2008, 11:02am »
Quote Quote Modify Modify

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)
IP Logged

Wikipedia, Google, Mathworld, Integer sequence DB
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board