page468.html
来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 46 行
HTML
46 行
<HTML><HEAD><TITLE>Random Variables</TITLE></HEAD><BODY bgcolor="#FFFFFF"> <a href="../index.html" target="_top"><img src="../icons/usins.gif" alt="Logo" align=right></a><b>Data Structures and Algorithms with Object-Oriented Design Patterns in Python</b><br><A NAME="tex2html6558" HREF="page469.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6556" HREF="page464.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6550" HREF="page467.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html6560" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H2><A NAME="SECTION0014520000000000000000">Random Variables</A></H2><P>In this section we introduce the notionof an abstract <em>random variable</em><A NAME=33850> </A>.In this context,a random variable is an object that behaveslike a random number generator in that it producesa pseudorandom number sequence.The distribution of the values produced depends on the classof random variable used.<P>Program <A HREF="page468.html#prograndomVariablea"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> defines the <tt>RandomVariable</tt> class.The abstract <tt>RandomVariable</tt> classextends the abstract <tt>Object</tt> classintroduced in Program <A HREF="page116.html#progobjecta"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A>.The <tt>RandomVariable</tt> class defines the property <tt>next</tt>.Given an instance, say <tt>rv</tt>,of a class derived from the <tt>RandomVariable</tt> class,repeated accesses to the <tt>next</tt> propertyare expected to return successive elements of a pseudorandom sequence.<P><P><A NAME="33989"> </A><A NAME="prograndomVariablea"> </A> <IMG WIDTH=575 HEIGHT=221 ALIGN=BOTTOM ALT="program33861" SRC="img1922.gif" ><BR><STRONG>Program:</STRONG> Abstract <tt>RandomVariable</tt> class.<BR><P><BR> <HR><UL> <LI> <A NAME="tex2html6561" HREF="page469.html#SECTION0014521000000000000000">A Simple Random Variable</A><LI> <A NAME="tex2html6562" HREF="page470.html#SECTION0014522000000000000000">Uniformly Distributed Random Variables</A><LI> <A NAME="tex2html6563" HREF="page471.html#SECTION0014523000000000000000">Exponentially Distributed Random Variables</A></UL><HR><A NAME="tex2html6558" HREF="page469.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6556" HREF="page464.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6550" HREF="page467.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html6560" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <P><ADDRESS><img src="../icons/bruno.gif" alt="Bruno" align=right><a href="../copyright.html">Copyright © 2003</a> by <a href="../signature.html">Bruno R. Preiss, P.Eng.</a> All rights reserved.</ADDRESS></BODY></HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?