page470.html
来自「Data Structures And Algorithms With Obje」· HTML 代码 · 共 37 行
HTML
37 行
<HTML><HEAD><TITLE>Uniformly Distributed 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="tex2html6583" HREF="page471.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6581" HREF="page468.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6575" HREF="page469.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html6585" HREF="page611.html"><IMG WIDTH=43 HEIGHT=24 ALIGN=BOTTOM ALT="index" SRC="../icons/index_motif.gif"></A> <BR><HR><H3><A NAME="SECTION0014522000000000000000">Uniformly Distributed Random Variables</A></H3><P>Program <A HREF="page470.html#proguniformRVa"><IMG ALIGN=BOTTOM ALT="gif" SRC="../icons/cross_ref_motif.gif"></A> defines the <tt>UniformRV</tt> class.This class generates random numbers which are uniformly distributedin an arbitrary interval (<I>u</I>,<I>v</I>), where <I>u</I><I><</I><I>v</I>.The parameters <I>u</I> and <I>v</I> are specified in the <tt>__init__</tt> method.<P><P><A NAME="33998"> </A><A NAME="proguniformRVa"> </A> <IMG WIDTH=575 HEIGHT=180 ALIGN=BOTTOM ALT="program33899" SRC="img1924.gif" ><BR><STRONG>Program:</STRONG> <tt>UniformRV</tt> class.<BR><P><P>The <tt>UniformRV</tt> class is also quite simple.Given that the <tt>RandomNumberGenerator</tt> classgenerates a sequence random numbers <IMG WIDTH=14 HEIGHT=22 ALIGN=MIDDLE ALT="tex2html_wrap_inline68643" SRC="img1925.gif" > uniformly distributedon the interval (0,1),the linear transformation<P> <IMG WIDTH=313 HEIGHT=16 ALIGN=BOTTOM ALT="displaymath68633" SRC="img1926.gif" ><P>suffices to produce a sequence of random numbers <IMG WIDTH=13 HEIGHT=22 ALIGN=MIDDLE ALT="tex2html_wrap_inline68647" SRC="img1927.gif" >uniformly distributed on the interval (<I>u</I>,<I>v</I>).<P><HR><A NAME="tex2html6583" HREF="page471.html"><IMG WIDTH=37 HEIGHT=24 ALIGN=BOTTOM ALT="next" SRC="../icons/next_motif.gif"></A> <A NAME="tex2html6581" HREF="page468.html"><IMG WIDTH=26 HEIGHT=24 ALIGN=BOTTOM ALT="up" SRC="../icons/up_motif.gif"></A> <A NAME="tex2html6575" HREF="page469.html"><IMG WIDTH=63 HEIGHT=24 ALIGN=BOTTOM ALT="previous" SRC="../icons/previous_motif.gif"></A> <A NAME="tex2html6585" 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 + -
显示快捷键?