Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Randomness, How? 3

Status
Not open for further replies.

BuzzViper

Electrical
Oct 17, 2003
7
Hi to all,

Most electronics I've doing so far are concentrating on how make a gate or such as reliable as possible - least probabily for error. i.e. if you are meant to get a '1' as your output then that's what you get and not oscillations.

But then come to think of the random function Rand() and Seed() in C/C++, an question appears across my mind on how this can be implemented using digital circuitry. Is there a circuit configuration that can generate randomness and can be altered to change the degree of randomness? How is it done in a prebuilt machine - PC?

Website or anything can be helpful.
Thanks in Adv.
 
Replies continue below

Recommended for you

IRstuff:

Thanks for the input.

I do not believe I am confused. I must not be communicating my point effectively.

I agree if an "algorithm is properly executed, any length integer can be accommodated", but my point is "any length integer" can not be generated in the first place. As I stated before, all algorithms (even ones to generate long integers) must halt for them to be useful. (The halting problem of algorithms was greatly infuenced by the work of Alan Turing - you may have heard of him.)

In our discussion, we could talk about two algorithms - one to generate the long integer and one to generate the psuedorandom sequence - both of which would have to halt to produce a useful output.

More info on the halting problem:
 
Although it is true concatenation of bits allows for large binary integers to be enumerated and coding can represent large decimal (if you choose) integers as well, stating "CPU wordlenght has no connection to the lenght of the integer it can generate" is like saying a "2 by 4" has nothing to do with building a house!

(Would you make the same statement if our CPU had a word length of one bit?)


Your posting essentially posited that an 8-bit computer could not perform something like 64-bit arithmetic, which is clearly not the case, since a Turing machine is a 1-bit processor that can emulate larger processors.

TTFN
 
I did not imply an 8-bit computer could not perform something like 64-bit arithmetic. I believe we all understand this operation can be achieved. However, it would take more than one instruction cycle (possibly at least 8 instruction cycles) to complete the operation. To me, this implies a connection to the word length of the CPU (ALU) and this connection is what I posited.

Also, a Turing Machine is not necessarily a one bit processor. The special case of the one "symbol" Turing Machine is often described as it is easy to illustrate the concepts involved using a minimal symbol set. And don't confuse the individual cells on the infinite (finite) tape as a "bit".

See th following web sites:


 
Maybe this web site will help convey what I originally meant by my comment, "computers or logical circuits can not generate infinite random number sequences due to their inherent nature, i.e., a 16 bit ALU (arithmetic logic unit) has a finite set of possible integers".

 
Amp: We understand only we disagree:

Even if we neglect that infinite number is meaningless
your previous statement is wrong: Any computer can generate
an infinite number -- it just takes infinite time.

I give IRSTUFF a red star -- I would give a black one
to you if there was any...This is an engineering forum
and engineering is the practical application of the
science. If you want to split hair, find a forum for
mathematicians -- or barbers.



<nbucska@pcperipherals.com>
 
Since there is a finite number of integers that a ALU can produce, the possibility of randomness is 0? What about the game craps? There are a finite set of numbers that can be achieved with 2 dice, but the outcome of the game is essentially random.
 
To nbucksa:

I sincerely apologize if I have offended you. I was simply enjoying the joust. I humbly accept your black star.

To all:

I also apologize if I have offended anyone else.

 
Hi Amp:
Argument is not offense -- no apology is needed.

The original question was: How the random function can be implemented usig digital circuitry?

The answer: by approximation. It depends on the application
if a given approximation is good or bad. One simple way
-- on PC and &quot;C&quot; -- to read the system timer:

outbyte (0x43,0xd2); lsb=inbyte(0x40); msb=inbyte(0x40);
/** perhaps even XOR lsb w/ msb **/ lsb = lsb ^ msb;

I found this good enough in many applications.



<nbucska@pcperipherals.com>
 
Depends on the craps table and casino ;-)

Because of the construction of the rules for casino craps, there is an inherent bias in favor of the house, so the outcome is rarely random: YOU always lose to the house, it's just a matter of time for when that happens.

TTFN
 
Just a side question to randomness:

The string tangling therom: A tring or chain or similar always tend to tangle up if it is given a kinetic energy. An example of this if something of a string kind is left in a pocket and then as you walk and do things the pocket gets KE and when you take the thing out at the end its always tangled to an unbelievable mess.

This brings me two questions:

a) Does that mean that the string gets into a more random state or a less random one?

b) Is this what the universe is like? i.e. gets more random or less random with time in a natural manor. Then would this lead to a concludion that randomness is something cannot really be totally controlled or randomised, as it has its own natural rythem?
 
Politicians, journalists and environmentalists survive using doublespeak and obfuscation, unlike engineers who need to use words precisely. Unambiguous naming conventions are critical in the sciences, and sloppy use of words leads to as many bad conclusions as sloppy use of statistics.

If entropy had been described as increasing relaxation or increasing comfort instead of increasing randomness, then we would live in a universe where sagging and rest were the outcomes instead of chaos. Unfortunately, randomness has some connotations that imply discord and uncertainty, whereas increasing entropy really implies quietness, death, and drifting eternally without change. About as predictable as it gets.

In physiology, the health of an system can be measured in part by its unpredictability, heart rate for example. A dying heart has a non-varying rhythm, whereas your heart varies in rate every beat.

Entropic, thermodynamic randomness and random numbers, while sharing the same root word (meaning to run unpredicably) share little else.

Your tangled string is a semantic convention. Is it a good model for randomness. A frayed knot.

The universe experiences continuously increasing entropy which unrelentingly follows the laws of thermodynamics. The antithesis of 'randomness'.

Have a Happy Thanksgiving.
DspDad
 
Hey Buzz,

The string obeys the Law of Entropy - it is seeking a state of maximum aggrevation.

a) Is there such a thing as &quot;degree of randomness&quot; - or, if it is random, then it is random (assuming we are not talking about psuedo-randomness).

b) The Universe is Chaotic! [wink]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor