<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3903213161018335472</id><updated>2011-07-07T23:47:32.673-07:00</updated><title type='text'>c++ random number</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default?start-index=101&amp;max-results=100'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>153</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2982289100302338789</id><published>2009-07-14T22:11:00.003-07:00</published><updated>2009-07-14T22:11:56.594-07:00</updated><title type='text'>Statistics Homework?</title><content type='html'>This question has to do with central limit theorem.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Suppose a random number generator generates real numbers with uniform frequency between 1 and 5. If we randomly sample 75 random numbers, determine the following.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. X=&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. Xbar ~ "blank"          X~ "blank"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. draw and label both distributions from b.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(you don't really have to answer this if there is no way to draw it online)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. the probability that the sample mean is no more than 2.5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e. find the probability that any given random number is no more than 2.5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;f. find the 45th percentile for the average random number generated.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;can you please show some work. THANK YOU.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Statistics Homework?&lt;br&gt;Let X1, X2, ... , Xn be a simple random sample from a population with mean μ and variance σ².&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let Xbar be the sample mean = 1/n * ∑Xi&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let Sn be the sum of sample observations: Sn = ∑Xi&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;then, if n is sufficiently large:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Xbar has the normal distribution with mean μ and variance σ² / n&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Xbar ~ Normal(μ , σ² / n)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Sn has the normal distribution with mean nμ and variance nσ²&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Sn ~ Normal(nμ , nσ²)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The great thing is that it does not matter what the under lying distribution is, the central limit theorem holds.  It was proven by Markov using continuing fractions.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if the sample comes from a uniform distribution the sufficient sample size is as small as 12&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if the sample comes from an exponential distribution the sufficient sample size could be several hundred to several thousand.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if the data comes from a normal distribution to start with then any sample size is sufficient.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for n %26lt; 30, if the sample is from a normal distribution we use the Student t statistic to estimate the distribution.  We do this because the Student t takes into account the uncertainty in the estimate for the standard deviation.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if we now the population standard deviation then we can use the z statistic from the beginning.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the value of 30 was empirically defined because at around that sample size, the quantiles of the student t are very close the quantiles of the standard normal.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X = 1) = 0.20&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X = 2) = 0.20&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X = 3) = 0.20&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X = 4) = 0.20&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X = 5) = 0.20&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X) = 3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Var(X) = 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Xbar ~ Normal(μ = 3 , σ² / n = 2/75)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e) P(X %26lt; 2.5 ) = P(X = 1) + P(X = 2) = 0.40&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;f) For any normal random variable X with mean μ and standard deviation  σ , X ~ Normal( μ ,  σ ), (note that in most textbooks and literature the notation is with the variance, i.e., X ~ Normal( μ ,  σ² ).  Most software denotes the normal with just the standard deviation.)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;You can translate into standard normal units by:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Z = ( X - μ ) /  σ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Moving from the standard normal back to the original distribuiton using:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X = μ + Z * σ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Where Z ~ Normal( μ  = 0,  σ  = 1).  You can then use the standard normal cdf tables to get probabilities.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If you are looking at the mean of a sample, then remember that for any sample with a large enough sample size the mean will be normally distributed.  This is called the Central Limit Theorem.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If a sample of size is is drawn from a population with mean μ and standard deviation σ then the sample average xBar is normally distributed&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;with mean μ and standard deviation  σ /√(n) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;An applet for finding the values&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www-stat.stanford.edu/~naras/jsm/...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;calculator&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://stattrek.com/Tables/normal.aspx&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;how to read the tables&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://rlbroderson.tripod.com/statistics...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;We know from the standard normal that&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(Z %26lt; z) = 0.45 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;= P(Z %26gt; z) = 0.55 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;when z = -0.1256613 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;x = μ + z * σ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;x = 3 + -0.1256613 * 0.1632993 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;x = 2.979480 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X %26lt; 2.979480 ) = 0.45 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X %26gt; 2.979480 ) = 0.55&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2982289100302338789?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2982289100302338789/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statistics-homework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2982289100302338789'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2982289100302338789'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statistics-homework.html' title='Statistics Homework?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2762409905964551289</id><published>2009-07-14T22:11:00.002-07:00</published><updated>2009-07-14T22:11:40.444-07:00</updated><title type='text'>Why rand() doesn't work in visual studio??</title><content type='html'>I am using visual studio 2005  for c++ programming.... I tried to use rand() function to generate a random number in a win32 console application but i recieve an error that says identifier ( rand ) not found!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;That means that it doesn't even exist.... What is the problem??&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I remember also that when i try to copy source codes from a website, some libraries return an error saying that they are not found such as iostream.h.... and functions such as cout (although i don't know what it means yet!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Thanks in advance......... :):):):)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Why rand() doesn't work in visual studio??&lt;br&gt;You need to #include %26lt;math.h%26gt; for rand().&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;As for compiling other people's source, it isn't clear why Visual Studio wouldn't find something like iostream.h.  VS should be set up to know where that is by default.  The first thing I would do is go into "Options..." and find where your include file directories are set, and make sure there's a line that says "$(VCInstallDir)include" (without the quotes).  See if that helps.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://1apricot.blogspot.com/&gt;apricot&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2762409905964551289?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2762409905964551289/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/why-rand-doesnt-work-in-visual-studio.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2762409905964551289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2762409905964551289'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/why-rand-doesnt-work-in-visual-studio.html' title='Why rand() doesn&apos;t work in visual studio??'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6525258360375749526</id><published>2009-07-14T22:11:00.001-07:00</published><updated>2009-07-14T22:11:24.890-07:00</updated><title type='text'>How do I get rid of the newline character in C++ using ignore?</title><content type='html'>I have this class structure, I'm trying to read in strings.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     for (int count = 0; count %26lt; num; count++) {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         cfile %26gt;%26gt; library[count].name.last;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         cfile %26gt;%26gt; library[count].name.first;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         getline(cfile, library[count].book.title);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         cfile %26gt;%26gt; library[count].book.pages;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         getline(cfile, library[count].book.genre);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         getline(cfile, library[count].book.other.publisher);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         cfile %26gt;%26gt; library[count].book.other.year;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And I asked this guy and he said:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;After you cin%26gt;%26gt; name.first and name.last, you will have read "Jk" and "Rowling", respectively, but you've left the newline in the stream. The call to getline will receive an empty line, and when you try to convert that empty string to a number, you get something completely random like 211400.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;How do I get rid of the newline character, something to do with cin.ignore????&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;How do I get rid of the newline character in C++ using ignore?&lt;br&gt;The guy you asked answered correctly. When reading from an instream object using %26gt;%26gt;, you have to be careful about newlines being left behind.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I could type up the solution here, but someone else has already done so.  I'll give you the link: http://www.daniweb.com/tutorials/tutoria...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I'll summarize the two solutions you have. The first, and recommended for beginners to C++, is to avoid cin and use getline instead. The other way is cin.ignore(numeric_limits%26lt;streamsize%26gt;::m... '\n').&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Please read the entire article. It is technically accurate as well.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;In the future, use Google to find out answers. There's good resources at "C++ FAQ", cplusplus.com , cppreference.com.&lt;br&gt;Reply:cin.ignore('\n');&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6525258360375749526?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6525258360375749526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-do-i-get-rid-of-newline-character.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6525258360375749526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6525258360375749526'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-do-i-get-rid-of-newline-character.html' title='How do I get rid of the newline character in C++ using ignore?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1313954731212950105</id><published>2009-07-14T22:11:00.000-07:00</published><updated>2009-07-14T22:11:09.093-07:00</updated><title type='text'>Can you help me with this homework?</title><content type='html'>OK, OK, I'll start with a few 'dead-easy' ones just to 'prepare' you for the killers later. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Dice Roll:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 0.8/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If you throw a dice 6 times, what's the chance that you'd get a six on:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a: exactly one of the throws.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b: one or more of the throws.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; The Square Cross-over:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 2.5/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3 points are chosen at random along the square's outline. They then combine to form a triangle.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a: What is the probability that the centre of the square will be 'engulfed' by this triangle?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b:(1 and 2) Same question, but instead of a square being used to place the three points on, they are now placed on the following: (1)a circle, (2)a triangle and........wait for it!...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" sub-rating: 6.5/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(3) Dodecahedron! (Mr Know-it-all smirks) Yes that's right. The puzzle now extends to the third dimension (Mr Know-it-all has solutions for strange 20 dimensional objects by the way). You may now choose 4 random points along the edges (not faces) of the dodecahedron. These will combine to form a tetrahedron (Mr Know-it-all remarks sarcastically - "You know - one of those pyramid shaped objects except with a triangle base instead of a square one") &lt;br&gt;&lt;br /&gt;&lt;br /&gt;(still 3) What is the probability that the centre of the dodecahedron will be engulfed by this tetrahedron?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(Note: you may 'cheat' by looking up the coordinates of the points of a dodecahedron if that will help. Mr Know-it-all knows all the coordinates off by heart up to 40 decimal places).   [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Infinity Thing:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 4/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;First off, here's a slightly simpler question (difficulty sub-rating: 1.4/10) to ease you in ;-)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a: You throw a coin multiple times. What's the average amount of throws required to obtain 2 heads in a row?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and the main question (b)...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Starting at number zero, you throw a coin.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Tails means you go down one (therefore equalling -1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Heads means you go up one (therefore equalling 1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;You repeat this procedure infinite times, so here's an example variation:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 6, 7.........&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Question is: (b) - how many times on average would 0 have been 'hit' if you threw the coin 100 times? This question is actually possible to answer, but you might need to use a computer ;-) [at which point Mr Know-it-all promptly interrupts] "Notice readers, how he's implying that my calculating ability is equal to or surpassing that of a computer - cheers ;7 ... And no; the reader will most certainly /not/ use a computer to help on this" ........ Ignore him readers. It may be your only chance.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The highest possible answer is 50 (0, 1, 0, 1, 0, 1 etc.), and the lowest answer is 0 (many, many ways of getting this), but I want the /average/.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now the killer /when even a computer/ won't be much help (impossibility sub-rating 5/10)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;What's the average amount of times you'd have to throw the coin before zero was hit upon again?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I know this sounds simple, but there's a cunning nature to this question. For example, the coin tosses could go all the way down to -5000 and then suddenly 'decide' it wants to edge its way back up (albeit it in a stuttering way) to 0.   [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Enveloping Lines:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 3/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt; 4 random points are chosen in a square. These points are then linked to form a 4 sided polygon. For a demonstration of this, see the blue and green square for possibilities.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a: ('easy' ^-^ difficulty rating: 2.5) What is the average length of any one of the lines?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b: ('moderate' ~.~ difficulty rating: 4.0)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(1)What is the average size of the resulting polygon area going to be? (Bearing in mind that if the lines cross-over (as shown in the blue square), then "polygon" is defined as the sum of the 2 black triangles). &lt;br&gt;&lt;br /&gt;&lt;br /&gt;(2)What is the chance of a point at the centre of the square being 'engulfed' by this "polygon"?   [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Ant Walk:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 4/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;An ant stands in the middle of a circle (3 metres in diameter) and walks in a straight line at a random angle from 0 to 360 degrees. Problem is, it can only walk one metre before it needs a break&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(Yes, I know. The lengths I'll go to make a 'problem' for the conditions set in the puzzle =P) To make things even more exasperating, the ant has the memory of a fish and forgets what direction it has just walked in. ( [reader] "You're just making this plot up as you go along to fit in with the problem aren't you?" ). Anyway, after the break, it gets all dizzy and thus chooses another random direction from 0 to 360 in an attempt to escape the circle again).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;As you can well imagine, it could escape the circle after just 2 walks (just one break needed). Or... it could take 20,000 walks (19,999 breaks needed)!! There might even be the very slim possibility it might take 20,000^20,000 walks. You can probably guess what I'm going to ask.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;What is the average amount of walks required for the ant to escape the circle?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Enveloping Lines: The Revenge&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 4.5/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Mr Know-it-all realises there may have been a /chance/ that you got the earlier "Enveloping Lines" question, so here's a trickier version. Good luck.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now take a look at the example purple square below.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;10 points are randomly chosen within the square - and are connected to form 9 lines.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Can you guess what I'm going to ask next? %26gt;;)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Yup: &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a: ('fairly hard'* -.- difficulty rating: 4.5) (1) On average, how many junctions (indicated by the small red/yellow circles) will be created? (2) Also, how many junctions will each line produce on average? For example, the line on the far left has no junctions, but the one going through the centre from bottom-right to top-left has 4 (count 'em!) junctions. And (3) What is the probability that no junctions will be made from the 9 lines?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b: ('very hard!'* -_~ sub-difficulty rating: 5.5) If the square has a width and height of 10cms, what is the average area of an 'enclosed' part (indicated by the brown areas) ?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;* = The difficulty rating shown is Mr Know-it-all's arrogant estimation of the difficulty to the reader, not to him. Mr Know-it-all would like to make it clear that this question (as well as any others that are presented on this page) are actually a piece of cake to him... [sigh] -_-     [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Zig-zagger:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 5/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;.....A bit like the earlier coin question, but with the addition of some geometry.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;10 metres away from someone is a circle with a diameter of 1 metre. The idea is that he chooses a completely random number from -90 to +90 (relative to the target) and uses this number as his direction in degrees.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Each 'occasion', he walks 2 metres, before he has to stop and take a break. Of course, he may easily miss his target (and since there is no going back thanks to only 180 degrees of movement), what's the chance he will hit it?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;See left for a brown diagram showing the various lucky possibilities that hit the target. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;That too easy for you? ok....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now the killer (as if that previous one wasn't hard enough) (impossibility sub-rating 6.5/10):&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The random direction now extends to 360 degrees. Thus he could theoretically take 1000 years (or 1,000,000 'occasions') to hit it, but it is possible. What's the chance of hitting the green target directly on (not before or after) the thousandth attempt?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;See right for a purple diagram showing one of the various lucky possibilites that hit the target (except this doesn't count - as it only took 17 attempts).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Note: Circle targets are for illustrative purposes. You may replace the green circle with a line of equal width (at the same location of course) to make the question easier. Difficulty ratings still apply.   [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Next horribly, horribly complicated question &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Cricket Pitch:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 6/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; On a cricket pitch measuring 40*25 metres, a bowler bowls to a batsman who hits a ball at a certain speed. There are 20 'catchers' (placed at the points indicated by the diagram to the left), who each cover a small section of the pitch: What is the likelihood of the ball being caught if all of the following criteria are met:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a: the moment the ball has been hit, the catchers 'magically' know where the ball will end up, and start moving to that position at a constant speed.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b: the catchers always catch the ball if they can reach it.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c: the batter hits the ball such so that it only lands on the patterned green area, and that each 'spot' of this pitch is just as likely to be reached as any other 'spot'.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d: The ball travels at a speed of 10 metres per second.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e: The catchers run at different speeds, with the ones at the back being the slowest. Here are the speeds each row of catchers possess (mps=metres per second):&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Row a: 1 mps&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Row b: 1.5 mps&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Row c: 2 mps&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Row d: 2.5 mps&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Row e: 3 mps&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And the killer question (impossibility rating 7/10):&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Same as above, except if two or more players manage to reach the ball, they both get confused about who should catch the ball, and thus neither catch it. What is the likelihood of the ball being caught under these circumstances now?   [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Mega-sphere&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 6/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;First off, here's a couple of simpler questions (difficulty sub-ratings: 1 to 4 / 10 depending on if you know the formula) to ease you in ;-)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a: Pictured to the right is a diagram of 3 marbles. The centre of the first one (represented by the small orange blob) is positioned at the coordinates 0,0,0 (x,y,z). The second one (green blob) is positioned at the coords 100,0,0. The third one is trickier because it forms a triangle with the other two. However, a simple bit of trigonometry will tell you that its coords are at:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;50, 86.6025, 0 (the number 86.6025 is calculated thus: (3^0.5)*50). The question though is; if a fourth marble were to rest on top (z axis) of these 3, what would those exact coords be?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b: A sphere 5.5 centimetres in diameter is filled with 1cm diameter hemi-spheres. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;What is the theoretical maximum amount of spheres that can be crammed into the mega-sphere?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now the real question (difficulty rating 6/10):&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Same as above, except that the spheres are stretched in width by double - to produce an elongated sphere or 'ellipsoid'. What is the theoretical maximum amount of ellipsoids that can be crammed into the mega-sphere?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I hear that Mr know-it-all will spare you the crammed Augmented Tridiminished Icosahedrons for another time.   [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Oh...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Mr Know it all has something to say... "You've got this far have you? I'm surprised you haven't already given up. Maybe you're just curious to see how intelligent I am, or perhaps you're just hoping you might be able to answer one of the questions beyond this point. [at which point Mr Know-it-all bursts out laughing]" &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Curvy Rebound:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;An easier version of an angle prob to prepare you for what's to come.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 7/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;An infinitely small ball is placed at a random point on the red line shown on the right. The line is 10 metres long. The semi-circle that stems from this line is its resulting size too. Also positioned 3 metres above the centre of the line is a small circle with a diameter of 1 metre. There is no gravity of any sort by the way.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The ball is shot up into the semi-circle at a random angle from -90 degrees to +90 degrees. After it comes back past the red line, it is all over.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(difficulty sub-rating: 5/10) What's the chance the 'ball' will contact the yellow circle?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The real question (difficulty sub-rating: 7/10) Same question as above, except that the curve (which has now extended to become a full circle) rotates (pivot = point at centre of yellow circle) 45 degrees for every 5 metres the ball has travelled.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;At which point Mr Know-it-all concedes:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hmmm... I must admit that this one took me over a minute (1:25) to answer. But I /do/ have an excuse - I was tired and was not thinking straight...   [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;----------------The Starry Rebound:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 7.5/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt; They get harder....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;An (infinitely small) ball starting out in the middle of a 5 pointed star table (outer 5 points - 10m radius..... inner 5 points - 5m radius) has a starting angle of a random value from 0 to 360 degrees. The ball is now set loose and travels around the table.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;On average, how many sides will have been hit once the ball has travelled 1000m ?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And the killer question: (impossibility sub-rating 8/10)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The ball has now got a 'real' size of 1m diameter and thus is affected in weird ways by colliding and bouncing off at tangents with the 'inner' 5 points etc.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now how many sides on average will have been hit once the ball has travelled 1000m ?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Also, where are the most likely points that the ball will end up?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Extra added 'Argghhh' factor.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(impossibility sub-rating 8.5/10)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To make things even more wonderfully confusing, the star rotates at an ever increasing speed of half a revolution for every 10 metres the ball has travelled. These speed increases are in incremental 'jumps'. Observe:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;0 revolutions per 10 metres of ball travel: (when the ball has travelled 0 - 10 metres)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;0.5 revolutions per 10 metres of ball travel: (when the ball has travelled 10 - 20 metres)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1.0 revolutions per 10 metres of ball travel: (when the ball has travelled 20 - 30 metres)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1.5 revolutions per 10 metres of ball travel: (when the ball has travelled 30 - 40 metres)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;etc. etc.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now how many sides on average will have been hit once the ball has travelled 1000m ?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Mega-sphere: The Revenge&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 9/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt; Mr know-it-all loves this one. Apparently, it's one of his favourites; not because it's challenging for him (which it isn't by the way), but because he knows you won't even know where to begin searching for a solution.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A sphere 5.5 metres in diameter is filled with 1m diameter hemi-spheres. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a:(1) What is the theoretical maximum amount of hemi-spheres that can be crammed into the big sphere given that the following condition is met:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Each hemi-sphere's flat side (which I'll now refer to as its 'disc') has a central point (indicated by the white point shown in the hemisphere diagram to the right). The point must not 'see' another hemisphere's disc. By definition, when I say 'see', the simplest thing to imagine is a straight ultra-thin 'laser light' coming from the disc. This 'light' must not reach another disc. However, if there's another hemi-sphere that's 'blocking' the 'line of sight', then this is accepted.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(2) By cramming them as efficiently as possible, a relatively small volume will be left. How large is this volume?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b: Same question, except the torch now has a 52.72077938642 (that's 90/(1+(0.5^0.5))) 'degree of sight'. This 'cone' of light extends from the exact centre of the disc and is once again not allowed to 'see' any part of another disc. What is the maximum amount of hemisphere's that can be crammed into the mega-sphere now?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c: Same question again, except the whole disc acts as a tubular beacon of light. This thick ray must not 'see' another hemisphere's disc. What is the maximum amount of hemisphere's that can be crammed into the mega-sphere now?   [Back to top] &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The nightmare of nightmare questions :&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Snooker Table of Doom&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"oooh... that's just impossible" rating: 9.5/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A 'snooker' table (measuring 8 metres by 4m) with 4 'pockets' (measuring 0.5m and placed at diagonal slants in all 4 corners) contains 10 balls (each with a diameter of 0.25m) placed at the following coords:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2m,1m...(white ball) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;...and red balls...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1m,5m... 2m,5m... 3m,5m&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1m,6m... 2m,6m... 3m,6m&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1m,7m... 2m,7m... 3m,7m&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The white ball is then shot at a particular angle from 0 to 360 degrees (0 being north, and going clockwise).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Just to make it clear, a ball is 'potted' if at least half of the ball is in area of the 'pocket'&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Assuming the balls travel indefinitely (i.e. no loss of energy via friction, air resistance or collisions), answer the following:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a: What exact angle/s should you choose to ensure that all the balls are potted the quickest?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b: What is the minimum amount of contacts the balls can make with each other before they are all knocked in?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c: Same as b, except that each ball - just before it is knocked in - must not have hit the white ball on its previous contact (must be a red instead of course).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d: What proportion of angles will leave the white ball the last on the table to be potted&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Can you help me with this homework?&lt;br&gt;How long did it take you to type this up?!?!?!?!?!&lt;br&gt;Reply:This is way too long. delete this question and enter them in individually.&lt;br&gt;Reply:615&lt;br&gt;Reply:i dont think this are serious questions.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If i have to answer stuff like that when i get older&lt;br&gt;&lt;br /&gt;&lt;br /&gt;i am dropping out of school now&lt;br&gt;Reply:who has time 2 read all of that? who has time 2 type all that? hope u copied and pasted. MONKEY BARS! HA! I CALLED THAT ONE! -snicks&lt;br&gt;Reply:how come you could write that much?? ppl only get to write 1000 characters, and yours  looks like a lot more&lt;br&gt;Reply:what grade r u in???&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1313954731212950105?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1313954731212950105/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/can-you-help-me-with-this-homework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1313954731212950105'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1313954731212950105'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/can-you-help-me-with-this-homework.html' title='Can you help me with this homework?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4276037476161812004</id><published>2009-07-14T22:10:00.003-07:00</published><updated>2009-07-14T22:10:52.895-07:00</updated><title type='text'>I have a Page in ASP.NET During Debug IT WORKS FINE, Accessing it online variables arnt working PLEASE HELP?!?</title><content type='html'>i have a class that makes text files storing plain text these text files are given a name plus a random integer then the file extention .txt&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Ex     FileName54233142.txt&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EVERYTHING, i mean EVERYTHING works perfectly fine when debugging it in MS Visual Studio 2008,  works great&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;then ill host it on IIS and connect through my IP address, (not loop back)   the long way...   and then it will give me a server side error saying the file could not be found.   &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the random number on webaccess is 0 (zero) all the time, dosnt matter  and the file on the server is like Filename43123412.txt         so of course its not there...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;why is the integer not being populated when i access it through the net??&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The integer is populated by a method i created that returns an integer that it finds in a SQL Database&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;please email me at     theneonirvana@gmail.com if u wana see my C# class,  once again everything works perfect while debugging, but the random number is not retrived or populated while published&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;I have a Page in ASP.NET During Debug IT WORKS FINE, Accessing it online variables arnt working PLEASE HELP?!?&lt;br&gt;after uploading to the webserver, did you change the path of the file location? eg. server.mappath&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4276037476161812004?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4276037476161812004/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/i-have-page-in-aspnet-during-debug-it.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4276037476161812004'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4276037476161812004'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/i-have-page-in-aspnet-during-debug-it.html' title='I have a Page in ASP.NET During Debug IT WORKS FINE, Accessing it online variables arnt working PLEASE HELP?!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4777058762216273342</id><published>2009-07-14T22:10:00.002-07:00</published><updated>2009-07-14T22:10:36.725-07:00</updated><title type='text'>Statistics.  Please check.?</title><content type='html'>(F3)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To determine monthly rental prices of apartment units in San Francisco Bay area, samples were constructed in the following ways.  Identify the technique used to produce each sample. (cluster, convenience, random, stratified, systematic):&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a)  Number all the units in the area and use a random number table to select the apartments to include in the sample.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Systematic Sampling&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b)  Classify the apartment units according to the number of bedrooms and then take a random sample from each of the classes.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Stratified Sampling&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)  Classify the apartments according to zip code and take a random sample from each of the zip code regions.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Cluster Sampling&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d)  Look in the newspaper and choose the first apartments you find that list rents.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Convenience Sampling&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Statistics.  Please check.?&lt;br&gt;well done.  you're answers are correct.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://4song-words.blogspot.com/&gt;song words&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4777058762216273342?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4777058762216273342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statistics-please-check.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4777058762216273342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4777058762216273342'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statistics-please-check.html' title='Statistics.  Please check.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7043185061690547736</id><published>2009-07-14T22:10:00.001-07:00</published><updated>2009-07-14T22:10:20.768-07:00</updated><title type='text'>Statistics.  Are these correct?</title><content type='html'>To determine monthly rental prices of apartment units in San Francisco Bay area, samples were constructed in the following ways.  Identify the technique used to produce each sample. (cluster, convenience, random, stratified, systematic):&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a)  Number all the units in the area and use a random number table to select the apartments to include in the sample.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Systematic Sampling&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b)  Classify the apartment units according to the number of bedrooms and then take a random sample from each of the classes.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Stratified Sampling&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)  Classify the apartments according to zip code and take a random sample from each of the zip code regions.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Cluster Sampling&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d)  Look in the newspaper and choose the first apartments you find that list rents.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Convenience Sampling&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Statistics.  Are these correct?&lt;br&gt;yes ur right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;all correct&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7043185061690547736?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7043185061690547736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statistics-are-these-correct.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7043185061690547736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7043185061690547736'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statistics-are-these-correct.html' title='Statistics.  Are these correct?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-3195326794371355615</id><published>2009-07-14T22:10:00.000-07:00</published><updated>2009-07-14T22:10:04.719-07:00</updated><title type='text'>From the numbers 3 to 12 inclusive two numbers are chosen at random.?</title><content type='html'>a) What is the cardinality of the sample space?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) List the event in which number is a factor of the other number and find its cardinality.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) List the event in which the sum of the numbers is 15.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d)List the event in which the sum of the numbers is 15 and one number is a factor of the other number.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;From the numbers 3 to 12 inclusive two numbers are chosen at random.?&lt;br&gt;A)What is the cardinality of the sample space?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The sample space O={3,4,5,6,7,8,9,10,11,12} and its C is 10 as it has 10 items&lt;br&gt;&lt;br /&gt;&lt;br /&gt;B)These are the pairs:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(3,6),(3,9),(3,12),(4,8),(4,12),(5,10)...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So A={(3,6),(3,9),(3,12),(4,8),(4,12),(5,10... and its C is 7&lt;br&gt;&lt;br /&gt;&lt;br /&gt;C)These are the pairs:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(3,12),(4,11),(5,10),(6,9),(7,8)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So B={(3,12),(4,11),(5,10),(6,9),(7,8)} and its C is 5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;D)C=A AND B={(3,12),(5,10)} and its C is 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Notes:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1)You haven't defined whether both numbers can be the same. In this case A also has {(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,... and its C is +12&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2)You haven't defined whether the pairs are ordered, meaning if the incident of choosing ie (3,4) is not treated as if choosing (4,3). In this case A also has {(6,3),(9,3),(12,3),(8,4),(12,4),(10,5),... and its C is +7, B also has {(12,3),(11,4),(10,5),(9,6),(8,7)} and its C is +5 and C also has {(12,3),(10,5)} and its C is +2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Note that none, either or both of those notes can be defined.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-3195326794371355615?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/3195326794371355615/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/from-numbers-3-to-12-inclusive-two.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3195326794371355615'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3195326794371355615'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/from-numbers-3-to-12-inclusive-two.html' title='From the numbers 3 to 12 inclusive two numbers are chosen at random.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-74900486110645314</id><published>2009-07-14T22:09:00.003-07:00</published><updated>2009-07-14T22:09:49.157-07:00</updated><title type='text'>I need help with samples?</title><content type='html'>i havent figures these out, i need some help&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;identify each of the following methods as a simple random sample, stratified random sample, cluster sample, or convenience sample?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) from a group of 100 employees, the manager randomly selects 12 of the 60 women and 8 of the 40 men to form a sample of size 20&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) suppose that in a class of 24 there are 12 boys and 12 girls. the teacher selects 6 students for a sample by numbering the boys from 1 to 12 and the girls from 13 to 24. then she uses a random number table to slect 6 two digit numbers between 01 and 36.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;I need help with samples?&lt;br&gt;This is confussing. Type Sampling(statistics) in your search bar and you may be able to figure it out. Good Luck.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-74900486110645314?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/74900486110645314/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/i-need-help-with-samples.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/74900486110645314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/74900486110645314'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/i-need-help-with-samples.html' title='I need help with samples?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6771011603079092873</id><published>2009-07-14T22:09:00.002-07:00</published><updated>2009-07-14T22:09:32.962-07:00</updated><title type='text'>Problem with Microsoft Windows XP SP2?</title><content type='html'>Hey !!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;My C drive has started acting weird. My C drive displays free space differently every time, it changes every time I refresh the page or open an application. For eg. its 56 kb at one instance and when I go to the windows folder or any other folder ( for that matter) and check again, it displays the free space as 80 MB, 256, MB, 114 MB or any random number. I know that the space on my C is different than the one thats displayed because when it displayed the free space as 1 MB, i tried copying a 2 mb file from D drive to the C drive and it was pasted there!!! I am sure there is no spyware, adware, virus on my system. What could possibly be the issue ? THE OS is Windows XP Pro with SP2.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Problem with Microsoft Windows XP SP2?&lt;br&gt;Sounds like you are on the way to a crash/dead hd/loosing everything. Or you have a very badly programmed trojan virus whcih is hiding itself. An anti-virus may not find it. Also your hd is saturated. This may be the problem, but not so important for the moment.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1.Try emptyig the trash can. That may free up some space and give you time to breathe. Do NOT defragment under any circumstances. (later yes, not now).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. Back up everything of value to you - mp3s, photos. You could try backing up to a cd but you may not have any useable space left to even do that. The best would be a USB memory stick - you can get a 4Gb one for $15 these days. If you have more than 4Gb you need to keep, then backup 4Gb worth, delete the files you backed up. See if things return to normal now you have mmore space. Back up any remaining files NOW If things are not back to normal, then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. Open My Computer, right click on drive C:, select properties, go to the tools tab and press Error check now. Select Repair Automatically. It will tell you you can't do that now, and ask for a reboot. Tell it OK. Watch the screen as it checks the disk as it restarts. That may give you some idea what is going on.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Once it has restarted see if you get the same problem or not. If you do then your only chance may be a full reformat/reinstall of XP. That may or may not do the job, but it may return. If it is stable for a few days then re-run the error check/fix on C:, defragment. Head for Windows Update&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4. As a last resort, before you reformat, you can try two things,go to the Kaspersky site and run their on-line virus check overnight. It will find almost anything. Just in case your existing anti-virus has missed something. None of them get all the intruders. Then check your Control Panel Add/Remove programs list for anything you dont think is your software. If there are any weird ones then Google to see if you can find them. If not then remove them. Restart the computer again. If not fixed by now then you have a weirdo or a dieing disk.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Reformat Reinstall. The whole drive including any partitions. If that doesn't fix it then get a new HD. If you have other drives then disconnect them until you are happy with the way it runs for a few days. Then reconnect them.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If you can't understand any of the above then take your box or laptop down to the local repair shop. It might be something really simple that they can find by opening her up and checking everthing inside-cables, connectors, battery etc. It is a weird one. Never heard quite the same symptoms in many years. Similar, but not the same.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Pray that your backups were good.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Ask more if you get confused. I'm slow on email replies don't get angry, its not my fault. .Just post a detailed new question with a list of what you tried and what the results were (keep good notes as you do things.)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Good luck&lt;br&gt;Reply:This happened to me also. Restart your comp and load it in safe mode. Then restart it again and start it normally. If this doesn't work, boot it with CD&lt;br&gt;Reply:sounds like your file allocation tables and stuff are shot away.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;you need to do a full drive scan (start the procces in windows by right clicking the drive, select properties and then the tools tab) click error checking and select both tabs then run it...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if this fails you may well have to reinstall windows...if that too fails you have to consider that the hard drive may be broken.&lt;br&gt;Reply:which drive has your OS..?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;well try degfragmenting and also...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;download uniblue regisry repair&lt;br&gt;Reply:Hopefully, you are not REALLY at 80, 256 or whatever Mb of free space on your primary drive. XP is like a big dog, it needs room to run around in. You are setting yourself up for a crash, if thats all the free space you have. If so, you could remove uneeded proggies, files, then look at virtual memory, swap file, etc. ACTUALLY, forget all that... you need some room! LOL! Get another drive or change your partition if thats the case.... My rule of thumb is to always leave 20% of the drives size free and clear. I mean, right now, I doubt you could do a defrag.....&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://1song-titles.blogspot.com/&gt;song titles&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6771011603079092873?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6771011603079092873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/problem-with-microsoft-windows-xp-sp2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6771011603079092873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6771011603079092873'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/problem-with-microsoft-windows-xp-sp2.html' title='Problem with Microsoft Windows XP SP2?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2797491891067208230</id><published>2009-07-14T22:09:00.001-07:00</published><updated>2009-07-14T22:09:17.988-07:00</updated><title type='text'>Help please?</title><content type='html'>all i need to do is get started its in the C++ language&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Write a program that uses a random number generator to display one of 20 phrases stored in an array of char pointers. Let the user keep asking for phrases as long as desired&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Help please?&lt;br&gt;Random Numbers&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Random numbers are useful in programs that need to simulate random events, such as games, simulations and experimentations. In practice no functions produce truly random data -- they produce pseudo-random numbers. These are computed form a given formula (different generators use different formulae) and the number sequences they produce are repeatable. A seed is usually set from which the sequence is generated. Therefore is you set the same seed all the time the same set will be be computed.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;One common technique to introduce further randomness into a random number generator is to use the time of the day to set the seed, as this will always be changing. (We will study the standard library time functions later in Chapter 20).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There are many (pseudo) random number functions in the standard library. They all operate on the same basic idea but generate different number sequences (based on different generator functions) over different number ranges.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The simplest set of functions is:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int rand(void);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;void srand(unsigned int seed);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rand() returns successive pseudo-random numbers in the range from 0 to (2^15)-1.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;srand() is used to set the seed. A simple example of using the time of the day to initiate a seed is via the call:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;srand( (unsigned int) time( NULL ));&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The following program card.c illustrates the use of these functions to simulate a pack of cards being shuffled:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/*&lt;br&gt;&lt;br /&gt;&lt;br /&gt;** Use random numbers to shuffle the "cards" in the deck.  The second&lt;br&gt;&lt;br /&gt;&lt;br /&gt;** argument indicates the number of cards.  The first time this&lt;br&gt;&lt;br /&gt;&lt;br /&gt;** function is called, srand is called to initialize the random&lt;br&gt;&lt;br /&gt;&lt;br /&gt;** number generator.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;*/&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdlib.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;time.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define TRUE 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define FALSE 0&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;void shuffle( int *deck, int n_cards )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt; int i;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; static int first_time = TRUE;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; /*&lt;br&gt;&lt;br /&gt;&lt;br /&gt; ** Seed the random number generator with the current time&lt;br&gt;&lt;br /&gt;&lt;br /&gt; ** of day if we haven't done so yet.&lt;br&gt;&lt;br /&gt;&lt;br /&gt; */&lt;br&gt;&lt;br /&gt;&lt;br /&gt; if( first_time ){&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  first_time = FALSE;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  srand( (unsigned int)time( NULL ) );&lt;br&gt;&lt;br /&gt;&lt;br /&gt; }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; /*&lt;br&gt;&lt;br /&gt;&lt;br /&gt; ** "Shuffle" by interchanging random pairs of cards.&lt;br&gt;&lt;br /&gt;&lt;br /&gt; */&lt;br&gt;&lt;br /&gt;&lt;br /&gt; for( i = n_cards - 1; i %26gt; 0; i -= 1 ){&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  int where;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  int temp;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  where = rand() % i;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  temp = deck[ where ];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  deck[ where ] = deck[ i ];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  deck[ i ] = temp;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2797491891067208230?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2797491891067208230/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/help-please.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2797491891067208230'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2797491891067208230'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/help-please.html' title='Help please?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-3005332680686313597</id><published>2009-07-14T22:09:00.000-07:00</published><updated>2009-07-14T22:09:00.933-07:00</updated><title type='text'>My random quiz!!!?</title><content type='html'>1. what would u say if i said i'm a girl and i want a mustache?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) HURRA!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) WTF?!!?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) that's nice&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) OMG!!! ME 2!!! LET"S BE BUDDIES!!!!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. how do u feel RIGHT THIS SECOND!!!!??&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) bored&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) happy&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) *my feet r numb&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) AHA!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e) i feel.... how i feel&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. HELLO!!!! how's it going?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a)ok&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) HI im ok... today was..... i like this animal... so on... so so on....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) hey... im ok...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) LEAVE ME ALONE!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4. i like ducks&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) WELL i DONT!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) ok&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) i want to be ur friend!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) LEAVE!!! AAAAAAAAAAAAHHHHHH!!!!!!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5. Here i will write a story and you have to continue...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There once was a girl. She loved a boy.... for his mustache... in a way she was jealous... but then when he was sleeping she shaved his mustache and glued it on her face with super glue.... then the next morning... she wrote on Yahoo Answer... I WANT ACCESSORIES FOR MY MUSTACHE... and people made fun of her...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;now it's ur turn...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) HAHAH&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) we shall be the best of friends!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) ooooookkkk... u have problems...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) bye!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;My random quiz!!!?&lt;br&gt;1. d)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2.d)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. b)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4. c)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5. b)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P.S. the girl is your story is like my one and only idol!!!  (apart from Dr. Phil!!! DUHHH)&lt;br&gt;Reply:1. what would u say if i said i'm a girl and i want a mustache?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. That's nice? lol&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. how do u feel RIGHT THIS SECOND!!!!??&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. bored!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. HELLO!!!! how's it going?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. HI im ok... today was..... i like this animal... so on... so so on....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4. i like ducks&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. ok?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5.  Here i will write a story and you have to continue...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There once was a girl. She loved a boy.... for his mustache... in a way she was jealous... but then when he was sleeping she shaved his mustache and glued it on her face with super glue.... then the next morning... she wrote on Yahoo Answer... I WANT ACCESSORIES FOR MY MUSTACHE... and people made fun of her...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. ooooook... u have problems...&lt;br&gt;Reply:D- i dont relly, but i would say that&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c&lt;br&gt;Reply:c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and she stopped going on Yahoo Answers for the rest of her life.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d&lt;br&gt;Reply:Hahahaha how random and funny!&lt;br&gt;Reply:1.d) OMG! me 2! elt's be buddies!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2.e) i feel...how i feel&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3.b)Hi i'm ok....today was...i like this animal....so on...so on..&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4.b) ok&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5.e) (i made this answer up myself) omg.....i luv that story. brilliant....u should b an author...u could be on the New York Times Best Seller list.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and then the girl said she wanted a toupee.....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;lol&lt;br&gt;Reply:You have way too much time on your hands.&lt;br&gt;Reply:c, on the last question, oooooooooooooookkkk... u have problems... and d, bye!! YOUR FUNNY THOUGH, LOVE THE STORY!!! lol&lt;br&gt;Reply:b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c&lt;br&gt;Reply:I have no time time to waste over it.&lt;br&gt;Reply:1.WTF??&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2.bored&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3.leave me alone&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4.ok, just get the heck away from me&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5.you seriously do have problems&lt;br&gt;Reply:1.c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2.e&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3.d&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4.a&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5.a&lt;br&gt;Reply:1. b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4. c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5. a&lt;br&gt;Reply:Well, ok then...&lt;br&gt;Reply:. what would u say if i said i'm a girl and i want a mustache?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) that's nice&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. how do u feel RIGHT THIS SECOND!!!!??&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) bored&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. HELLO!!!! how's it going?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a)ok&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4. i like ducks&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) ok&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5. Here i will write a story and you have to continue...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There once was a girl. She loved a boy.... for his mustache... in a way she was jealous... but then when he was sleeping she shaved his mustache and glued it on her face with super glue.... then the next morning... she wrote on Yahoo Answer... I WANT ACCESSORIES FOR MY MUSTACHE... and people made fun of her...but she didn't mind in the least bit, infact she smiled at them, knowing that eventually, she will have the most stylish mustache in all of Narnia.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;now it's ur turn...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) we shall be the best of friends!!!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-3005332680686313597?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/3005332680686313597/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/my-random-quiz.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3005332680686313597'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3005332680686313597'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/my-random-quiz.html' title='My random quiz!!!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1898547275829997209</id><published>2009-07-14T22:08:00.002-07:00</published><updated>2009-07-14T22:08:44.779-07:00</updated><title type='text'>W4002-Set up a 95% confidence interval estimate of the population average number of shares traded for......?</title><content type='html'>The following table is a random sample of 18 stocks traded on the New York Stock Exchange as reported in the Cincinnati Enquirer (May 18, 1999). For each stock, the table lists the company name and the number of shares that traded hands on May 17, 1999. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Company Shares&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AllenTel 408700&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Banctec 29500&lt;br&gt;&lt;br /&gt;&lt;br /&gt;CDI 32500&lt;br&gt;&lt;br /&gt;&lt;br /&gt;CTS 36700&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Dover 169100&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Fluor 332000&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Grace 237700&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hartmx 49700&lt;br&gt;&lt;br /&gt;&lt;br /&gt;KCS 110300&lt;br&gt;&lt;br /&gt;&lt;br /&gt;LizClab 219400&lt;br&gt;&lt;br /&gt;&lt;br /&gt;NuvPP 50700&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Presly 133500&lt;br&gt;&lt;br /&gt;&lt;br /&gt;StJude 163500&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Scripps 27900&lt;br&gt;&lt;br /&gt;&lt;br /&gt;SunEng 63400&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Thai 67200&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Tyson 161800&lt;br&gt;&lt;br /&gt;&lt;br /&gt;YorkIn 120000&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(a) Set up a 95% confidence interval estimate of the population average number of shares traded for a company on the New York Stock Exchange on May 17, 1999.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(b) What sample size is needed if you want to be 95% confident of being correct to within :t:20,000 shares?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c) If you were to perform this study today, do you think that your answer to (b) is valid? Explain. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;THANKS!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;W4002-Set up a 95% confidence interval estimate of the population average number of shares traded for......?&lt;br&gt;I computed mean m=134088.89 and&lt;br&gt;&lt;br /&gt;&lt;br /&gt;standard deviation s=105878.03.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I know that the statististic &lt;br&gt;&lt;br /&gt;&lt;br /&gt;T=sqrt(n) * (X-134088.89)/105878.03&lt;br&gt;&lt;br /&gt;&lt;br /&gt;has a Student t-distribtuion with 18-1=17 degrees of freedom.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The table of the Student-t distribution gives the solution c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;of the equation. P(T%26gt;=c )-P(T%26lt;=-c) = 0.95, c =2.11&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So -2.11 %26lt;sqrt(n) * (X-134088.89)/105878.03%26lt;2.11&lt;br&gt;&lt;br /&gt;&lt;br /&gt;gives the interval.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I leave the rest to you!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1898547275829997209?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1898547275829997209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/w4002-set-up-95-confidence-interval.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1898547275829997209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1898547275829997209'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/w4002-set-up-95-confidence-interval.html' title='W4002-Set up a 95% confidence interval estimate of the population average number of shares traded for......?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1252885069630427759</id><published>2009-07-14T22:08:00.001-07:00</published><updated>2009-07-14T22:08:28.371-07:00</updated><title type='text'>This is a joint PDF question. (c) Draw up a table showing the joint probability function Px,y(x,y) of X and Y.</title><content type='html'>a random variable Y has probability function P(Y=2)= 0.6, P(Y=3)=0.2 and P(Y=4)=0.2.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;once Y has been observed, Y fair coins are tossed; let X denote the number of heads which are observed.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(a) Write downt the conditional expectation of X given Y= y, for each y=2,3,4.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;hence express E[X l Y] as a function of Y.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(b) Find E(Y) and use this to calculate E(X).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c) Draw up a table showing the joint probability function Px,y(x,y) of X and Y.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(d) find the marginal probability function of X and verify that the expectation of this distribution agrees with the value calculated in (b)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;This is a joint PDF question. (c) Draw up a table showing the joint probability function Px,y(x,y) of X and Y.&lt;br&gt;.. X ....... 0 ................. 1 ................ 2 ................ 3 ............... 4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Y=2 . (.25)(.6) ...... (.5)(.6) ........  (.25)(.6) ............ 0 .............. 0&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3 .... (.125)(.2) .... (.375)(.2) ...... (.375)(.2) ..... (.125)(.2) ...... 0&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4 ... (.0625)(.2) ..... (.25)(.2) ... (.375)(.2) . (.25)(.2) . (.0625)(.2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If y = 2, 0 head: 1/4 , 1 head: 2/4, 2 heads: 1/4 (then multiply 0.6)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If y = 3, 0 H: 1/8 , 1H: 3/8 , 2H: 3/8 , 3H: 1/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If y = 4: 0H: 1/16, 1H: 4/16 , 2H: 6/16 3H: 4/16 4H: 1/16&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Also, E[Y] = 2*.6 + 3*.2 + 4*.2 = 2.6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I had now given you the table. Multiply to get the values and use that to determine the rest of the answers. ©&lt;br&gt;Reply:a)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E[X|Y=2] = 0.5*2 = 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E[X|Y=3] = 0.5*3 = 1.5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E[X|Y=4] = 0.5*4 = 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E[X|Y=y] = 0.5*y&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E[Y] = 2*0.6 + 3*0.2 + 4*0.2 = 2.6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E[X] = E[ E[ X|Y ] ] = Sum over all y of E[X|Y=y]P[Y=y]  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1 * 0.6 + 1.5 * 0.2 + 2 * 0.2 = 1.3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;These are all found using the binomial distribution and mulitplied by P[Y=y]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Y = y   |  2_________3___________4_______total P[X= x]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X = 0  |  0.25*0.6____0.125*0.2____0.0625*0.2            &lt;br&gt;&lt;br /&gt;&lt;br /&gt;X = 1  |  0.5*0.6_____0.375*0.2____0.25*0.2        &lt;br&gt;&lt;br /&gt;&lt;br /&gt;X = 2  |  0.25*0.6____0.375*0.2_____0.375*0.2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X = 3  |  0_________0.125*0.2_____0.25*0.2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X = 4  |  0_________0___________0.0625*0.2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;total P[Y=y]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;to finish the table sum the columns to get P[Y=y] and sum the rows for P[X=x]&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://4song-downloads.blogspot.com/&gt;song downloads&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1252885069630427759?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1252885069630427759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/this-is-joint-pdf-question-c-draw-up.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1252885069630427759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1252885069630427759'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/this-is-joint-pdf-question-c-draw-up.html' title='This is a joint PDF question. (c) Draw up a table showing the joint probability function Px,y(x,y) of X and Y.'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2326940784617521616</id><published>2009-07-14T22:08:00.000-07:00</published><updated>2009-07-14T22:08:12.823-07:00</updated><title type='text'>A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use comput...?</title><content type='html'>A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers at home. Suppose a random sample of 81 U.S. adults gives a mean weekly computer usage time of 8.5 hours and that from prior studies, the population standard deviation is assumed to be σ = 3.6 hours.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Which of the following will provide a more informative (i.e., narrower) confidence interval than the one in problem 3?&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;(a)   Using a sample of size 400 (instead of 81).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(b)   Using a sample of size 36 (instead of 81).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c)   Using a different sample of size 81.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(d)   Using a 90% level of confidence (instead of 95%).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(e)   Using a 99% level of confidence (instead of 95%).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(f)    Both (a) and (d) are correct.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(g)   Both (a) and (e) are correct.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use comput...?&lt;br&gt;wow...lucky if someone bothers to answer this.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2326940784617521616?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2326940784617521616/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/study-was-conducted-in-order-to_7949.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2326940784617521616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2326940784617521616'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/study-was-conducted-in-order-to_7949.html' title='A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use comput...?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-886624241812825166</id><published>2009-07-14T22:07:00.003-07:00</published><updated>2009-07-14T22:07:56.760-07:00</updated><title type='text'>A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a</title><content type='html'>A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers at home. Suppose a random sample of 81 U.S. adults gives a mean weekly computer usage time of 8.5 hours and that from prior studies, the population standard deviation is assumed to be σ = 3.6 hours.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Question 2: &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Point value: 10 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Which of the following will provide a more informative (i.e., narrower) confidence interval than the one in problem 3?&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(a)   Using a sample of size 400 (instead of 81).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(b)   Using a sample of size 36 (instead of 81).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c)   Using a different sample of size 81.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(d)   Using a 90% level of confidence (instead of 95%).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(e)   Using a 99% level of confidence (instead of 95%).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(f)    Both (a) and (d) are correct.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(g)   Both (a) and (e) are correct.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a&lt;br&gt;F.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Smaller levels of confidence means smaller margins of error.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And more people surveyed reduces varience.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-886624241812825166?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/886624241812825166/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/study-was-conducted-in-order-to_14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/886624241812825166'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/886624241812825166'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/study-was-conducted-in-order-to_14.html' title='A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-8209186442458863010</id><published>2009-07-14T22:07:00.002-07:00</published><updated>2009-07-14T22:07:40.571-07:00</updated><title type='text'>At a large department store, the average number of years of service was 13.5 with a standard deviation of 6.2?</title><content type='html'>At a large department store, the average number of years of service was 13.5 with a standard deviation of 6.2 years. If an employee is picked at random, what is the probability that the employee has worked for the company for over 14 years?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. 0.0318&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; b. 0.0852&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; c. 0.1875&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; d. 0.2862&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; e. 0.4679&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; f. 0.6566&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; g. none of these&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;At a large department store, the average number of years of service was 13.5 with a standard deviation of 6.2?&lt;br&gt;To be employed for more than 14 years means the employee is employed for 0.5 years greater than the average.  0.5 represents 0.0806 standard deviations from the mean.  Looking up the z score you get .0321 (interpolating).  This means that there are .5321 below 14 years or .4679 at 14 years or more.  So the answer is e.&lt;br&gt;Reply:z = (X - μ) / σ&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;z = (14 - 13.5) / 6.2 ≈ 0.0806&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(z %26gt; 0.0806) ≈ 0.4679&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The answer is e.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-8209186442458863010?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/8209186442458863010/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/at-large-department-store-average.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8209186442458863010'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8209186442458863010'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/at-large-department-store-average.html' title='At a large department store, the average number of years of service was 13.5 with a standard deviation of 6.2?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-938614730496387553</id><published>2009-07-14T22:07:00.001-07:00</published><updated>2009-07-14T22:07:24.704-07:00</updated><title type='text'>A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a</title><content type='html'>A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers at home. Suppose a random sample of 81 U.S. adults gives a mean weekly computer usage time of 8.5 hours and that from prior studies, the population standard deviation is assumed to be σ = 3.6 hours.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;We are 95% confident that the mean number of weekly hours that U.S. adults use computers at home is:&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(a)   between 8.1 and 8.9.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(b)   between 7.8 and 9.2.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c)   between 7.7 and 9.3.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(d)   between 7.5 and 9.5.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(e)   between 7.3 and 9.7.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a&lt;br&gt;95% confidence is a bit less than +/- two standard deviations. The population standard deviation must be divided by the square root of the sample size to get the sample standard deviation.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The range is thus the sample mean +/- 2(σ/sqrt(n))&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;8.5 +/- 2 * 3.6 / sqrt(81)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;8.5 +/- (7.2 / 9)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;8.5 +/- 0.8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c) between 7.7 and 9.3&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://sending-flowers2.blogspot.com/&gt;sending flowers&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-938614730496387553?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/938614730496387553/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/study-was-conducted-in-order-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/938614730496387553'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/938614730496387553'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/study-was-conducted-in-order-to.html' title='A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6926082308421270775</id><published>2009-07-14T22:07:00.000-07:00</published><updated>2009-07-14T22:07:08.632-07:00</updated><title type='text'>Well...GCSE's start in a week - lots of Random Questions...?</title><content type='html'>Couple of general questions on a number of subjects...any answers be great...?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Idea's in Context for the Sciences - any good ways to prepare for them?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Spanish - did really well Foundation Speaking, I'd say quite good quality writing in the coursework (no written exams, 3 coursework pieces) - worst case it'd be a 'C' - just wondering what Raw marks I may need to aim in Listening and Reading to get a 'C' at least overall...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Science Additional - similar question, got A* and 100% A* on first of the two modulars, wondering what would get me a good B/A in the final bits....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Finally - just out of interest really, how many hours would be recommended a night after school...I've been doing about 2 hours a night up until now - up it now?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Yes I know, all very random...but anyone can answer any of these may be able to put my mind at ease =)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Best of Luck to all those doing there exams soon =]&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Well...GCSE's start in a week - lots of Random Questions...?&lt;br&gt;Spanish - just try your hardest but to be honest if its worst case C then it should be pretty easy for you&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Science - same as before should be pretty easy although don't relax still keep working hard and you should fly through it&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Finally - If you are revising at dinner times at school then stay about 2 hours a night, but if you arn't then probably go to about 3 hours&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Good luck!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6926082308421270775?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6926082308421270775/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/wellgcses-start-in-week-lots-of-random.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6926082308421270775'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6926082308421270775'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/wellgcses-start-in-week-lots-of-random.html' title='Well...GCSE&apos;s start in a week - lots of Random Questions...?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4503537159587819138</id><published>2009-07-14T22:06:00.003-07:00</published><updated>2009-07-14T22:06:53.063-07:00</updated><title type='text'>The table below shows the number of tests taken by 30 randomly selected college sophomores?</title><content type='html'>Number of tests taken/ Number of students &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;0/12&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3/3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4 or more/5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;______________________________________...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If a student is selected at random, find the probability&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a)the student has taken exactly two tests&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b)the student has taken at least two tests&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)the student has taken at most three tests&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d)the student has taken 3 or fewer tests&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e)the student has taken one or two tests.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;The table below shows the number of tests taken by 30 randomly selected college sophomores?&lt;br&gt;so we know our sample isze is 30 making n=30. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Lets start with a.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2 students took 2 tests so P = 2/n = 2/30 = 1/15&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) At least 2 tests means you could have take 2 or 3 or 4 or more.  Thus,&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P = (2+3+5)/n = (10)/30 = 1/3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) At most three tests means 0, 1, 2, or 3., thus:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P= (12+8+2+3)/n = 25/30 = 5/6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) If you have taken 3 or fewer tests, that is the same as at most three tests so the answers is the same as c.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3) One or two tests is when using th elogic above.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P = (8+2)/30 = 1/3&lt;br&gt;Reply:a) 6.67%   2/30 students&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b)33.33%  10/30 students&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)83.33%  25/30 students&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d)83.33%  25/30 students&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e)33.33%  10/30 students&lt;br&gt;Reply:a) 2 people have taken 2 tests = 2/30&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) 12 have 0 tests, 8 have 1 = 20 have taken less than 2 meaning 30-20 = 10 have taken at least 2 p =10/30&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) 5 have taken 4 or more 30-5 = 25 = number who have taken at most 3  p =25/30&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) same as c.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e) 8 have 1 and 2 have 2  = 10/30&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4503537159587819138?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4503537159587819138/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/table-below-shows-number-of-tests-taken.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4503537159587819138'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4503537159587819138'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/table-below-shows-number-of-tests-taken.html' title='The table below shows the number of tests taken by 30 randomly selected college sophomores?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-8367804152456175237</id><published>2009-07-14T22:06:00.002-07:00</published><updated>2009-07-14T22:06:36.713-07:00</updated><title type='text'>What is the mean of Z, the expected total number of individuals (males and females) who are colorblind?</title><content type='html'>Here is what is given:Colorblindness is any abnormality of the color vision system that causes a person to see colors differently than most people or to have difficulty distinguishing among certain colors (www.visionrx.xom).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Colorblindness is gender-based with the majority of sufferers being males.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Roughly 8% of white males have some form of colorblindness, while the incidence among white females is only 1%.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A random sample of 20 white males and 40 white females was chosen.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let X be the number of males (out of the 20) who are colorblind.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let Y be the number of females (out of the 40) who are colorblind.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let Z be the total number of colorblind individuals in the sample (males and females together).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Answers:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(a)   .4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(b)   1.6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c)   2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(d)   2.7&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(e)   The mean of Z cannot be determined.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hint: Express Z in terms of X and Y and then apply rules for means.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;What is the mean of Z, the expected total number of individuals (males and females) who are colorblind?&lt;br&gt;The answer is (c)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let X be a random variable with mean μx and variance σx². Let a, and b be constants.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let W = aX + b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The mean of W, E(W) = μw is:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(W) = E(aX + b)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= E(aX) + b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= aE(X) + b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;in this case we have Z = X + Y&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X) = 20 * 0.08 = 1.6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(Y) = 0.4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(Z) = 1.6 + 0.4 = 2.0&lt;br&gt;Reply:Since it affects 8% of white males (X), and 1% of white females (Y), then the average number of people (Z), both genders, that are infected will be&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Z = 0.08X + 0.01Y&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Z = 0.08(20) + 0.01(40)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Z = 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I would have to say c is the answer.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hope that helps!!!!!!&lt;br&gt;Reply:The expectation should just be the weight(probability) multiply by the amount of people.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Mean of X is :  (.08*20)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Mean of Y is :  (.01*40)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Mean of Z is the addition of the mean of Y and the mean of X&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;μ_z = μ_x + μ_y&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;μ_z = (.08*20) + (.01*40) = 2&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-8367804152456175237?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/8367804152456175237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/what-is-mean-of-z-expected-total-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8367804152456175237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8367804152456175237'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/what-is-mean-of-z-expected-total-number.html' title='What is the mean of Z, the expected total number of individuals (males and females) who are colorblind?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1733330745427267997</id><published>2009-07-14T22:06:00.001-07:00</published><updated>2009-07-14T22:06:20.501-07:00</updated><title type='text'>Women how would you feel if a random guy came up to u and asked?</title><content type='html'>a bunch of random questions? &lt;br&gt;&lt;br /&gt;&lt;br /&gt;so a guy comes up 2 u, a guy u dont no and says Hi, I wanna ask u something. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Guy-So do u watch Jay Leno? &lt;br&gt;&lt;br /&gt;&lt;br /&gt;You-Does't matter what answer u give&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Guy-well on jay leno Steve Schirripa from sopranos does this thing were he would walk around LA and try to guess what ppl do for a living, how long they been working, and if their single or not basically can u judge a book by its cover. its just a game im not tryin to pick u up im just tryin to read ppl well so&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;you are currently single &lt;br&gt;&lt;br /&gt;&lt;br /&gt;or &lt;br&gt;&lt;br /&gt;&lt;br /&gt;you are currently seeing someone&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and you work at etc and you been workin there for x amount&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;this question is if yur single) so since yur single if i asked for yur number and a date you would problay say a)Yes or b)No&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;how would u feel if a guy u dont no asked u this? keep in mind this guy just wants to c if he can read ppl well not score. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;would u answer TRUTHFULLY to all the questions esp the so since yur single? u wouldnt just say yur seein some 1 to&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Women how would you feel if a random guy came up to u and asked?&lt;br&gt;No, I wouldn't answer him truthfully.  I won't give out information on myself just because he's trying to see if he can read people well.   There are a lot of dangerous people out there and how do we know that he's not one of them.  I'm just trying to be cautious.  And if he does ask me all those questions all I have to say is, "Wow, you sure know your Jay Leno but I bet you didn't know that I would not want to be one of your test subjects.  So why don't you just go ask someone else.  Goodbye."  Then if he still doesn't leave, I'm gonna call security.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://4send-flowers.blogspot.com/&gt;send flowers&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1733330745427267997?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1733330745427267997/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/women-how-would-you-feel-if-random-guy.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1733330745427267997'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1733330745427267997'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/women-how-would-you-feel-if-random-guy.html' title='Women how would you feel if a random guy came up to u and asked?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4918630287315685304</id><published>2009-07-14T22:06:00.000-07:00</published><updated>2009-07-14T22:06:04.564-07:00</updated><title type='text'>Another C++ input question; cin and strings.?</title><content type='html'>K so if someone has a compiler on them they may be able to tell me or if you know anyway;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Suppose I declare an array of 5 strings.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;vector%26lt;string%26gt; word(5);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The I use cin to input values saying;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cin%26gt;%26gt;word(0)%26gt;%26gt;word(1)%26gt;%26gt;word(2)%26gt;%26gt;word(3...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;When the program runs and I am prompted for input I write.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"     apples            bear  lemon  party      "&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;With all these spaces in there, will C pick out the words and store them in their respective string variables?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Are the vals:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;word(0) is "apples"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;word(1) is "bear"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;word(2) is "lemon"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;word(3) is "party"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;-What is word(4), is it " " ie a single space, is is a number of spaces, or is it some weird thing without a value or a random value?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Can I use a simple if statement to check for such blanks?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if(word.at(4) == ' ') %26lt; does this actually tell me if it's blank?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Another C++ input question; cin and strings.?&lt;br&gt;word(4) will be whatever the default value for a vector is. You can't accept whitespace in cin, for that you need to use getline. However comparing word(4) == "" will tell if it is an empty string.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Also be careful with strings and characters:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;" - for strings&lt;br&gt;&lt;br /&gt;&lt;br /&gt;' - for characters&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4918630287315685304?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4918630287315685304/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/another-c-input-question-cin-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4918630287315685304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4918630287315685304'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/another-c-input-question-cin-and.html' title='Another C++ input question; cin and strings.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-181073767249007586</id><published>2009-07-14T22:05:00.003-07:00</published><updated>2009-07-14T22:05:48.626-07:00</updated><title type='text'>Find the standard deviation of the random variable.?</title><content type='html'>Find the standard deviation of the random variable. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;A couple plans to have children until they get a boy, but they agree that they will not have more than four children even if all are girls. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Find the standard deviation of the number of children the couple have. Assume that boys and girls are equally likely. Round your answer to three decimal places. &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. 1.109 &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. 0.992 &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. 0.984 &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. 1.053 &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;e. 1.173&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Find the standard deviation of the random variable.?&lt;br&gt;Let X be the number of children.  The possible values for X and the corresponding probabilities are&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;x...............P(X = x)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1 (B)............1/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2 (GB).........1/4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3 (GGB)......1/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4 (GGGB).. 2/16 = 1/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;or (GGGG)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The SD(X) is the square root of the variance of X (Var(X)).  The variance is equal to &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Var(X) = E(X^2) - (E(X))^2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So we need E(X) and E(X^2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X) = 1*(1/2) + 2*(1/4) + 3*(1/8) + 4*(1/8) = 15/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X^2) = 1*(1/2) + 4*(1/4) + 9*(1/8) + 16*(1/8) = 37/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Var(X) = 37/8 - (15/8)^2 = 71/64&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;SD(X) = sqrt(71/64) = 1.053.   So, answer (D)!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Math (and Stats) Rule!&lt;br&gt;Reply:Let X be the number of children. The possible values for X and the corresponding probabilities are&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;x...............P(X = x)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1 (B)............1/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2 (GB).........1/4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3 (GGB)......1/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4 (GGGB).. 2/16 = 1/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;or (GGGG)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The SD(X) is the square root of the variance of X (Var(X)). The variance is equal to &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Var(X) = E(X^2) - (E(X))^2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So we need E(X) and E(X^2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X) = 1*(1/2) + 2*(1/4) + 3*(1/8) + 4*(1/8) = 15/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X^2) = 1*(1/2) + 4*(1/4) + 9*(1/8) + 16*(1/8) = 37/8&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Var(X) = 37/8 - (15/8)^2 = 71/64&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;SD(X) = sqrt(71/64) = 1.053. So, answer (D)!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-181073767249007586?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/181073767249007586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/find-standard-deviation-of-random_14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/181073767249007586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/181073767249007586'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/find-standard-deviation-of-random_14.html' title='Find the standard deviation of the random variable.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2367306607841246848</id><published>2009-07-14T22:05:00.002-07:00</published><updated>2009-07-14T22:05:32.767-07:00</updated><title type='text'>C++ Assistance, Involving reading file, calculating average, sum (running total), amount of numbers?</title><content type='html'>I also couldn't figure out how do do this one.  It's the last one I have to do, I promise ;).  It involves doing stuff with a text file (which I uploaded onto the internet).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The question goes like this:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Student Cd contains a file named random.txt [I uploaded it to http://d01.megashares.com/?d01=3251418].  This file contains a long list of random numbers.  Copy the file to your hard drive and then write a program that opens the file, reads all the numbers from the file, and calculates the following:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A)  The number of numbers in the file&lt;br&gt;&lt;br /&gt;&lt;br /&gt;B)  The sum of all the numbers in the file ( a running total)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;C)  The average of all the numbers in the file&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The program should display the numbers of numbers found in the file, the sum of the numbers, and the average of the numbers.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I really appreciated the help, I wish they had more examples in the book for this stuff.  Thanks for taking the time.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++ Assistance, Involving reading file, calculating average, sum (running total), amount of numbers?&lt;br&gt;Here you go:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;// For this program to work, you have to place the random.txt&lt;br&gt;&lt;br /&gt;&lt;br /&gt;// file in the same folder where your program is. Otherwise,&lt;br&gt;&lt;br /&gt;&lt;br /&gt;// change the location of the file below&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;// I am also assuming that you can use arrays. Let me know if&lt;br&gt;&lt;br /&gt;&lt;br /&gt;// you have to use linked lists.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iostream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;fstream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt; const int MAX_SIZE = 210;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; ifstream inFile;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; int number;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; int array[MAX_SIZE];&lt;br&gt;&lt;br /&gt;&lt;br /&gt; int currentIndex = -1;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; int sum = 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; inFile.open("random.txt");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; if(!inFile.fail())&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    while(inFile %26gt;%26gt; number %26amp;%26amp; currentIndex %26lt; MAX_SIZE)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        currentIndex++;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        array[currentIndex] = number;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        sum += number;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    inFile.close();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;   cout %26lt;%26lt; "The file contains: (" %26lt;%26lt; currentIndex + 1 %26lt;%26lt; ") numbers" %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  cout %26lt;%26lt; "The sum of all numbers is: " %26lt;%26lt; sum %26lt;%26lt; endl; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  cout %26lt;%26lt; "The average is: " %26lt;%26lt; (double) sum / (double) (currentIndex + 1) %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;else&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    cout %26lt;%26lt; "Couldn't open random.txt" %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt; return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;Reply:I guess you don't want us to do your homework for you, please specify what you don't know to do here.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hints:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;File IO read in:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.cplusplus.com/doc/tutorial/fi...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;have two variables: int counter = 0, sum = 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for every new number counter++;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for every new number sum += number;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A is counter&lt;br&gt;&lt;br /&gt;&lt;br /&gt;B is sum&lt;br&gt;&lt;br /&gt;&lt;br /&gt;C is sum / counter&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2367306607841246848?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2367306607841246848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-assistance-involving-reading-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2367306607841246848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2367306607841246848'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-assistance-involving-reading-file.html' title='C++ Assistance, Involving reading file, calculating average, sum (running total), amount of numbers?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1991482417928986560</id><published>2009-07-14T22:05:00.001-07:00</published><updated>2009-07-14T22:05:17.116-07:00</updated><title type='text'>IPOD/iTunes Question!  How to create random playlist?</title><content type='html'>Hello all...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So this is the problem I'm having.  I have an iPod Mini (4GB) and 13.41 GB (growning daily as I input more songs into iTunes from my hdd) in my iTunes library.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;What I don't want to do is be left to make decisions about what songs to put on my iPod.  It gets too difficult in cutting the last few.  So, if there was a way to randomize a playlist (containing a set number of songs) that'd help me out a lot.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I don't particulary care what songs are on my iPod b/c i like all the songs I have.  But I'd like a wide selection.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I tried making a smart playlist w/ the following settings, but it did not work:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Grouping contain's "Music" (all my songs have that grouping)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Limit to 680 songs selected randomly&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Live Updating&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The results weren't particularly random.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I'm using a Win XP computer.  So, if there is some apple script that would help me, it wont work.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Thanks for the help.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;IPOD/iTunes Question!  How to create random playlist?&lt;br&gt;Wikipedia.com has basically the answer up there, just type the search&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Good luck with it and have a good day!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://1quince.blogspot.com/&gt;quince&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1991482417928986560?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1991482417928986560/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/ipoditunes-question-how-to-create.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1991482417928986560'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1991482417928986560'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/ipoditunes-question-how-to-create.html' title='IPOD/iTunes Question!  How to create random playlist?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1165066306594133331</id><published>2009-07-14T22:05:00.000-07:00</published><updated>2009-07-14T22:05:00.654-07:00</updated><title type='text'>C probs..PLS HELP!!!!!!!?</title><content type='html'>how can i create a program that randomly add or subtract a number? example 3+2 or 10-3, i want the operation to be random...I already figure out the numbers, this is my only problem  and that is to randomize the addition and subtraction operation...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;btw the file extension is .c...tnx help you could help me... :)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C probs..PLS HELP!!!!!!!?&lt;br&gt;Im not that good in programming but i think you should get the ascii value for the operators and let the random function operate within those values. (not sure)&lt;br&gt;Reply:Have a random number between 0 and 1.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If 0 then add&lt;br&gt;&lt;br /&gt;&lt;br /&gt;else subtract.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Don't make it any more complicated.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1165066306594133331?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1165066306594133331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-probspls-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1165066306594133331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1165066306594133331'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-probspls-help.html' title='C probs..PLS HELP!!!!!!!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-122859824666690804</id><published>2009-07-14T22:04:00.002-07:00</published><updated>2009-07-14T22:04:44.487-07:00</updated><title type='text'>Statistics problem...?</title><content type='html'>A random number generator is used to generate a real number at random between 0 and 1, equally likely to fall anywhere in this interval of values. (For instance, 0.3794259832...is a possible outcome.)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. Sketch a curve of the probability distribution of this random variable, which is the continuous version of the uniform distribution.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. What is the mean of this probability distribution?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. Find the probability that this random variable falls between 0.25 and 0.75.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;*Note:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The mean of a probability distribution for a discrete random variable is&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;µ = Σ x P(x)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;where the sum is taken over all possible values of x.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Statistics problem...?&lt;br&gt;a)  The curve of the pdf is a straight line at y=1 going from x=0 to x=1.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b)  The mean is (1-0)/2 = 0.5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)  P(0.25%26lt;= x %26lt;= 0.75) = 0.75-0.25 = 0.50&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-122859824666690804?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/122859824666690804/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statistics-problem.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/122859824666690804'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/122859824666690804'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statistics-problem.html' title='Statistics problem...?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1061406657060551913</id><published>2009-07-14T22:04:00.001-07:00</published><updated>2009-07-14T22:04:28.820-07:00</updated><title type='text'>Probabality questions below need help fast is about discrete random varibles and probablity distributions?</title><content type='html'>the college board reports 2% of the 2 million high school students who take the SAT each yr get special accomadations because of documented disablities. consider a random variable of 25 students who have tkaen the test&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) what is the probablity that exactly 1 recieved special accomadation?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) what is the probablity that least1 recieved special accomadation?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) what is the probablity that at least 2 recieved special accomadation?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d)what is the probablity that the number among the 25 who recieve a special accomodation is within 2 deviations of the number you would expect to be accomadated?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e)suppose that a student who does ot recieve a special accodadtion is allowed 3 hrs for the exam, where as an accomodated student is allowed 4.5 hrs. what would you expect the average time allowed the 25 students to be?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Probabality questions below need help fast is about discrete random varibles and probablity distributions?&lt;br&gt;Let X be the number of student who receive special accommodations. X has the binomial distribution with n = 25 trails and success probability p = 0.02&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;In general, if X has the binomial distribution with n trials and a success probability of p then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X = x] = 0 for any other value of x.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;this is found by looking at the number of combination of x objects chosen from n objects and then a total of x success and n - x failures.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) P(X = 1) = 0.3078902&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) P(X ≥ 1) = 1 - P(X = 0) = 1 - 0.6034647&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 0.3965353&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) P(X ≥ 2) = 1 - (P(X = 0) + P(X = 1))&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1 - (0.60346473 + 0.30789017)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 0.0886451&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) the mean of the binomial is n * p = 25 * 0.02 = 0.5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the variance is n * p * (1-p) = 0.49&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the standard deviation is the square root of the variance = 0.7&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(0.5 - 2 * 0.7 ≤ X ≤ 0.5 + 0.2 * 0.7)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= P( -0.9 ≤ X ≤ 1.9)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;since you have a discrete random variable the fractions are not possible&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= P( 0 ≤ X ≤ 1) = P(X = 0) + P(X = 1) = 0.9113549&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e) 24.5 students will take the exam in 3 hours, 0.5 students will take the exam in 4.5 hours, the average time is:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(24.5 * 3 + 0.5 * 4.5) / 25 = 3.03 hours&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;this is a good example of a weighted mean.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1061406657060551913?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1061406657060551913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/probabality-questions-below-need-help_14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1061406657060551913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1061406657060551913'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/probabality-questions-below-need-help_14.html' title='Probabality questions below need help fast is about discrete random varibles and probablity distributions?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6838618327098712051</id><published>2009-07-14T22:04:00.000-07:00</published><updated>2009-07-14T22:04:13.612-07:00</updated><title type='text'>Probabality questions below need help fast is about discrete random varibles and probablity distributions?</title><content type='html'>the college board reports 2% of the 2 million high school students who take the SAT each yr get special accomadations because of documented disablities. consider a random variable of 25 students who have tkaen the test&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) what is the probablity that exactly 1 recieved special accomadation?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) what is the probablity that least1 recieved special accomadation?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) what is the probablity that at least 2 recieved special accomadation?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d)what is the probablity that the number among the 25 who recieve a special accomodation is within 2 deviations of the number you would expect to be accomadated?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e)suppose that a student who does ot recieve a special accodadtion is allowed 3 hrs for the exam, where as an accomodated student is allowed 4.5 hrs. what would you expect the average time allowed the 25 students to be?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Probabality questions below need help fast is about discrete random varibles and probablity distributions?&lt;br&gt;Let X be the number of student who receive special accommodations.  X has the binomial distribution with n = 25 trails and success probability p = 0.02&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;In general, if X has the binomial distribution with n trials and a success probability of p then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X = x] = 0 for any other value of x.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;this is found by looking at the number of combination of x objects chosen from n objects and then a total of x success and n - x failures.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) P(X = 1) = 0.3078902&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) P(X ≥ 1) = 1 - P(X = 0) = 1 - 0.6034647 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 0.3965353&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) P(X ≥ 2) = 1 - (P(X = 0) + P(X = 1)) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1 - (0.60346473 + 0.30789017)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 0.0886451&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) the mean of the binomial is n * p = 25 * 0.02 = 0.5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the variance is n * p * (1-p) = 0.49&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the standard deviation is the square root of the variance = 0.7&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(0.5 - 2 * 0.7 ≤ X ≤ 0.5 + 0.2 * 0.7)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= P( -0.9 ≤ X ≤ 1.9)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;since you have a discrete random variable the fractions are not possible&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= P( 0 ≤ X ≤ 1) = P(X = 0) + P(X = 1) =  0.9113549&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e) 24.5 students will take the exam in 3 hours, 0.5 students will take the exam in 4.5 hours, the average time is:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(24.5 * 3 + 0.5 * 4.5) / 25 = 3.03 hours&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;this is a good example of a weighted mean.&lt;br&gt;Reply:a) 25C1 * (.02) * (.98)^24 = p(exactly 1 student)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) 1 - p(no students received accomodation)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) 1 - p(0 students) - p(1 student)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) 25 is close to 30, so you can use standard distribution table to look up that value. 2 * (value at 2 standard dev - .5)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3) [(.98)*3 + (.02)*4]/25&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://2garden-centre.blogspot.com/&gt;garden centre&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6838618327098712051?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6838618327098712051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/probabality-questions-below-need-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6838618327098712051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6838618327098712051'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/probabality-questions-below-need-help.html' title='Probabality questions below need help fast is about discrete random varibles and probablity distributions?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-788706609273835169</id><published>2009-07-14T22:03:00.003-07:00</published><updated>2009-07-14T22:03:56.705-07:00</updated><title type='text'>Statistics...Uniform distribution?</title><content type='html'>A random number generator is used to generate a real number at random between 0 and 1, equally likely to fall anywhere in this interval of values.  (For instance, 0.3794259832...is a possible outcome.)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. Sketch a curve of the probability distribution of this random variable, which is the continuous version of the uniform distribution.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b.  What is the mean of this probability distribution?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c.  Find the probability that this random variable falls between 0.25 and 0.75.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;*Note:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The mean of a probability distribution for a discrete random variable is&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;µ = Σ x P(x)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;where the sum is taken over all possible values of x.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Statistics...Uniform distribution?&lt;br&gt;f(x)=1, 0 %26lt; x %26lt; 1 is the probability density function of the random variable x.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;More generally, it is f(x)=1/(b-a) a %26lt; x %26lt; b; Here b=1 and a=0.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The source shows a sketch.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) mean = integral (0 to 1) xdx&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=x^2/2 (0 to 1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)integral( 0.25 to 0.75) dx&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=x (between limits 0.25 and 0.75)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=0.75-0.25=0.50&lt;br&gt;Reply:f(x)=1,  0 %26lt; x %26lt; 1 is the probability density function of the random variable x.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;More generally, it is f(x)=1/(b-a) a %26lt; x %26lt; b; Here b=1 and a=0.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The source shows a sketch.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) mean = integral (0 to 1) xdx&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=x^2/2 (0 to 1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)integral( 0.25 to 0.75) dx&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=x (between limits 0.25 and 0.75)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=0.75-0.25=0.50&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Here, we are dealing with a continuous (not discrete) random variable.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-788706609273835169?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/788706609273835169/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statisticsuniform-distribution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/788706609273835169'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/788706609273835169'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/statisticsuniform-distribution.html' title='Statistics...Uniform distribution?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1600147699178384633</id><published>2009-07-14T22:03:00.002-07:00</published><updated>2009-07-14T22:03:41.079-07:00</updated><title type='text'>Anime Poll #51 (Anime Week-"Random" Day)?</title><content type='html'>What do you usually type when you see something funny in Yahoo Answers?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A) LOL&lt;br&gt;&lt;br /&gt;&lt;br /&gt;B) ROFL&lt;br&gt;&lt;br /&gt;&lt;br /&gt;C) LMAO&lt;br&gt;&lt;br /&gt;&lt;br /&gt;D) * make faces like XD *&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E) Muahahahahaha&lt;br&gt;&lt;br /&gt;&lt;br /&gt;F) Depends on how funny it is.....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;G) Cookie and Bunny rule!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;H) Type nothing.......&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I) None of the above (and state what you usually type)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I usually type LOL, or LOLOLOLOLOL, or make faces, or type ROFL!!! XDDD&lt;br&gt;&lt;br /&gt;&lt;br /&gt;That's choices A, B, D, and E. I also type other stuff like LMAO (choice C) and Muahahaha!!! (choice E)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;How 'bout you?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(By the way, broke the world record of the highest number of choices in DarthRaider666's Anime Poll)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;.......GOTTA STAY TUNED 4 DA NEXT "RANDOM" QUESTION!!!! %26gt;:D&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Anime Poll #51 (Anime Week-"Random" Day)?&lt;br&gt;G!!!!!!!....they rule the world!!!!!!&lt;br&gt;Reply:d&lt;br&gt;Reply:D AND E&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;-CHIBUNNY&lt;br&gt;Reply:hm...depends:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;i usually put either:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;lol!!!~&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and make the XD face ...^-^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the mwahahaha is for something evil i'm planning on doing...hehehe....*laughs suspiciously*&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;brownies and pikcahu rule~ lol [= jk&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;so today's random day?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;are you gonna do Naruto's day?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;wait, i wasn't active yesterday all day-long, so what was yesterday's? O.o&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and tomorrow shall be Death Note XP &lt;br&gt;&lt;br /&gt;&lt;br /&gt;or no??? &lt;br&gt;&lt;br /&gt;&lt;br /&gt;*confused*&lt;br&gt;Reply:A and D&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Somes I make ^^ instead of xD&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Lol! Wouldn't it DarthRaider666's records not world records?&lt;br&gt;Reply:C! All The Way! &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;LMAO. I Even Say it In Real Life, But Not L-M-A-O&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I Say The Real Words.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Like "I was laughing my a$$ off!!"&lt;br&gt;Reply:[secretly holding spot^^]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;stupid trolls better not rat me out&lt;br&gt;&lt;br /&gt;&lt;br /&gt;^_^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;D)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;G)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;F)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;thats pretty much what i do&lt;br&gt;&lt;br /&gt;&lt;br /&gt;^_^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;this is definitely my trade mark&lt;br&gt;&lt;br /&gt;&lt;br /&gt;though [along with.........LOL]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(\ /)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;( . .)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;C(")(")&lt;br&gt;&lt;br /&gt;&lt;br /&gt;bunny supporter for life^^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;or.........&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;^_^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;or..........[like i stated earlier]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;i do this:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;^_^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;or at the end of what i type i put these little things^^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;[edit]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;DANGET DEIDARA!!!!!!!!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;beat me by 17 seconds........LOL&lt;br&gt;&lt;br /&gt;&lt;br /&gt;[irony SUCKS!!!!!]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;LOL&lt;br&gt;Reply:i'll say A and C&lt;br&gt;Reply:Well, I'm random and everyone knows that about me....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Unless you're a newbie....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I PICK I~!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I say (or type) this....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;~ ^^ ~&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;It's a wittle bwushing guy~!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AWWW~!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P.S-&lt;br&gt;&lt;br /&gt;&lt;br /&gt; ME A BLEACH FAN~!!! GO HITSUGAYA~!!! GO RUKIA~!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;GO A LOT OF OTHER PEOPLE IN BLEACH~!!!&lt;br&gt;Reply:Bleach for tomorrow.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Oh and I usually type 'LOL'.&lt;br&gt;Reply:D) XD&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Heh heh heh......... what about Kirby with his katana.... I'm going to start using that. Why? Just because. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Remember! Tomorrow is Death Note! Let's make some apples!.........................&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;^_^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Wait... how do you make apples?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EDIT: Drat! I still want to find out how to make apples... there's GOT TO BE A WAY!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EDIT: Talrimk- Yesterday was Naruto Day! You missed it! :(&lt;br&gt;Reply:A BLEACH FAN IS HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I ALSO PICK BLEACH DAY TOMORROW !!!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Did you get that Bleach Day e-mail I sent you, two days ago, I do believe it was ???????????????????&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A, B, C and D !!!!!!!!!!!!!!!!!!!!!!&lt;br&gt;Reply:D) XD&lt;br&gt;Reply:depends, but i use:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;lol, lmao, rofl, faces like xD x] =] =D ^^ etc or bwahahaha ^^&lt;br&gt;Reply:D and E. Evil laughter is my specialty. %26gt;:D&lt;br&gt;Reply:a g or f&lt;br&gt;Reply:A.&lt;br&gt;Reply:I do A: LOL&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;LOL!&lt;br&gt;Reply:D) XD ^-^ %26gt;.%26lt;&lt;br&gt;Reply:Usually just 'XD' because that smiley face is amazing. ^^&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Art is a bang!! XD&lt;br&gt;Reply:A or B&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1600147699178384633?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1600147699178384633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/anime-poll-51-anime-week-random-day.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1600147699178384633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1600147699178384633'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/anime-poll-51-anime-week-random-day.html' title='Anime Poll #51 (Anime Week-&quot;Random&quot; Day)?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5797593304065247035</id><published>2009-07-14T22:03:00.001-07:00</published><updated>2009-07-14T22:03:21.978-07:00</updated><title type='text'>I'm trying to write a game program and have problems.?</title><content type='html'>Ok heres my deleima, I am tring to write a MUD with C++ and have a problem with random numbers. I want a random number not pseudorandom, between 1-100, what would be the best way to get a number in that range?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;I'm trying to write a game program and have problems.?&lt;br&gt;You'll never get a truly random number from a computer, because everything in computers is generated by an algorithm. Pseudorandom numbers are, however, for all intents and purposes, random. For info on how to do what you are asking about, see this article: http://cplus.about.com/od/advancedtutori...&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5797593304065247035?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5797593304065247035/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/im-trying-to-write-game-program-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5797593304065247035'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5797593304065247035'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/im-trying-to-write-game-program-and.html' title='I&apos;m trying to write a game program and have problems.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6084077769460798750</id><published>2009-07-14T22:03:00.000-07:00</published><updated>2009-07-14T22:03:00.102-07:00</updated><title type='text'>Which of the following is not a source of variation of alleles?,the frequencies of four alleles of a trait?</title><content type='html'>Choices for first one are:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a.crossing over during meiosis&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. the number of alleles during meiosis&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. recombination during meiosis&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. independent assortment in meiosis&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2nd one:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. 100%&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. 25%&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. 50%&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. 75%&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Other questions:&lt;br&gt;&lt;br /&gt;&lt;br /&gt; Two factors that contribute to evolution&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. genetic recombination and population&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. species and population &lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. inbreeding and population&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. mutation and genetic recombination&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Gene frequencies are not affected by &lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. frequent mutation &lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. natural selection&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. random mating&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. genetic drift&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Small population have many problems maintaining stable numbers, partly becasue of &lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. artificial selection &lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. the founder effect&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. inbreeding depression&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. limited resources&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A change in allele  frequencies is more likely to produce &lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. microevolution&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. inbreeding&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. mutation&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. macroevolution&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Gene flow promotes evolution through&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. selective breeding &lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. inbreeding&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. mutation in species&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. migration between gene pools&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Which of the following is not a source of variation of alleles?,the frequencies of four alleles of a trait?&lt;br&gt;I sure hope this isn't your homework that I'm answering, haha.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1. (b) Number of alleles is predetermined. Crossing over is not correct because "chromatids break and may be reattached to a different homologous chromosome." (Thinkquest.) Recombination is basically the same thing, and in independent assortment the chromosomes that end up in a newly-formed gamete are randomly sorted from all possible combinations of maternal and paternal chromosomes, so that's not right.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. (b) 100/4 = 25%&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. (d) Mutations help a population with survival by letting the ones with more environment-adaptive traits to prevail (Natural selection) and genetic recombination allows with genetic diversity and phenotypical diversity, which also ties into natural selection. Species and population do not contribute to evolution. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4. (c) Random mating is when two organisms make without regards to genotype. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5. (c) Inbreeding depression. Inbreeding makes more disadvantageous recessive traits show up in a population, causing numbers to fluctuate.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;6. (a) Macroevolution is when you have something as drastic as a new species. Microevolution is evolution within a species. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;7. (d) Definition of gene flow is basically "the transfer of alleles of genes from one population to another." (Wikipedia)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://2flower-show.blogspot.com/&gt;flower show&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6084077769460798750?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6084077769460798750/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/which-of-following-is-not-source-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6084077769460798750'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6084077769460798750'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/which-of-following-is-not-source-of.html' title='Which of the following is not a source of variation of alleles?,the frequencies of four alleles of a trait?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4981406038438882987</id><published>2009-07-14T22:02:00.002-07:00</published><updated>2009-07-14T22:02:36.919-07:00</updated><title type='text'>Random variable and probability distributions ?</title><content type='html'>1. A continuous random variable X that can assume values between x = 1 and x=3 has a density function given by f(x) = 1/2. a.) Show that the area under the curve is equal to 1 b.) Find P(2%26lt;X%26lt;2.5). c.) P(X%26lt;1.6)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;thanks for the hlp...i'm really confuse&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. From  a box containing 4 black balls and 2 green balls,3 balls are drawn in succession, each ball being replaced in the box before the next draw is made.Find the probability distribution for the number of green balls ?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. The proportion of people who respond to a certain mail-order solicitation is a continuous radom variable X that has the denssity function. f(x) = { 2(x+2)/5, 0%26lt;x%26lt;1 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;                                              { 0 , elsewhwere&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a.) show that P(0-X-1)=1 b.) Find the probabi;ity that more than 1/4 but fewer than 1/2 of the people contacted will respond to this type of solicitation.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Random variable and probability distributions ?&lt;br&gt;1a. Integrate 1/2 dx from 1 to 3.. it should equal one&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1b. Integrate 1/2 dx from 2 to 2.5 should be 0.25&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1c. Integrate 1/2 dx from 1 (lower bound) to 1.6 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. This question is ambiguous. The number of green balls assuming what? &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3a. Integrate f(x) dx from 0 to 1 to prove it's equal to one&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3b. Integrate f(x) dx from 0.25 to 0.50&lt;br&gt;Reply:1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for any continuous distribution you need to verify that the probability density function (pdf) is really a pdf by making sure the function integrates to 1 over the defined region.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;∫f(x)dx from x = 1 to x = 3 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1/2 x for x from 1 to 3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1/2 * (3 - 1) = 1/2 * 2 = 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) to find the probability of any continuous random variable for a given range you just need to integrate the pdf over the range for the probability.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1/2 * (2.5 - 2) = 1/4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) integrate f(x) from 1 to 1.6 and you get a prob of 0.3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;--------&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let X be the number of green balls drawn&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X ~ Binomial ( 3, 1/3 )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;binomial with three trials (the three balls being drawn with replacement) and a success probability for each draw of 1/3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;-------&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;same logic as from 1.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) integrate over the whole region to show the pdf will integrate to 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) integrate f(x) from x = 1/4 to x = 1/2 and you'll get 0.2375&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4981406038438882987?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4981406038438882987/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-variable-and-probability.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4981406038438882987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4981406038438882987'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-variable-and-probability.html' title='Random variable and probability distributions ?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6388963077042477904</id><published>2009-07-14T22:02:00.001-07:00</published><updated>2009-07-14T22:02:20.826-07:00</updated><title type='text'>How to randomize elements of array?? (in C language)?</title><content type='html'>I need to put into array numbers from 0 to 15 but in random order... and every number should only be used only once... anybody has an idea how to do it???&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;How to randomize elements of array?? (in C language)?&lt;br&gt;Use an array to keep track of what is already present in the other array - or use an array to keep track of what isn't in the other array. Then just make sure you don't get duplicate random numbers (either by resizing the one array or using a while loop).&lt;br&gt;Reply:#include %26lt;stdio.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdlib.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;time.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define N 16&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int i, randVal;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    srand( (unsigned)time( NULL ) );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    //Print 10 random values to screen&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    for (i = 0; i %26lt; 10; i++) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        randVal = (int) N * rand() / (RAND_MAX + 1.0);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        printf("%d\n", randVal);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;That code will generate and print random numbers between 0 and 15.  All you would have to do then is initialize your array with lets says -1.  Then maybe have another variable to keep track of how many slots have been filled.  Call the random function until all slots are filled.....  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hopefully this helps and give you an idea of how to go about  solving your problem.&lt;br&gt;Reply:Set two arrays: fill one with numbers from 0 to 15. set another filled with random numbers . Then sort the random column, but change the number os the first array accordingly:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;assuming r[] has random numbers&lt;br&gt;&lt;br /&gt;&lt;br /&gt;n[] has the numbers &lt;br&gt;&lt;br /&gt;&lt;br /&gt;for i:=0 to 14 do&lt;br&gt;&lt;br /&gt;&lt;br /&gt;..for j:=i+1 to 15 do&lt;br&gt;&lt;br /&gt;&lt;br /&gt;....if r[i]%26gt;r[j] then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;......begin&lt;br&gt;&lt;br /&gt;&lt;br /&gt;........temp:=r[i];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;........r[i]:=r[j];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;........r[j]:=temp;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;           &lt;br&gt;&lt;br /&gt;&lt;br /&gt;........temp:=o[i];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;........o[i]:=o[j];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;........o[j]:=temp ;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;......end;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;BIG H proposed solution does not guarantee uniqueness&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and prassanna solution does not gruarantee randomness, since change is done randomly.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Donald Knutt demonstrates that random algorhitms do not necessarilly produce random results.&lt;br&gt;Reply:Assume that you need the randomized elements in array 'a'. The code below should help you out:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdio.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdlib.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;time.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define NUM_ELEM16&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define MAX_ITER10000&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define swap(arr,pos1,pos2)\&lt;br&gt;&lt;br /&gt;&lt;br /&gt;arr[pos1] = arr[pos1] + arr[pos2]; \&lt;br&gt;&lt;br /&gt;&lt;br /&gt;arr[pos2] = arr[pos1] - arr[pos2]; \&lt;br&gt;&lt;br /&gt;&lt;br /&gt;arr[pos1] = arr[pos1] - arr[pos2];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;void randomize_array ( int *a, int num_elem )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int i, j, k;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;srand(time(NULL));  /* or any other random generator initialization call */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for (i = 0; i %26lt; num_elem; i++) {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a[i] = i;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for (i = 0; i %26lt; MAX_ITER; i++) {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;j = random (num_elem); &lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* on unix use: j = random() % num_elem; */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;k = (j + 1 + random (num_elem - 1)) % num_elem;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* on unix use: &lt;br&gt;&lt;br /&gt;&lt;br /&gt; * k = (j + 1 + random () % (num_elem - 1)) % num_elem; &lt;br&gt;&lt;br /&gt;&lt;br /&gt; */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;swap (a, j, k);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* example main function. Written for the sake of completion */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main (void)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int a[NUM_ELEM], i;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;randomize_array (a, NUM_ELEM);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* print the results */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for (i = 0; i %26lt; NUM_ELEM; i++) {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;printf ("a[%2d] = %2d\n", i, a[i]);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Please let me know if you face any problems.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;--&lt;br&gt;&lt;br /&gt;&lt;br /&gt;thanks and regards,&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Prasanna&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6388963077042477904?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6388963077042477904/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-to-randomize-elements-of-array-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6388963077042477904'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6388963077042477904'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-to-randomize-elements-of-array-in-c.html' title='How to randomize elements of array?? (in C language)?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7624287743387374177</id><published>2009-07-14T22:02:00.000-07:00</published><updated>2009-07-14T22:02:04.604-07:00</updated><title type='text'>Dice Probability?</title><content type='html'>I came a across this math problem and was looking for some math wiz's to help me solve it! Here it is:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Suppose you had 5 regular dice. What are the odds of rolling one of the four following combinations? (the order rolled does not matter)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) 1,1,3,4,6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) 3,3,4,5,6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) 2,3,5,5, and a random number &lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) 2,3,5, and two random numbers&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Thanks in advance!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Dice Probability?&lt;br&gt;P(a) = 5! / 2! * (1/6)^5 = 5/648&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(b) = same as (a) = 5/648&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Also note that a and b are mutually exclusive&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c however is a subset of d, ie when you get c you automatically get d.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Working out P(d) is a little more complicated.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There are 5 cases to investigate:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Case 1: 2,3,5 and one of 2,3,5 appearing twice more&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Case 2: 2,3,5 and one of 1,4,6 appearing twice&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Case 3: 2,3,5 and two more of 2,3,5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Case 4: 2,3,5 and two of 1,4,6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Case 5: 2,3,5 and one of 2,3,5 and one of 1,4,6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1) Consider 2,3,5,2,2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There are 5!/3! ways of arranging that. The same is true for&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2,3,5,3,3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2,3,5,5,5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2) Consider 2,3,5,1,1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2,3,5,4,4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2,3,5,6,6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;For each there are 5! / 2! ways of arranging them.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3) Consider &lt;br&gt;&lt;br /&gt;&lt;br /&gt;2,3,5,1,4; 2,3,5,1,6; 2,3,5,4,6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;For each there are 5! ways of arranging&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4) Consider 2,3,5,2,3; 2,3,5,2,5; 2,3,5,3,5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There are 5!/2!/2! arrangements&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5) Consider 2,3,5,1,2; 2,3,5,1,3; 2,3,5,1,5 etc&lt;br&gt;&lt;br /&gt;&lt;br /&gt;For each there are 5! / 2! arrangements&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(d) = 1/6^5 * [3*5!/3! + 3*5!/2! + 3*5! + 3*5!/2!/2! + 9*5!/2!]&lt;br&gt;&lt;br /&gt;&lt;br /&gt; = 205/1296&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(a or b or d) = 5/648 + 5/648 + 205/1296&lt;br&gt;&lt;br /&gt;&lt;br /&gt; = 25/144 = 0.1736&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;NOTE that P(d) already incorporates P(c)&lt;br&gt;Reply:a%26amp;b: 1 in 216&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c: 1 in 36&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d: 1 in 6&lt;br&gt;Reply:For (a)  the probability is 5!/2x6^5=20/6^4=5/588&lt;br&gt;&lt;br /&gt;&lt;br /&gt;For (b) the probability is again 5/588&lt;br&gt;&lt;br /&gt;&lt;br /&gt;For (c)4!/2x6^4=&lt;br&gt;&lt;br /&gt;&lt;br /&gt;For (d)3!/6^3=1/36&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Since any of (a), (b), (c), (d) is allowed add all probabilities,&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(5/588)+(5/588)+(     )+(1/36)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=calculate&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7624287743387374177?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7624287743387374177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/dice-probability.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7624287743387374177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7624287743387374177'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/dice-probability.html' title='Dice Probability?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2556406383663651127</id><published>2009-07-14T22:01:00.003-07:00</published><updated>2009-07-14T22:01:49.008-07:00</updated><title type='text'>Arranging a number?</title><content type='html'>Six numbers are arranged in a sequence. the numbers have to be sorted in an ascending order. any step in the rearrangement involves exchanging positions of any two numbers simultaneously. what is the minimum possible number of steps needed to arrange the numbers. if they  are initially not in an ascending order ?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a)1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b)3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c)4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d)6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;how do isolve ?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;should i take random numbers 3,4,1,5,9,0  ? like this ?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;whats the easy way to find out the correct option ?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Arranging a number?&lt;br&gt;one... because four of the numbers could already be in their correct order... only having to do one switch..&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ex.  102489   only one switch the 0 and the one... so one is the minimum... now the maximum is a bit more complicated... tell me if you need to know how.. write me sylviakopec@yahoo.com&lt;br&gt;Reply:try combinations or arangements or permutations&lt;br&gt;Reply:The least is 1. By making just one exchange it may be possible to sort the numbers in ascending order&lt;br&gt;Reply:i dont know the answer but i feel 4 you&lt;br&gt;Reply:The min. no. of steps is 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;while the max. is 5.&lt;br&gt;Reply:correct answer is (c) you get it easily by gueesing it quickly thats the best way try it out definetely u score above 80% corect answers&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://phone-cards4.blogspot.com/&gt;phone cards&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2556406383663651127?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2556406383663651127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/arranging-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2556406383663651127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2556406383663651127'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/arranging-number.html' title='Arranging a number?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-3397351168706303424</id><published>2009-07-14T22:01:00.002-07:00</published><updated>2009-07-14T22:01:32.399-07:00</updated><title type='text'>“Again” Random Anime Questions?</title><content type='html'>“Again” Random Anime Questions.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Since these questions was reported and deleted, I’ll ask them again. ;)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1.  Name the characters for Elfen Lied&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a.  Number 35?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b.  The secretary the Lucy killed in the first eps?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c.  Kohta’s Sister?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2.  How many and how long are number 35’s vectors?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3.  Karas: Otoha (human) is miss this human quality, what is it and why?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4.  The Quote, “Just a Torch,” Comes from what Anime and what is a Torch?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5.  Samurai Champloo:  What is the name of the twin brothers “Graffiti Gang Leaders” and What are the fight for?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;6.  Eureka 7: What is the name of the ship owned by Charles and Ray Beams?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;7.  Eureka 7:  Where did Dewey find the Command Cluster?&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;8.  MCQ is the Host of a Game Show on what Anime?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;9.  The quote, "I sing this song for all mankind!" is by who and off of what anime?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;10. Is asking if anyone is Hungry a volition of YA guild lines?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;“Again” Random Anime Questions?&lt;br&gt;I'll try my best :)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1. Name the characters for Elfen Lied&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. Number 35?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I think it is Mariko~&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. The secretary the Lucy killed in the first eps?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I have no idea~ I cannot remember&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. Kohta’s Sister?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Yuki?~ no Yuka&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. How many and how long are number 35’s vectors?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;~~~ I'm not sure off hand&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. Karas: Otoha (human) is miss this human quality, what is it and why?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;He doesn't have a certain quality that humans do?~ I'm not sure I haven't seen Karas&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;4. The Quote, “Just a Torch,” Comes from what Anime and what is a Torch?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Is it Shakugan no Shana, and if I remember correctly from the couple episodes I've seen, a Torch represents the humans soul~ it goes out after a while or something too&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;5. Samurai Champloo: What is the name of the twin brothers “Graffiti Gang Leaders” and What are the fight for?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;They fight for respect? I can't remember their names&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;6. Eureka 7: What is the name of the ship owned by Charles and Ray Beams?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;~~~&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;7. Eureka 7: Where did Dewey find the Command Cluster?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;~~ Man this is hard, and I've seen all of Eureka Seven twice&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;8. MCQ is the Host of a Game Show on what Anime?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Saa~ really hard questions you're asking :P&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;9. The quote, "I sing this song for all mankind!" is by who and off of what anime?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I really don't know&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;10. Is asking if anyone is Hungry a volition of YA guild lines?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I think it is~ unless you add a question to it, like what do you want to eat?~ because it's like you're starting a conversation with someone and you can't do that on Y!A&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-3397351168706303424?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/3397351168706303424/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/again-random-anime-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3397351168706303424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3397351168706303424'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/again-random-anime-questions.html' title='“Again” Random Anime Questions?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-957381465013991410</id><published>2009-07-14T22:01:00.001-07:00</published><updated>2009-07-14T22:01:17.473-07:00</updated><title type='text'>Visual Basic 6.0 help?</title><content type='html'>Okay I've been trying to get this to work for quite a while now. I'm supposed to make a program that simulates a guessing game where someone tries to guess a number between 1 and 100. It also should tell the person whether they're to high/low etc. and keep a running total of guesses taken. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The only problem I'm having is keeping the random number. Every time I hit my "guess" button it tells me if i'm right or wrong but then when I hit it again it generates a new random number. How do I keep that random number so I can keep guessing until it's right? &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Private Sub cmdGuess_Click()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c = c + 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;n = Int(Rnd * 101) + 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;lblNumber.Caption = "Number of guesses:" + LTrim$(Str$(c))&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If n %26lt; txtGuess.Text Then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;lblGuess.Caption = "Your guess is too HIGH. Try Again."&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ElseIf n %26gt; txtGuess.Text Then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;lblGuess.Caption = "Your guess is too LOW. Try Again."&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ElseIf n = txtGuess.Text Then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;lblGuess.Caption = "Congradulations you are CORRECT!"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;End If&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Visual Basic 6.0 help?&lt;br&gt;You need to create a sub procedure for the random number generator, and call it only after the user either gets it right, or after the 10th wrong guess.  You can't put the random number generator in the click event, otherwise everytime you click it, the number will regenerate.  I'm actually working on this same problem, and on my other computer I have a link to another messageboard where I posted my exact code and got help from people.  Mine works great now!  If I remember, I will post the link to my code.&lt;br&gt;Reply:define the number and assign a value for it in the general segment ... so that you won't be reassigning in this command&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-957381465013991410?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/957381465013991410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/visual-basic-60-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/957381465013991410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/957381465013991410'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/visual-basic-60-help.html' title='Visual Basic 6.0 help?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2516673259311957970</id><published>2009-07-14T22:01:00.000-07:00</published><updated>2009-07-14T22:01:02.389-07:00</updated><title type='text'>Write a program that plays the game of "guess the number" as fallows:?</title><content type='html'>your program chooses the number to be guessed by selecting an integer at random in the range 1 to 1000.I want this program in C++. The program then displays the fallowing:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"please type your first guess."&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The player then types a first guess. The programn respond with one of the fallowing:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"1.Excellent!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. too low!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3.too high!"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If the player's guess is incorrect, your program should loop until the player finally gets the number right.Your program should keep telling the player "too high" or "too low" to help the player "zero in" on the correct answer.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Write a program that plays the game of "guess the number" as fallows:?&lt;br&gt;If you don't want to learn how to program yourself, don't take programming classes.  We won't be doing your home works for you&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2516673259311957970?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2516673259311957970/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/write-program-that-plays-game-of-guess.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2516673259311957970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2516673259311957970'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/write-program-that-plays-game-of-guess.html' title='Write a program that plays the game of &quot;guess the number&quot; as fallows:?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5224553750305523633</id><published>2009-07-14T22:00:00.002-07:00</published><updated>2009-07-14T22:00:44.403-07:00</updated><title type='text'>Checking Numbers in C#?</title><content type='html'>I have generated four random numbers between 1 and 5 in a C# program, rndNumberA, rndNumberB, rndNumberC, rndNumberD.. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I need to make sure none of the numbers are the same, and assign a new number if they are. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Can anyone help?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Thanks in advance : )&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Checking Numbers in C#?&lt;br&gt;Repeat&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rndNumberA&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rndNumberB&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rndNumberC&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rndNumberD&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Until(NumberA%26lt;%26gt;NumberB or NumberC or NumberD and NumberB%26lt;%26gt;NumberC or NumberD and NumberC%26lt;%26gt;NumberD)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://11orange.blogspot.com/&gt;orange&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5224553750305523633?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5224553750305523633/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/checking-numbers-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5224553750305523633'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5224553750305523633'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/checking-numbers-in-c.html' title='Checking Numbers in C#?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2192605587168657427</id><published>2009-07-14T22:00:00.001-07:00</published><updated>2009-07-14T22:00:29.941-07:00</updated><title type='text'>Validating Numbers in C#?</title><content type='html'>I have generated four random numbers between 1 and 5 in a C# program, rndNumberA, rndNumberB, rndNumberC, rndNumberD..&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I need to make sure none of the numbers are the same, and assign a new number if they are.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Can anyone help?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Thanks in advance : )&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Validating Numbers in C#?&lt;br&gt;do&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   //generate the numbers &lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;while(rndNumberA==rndNumberB %26amp;%26amp; rndNumberB == rndNumberC %26amp;%26amp; rndNumberC == rndNumberA)&lt;br&gt;Reply:If you know your search space (for example, unique numbers between 1 and 5) then allocate them into an array.  When selecting a random element, select a random index into this array, use the value at that index and remove the element from the array.  This is the best way to do it and ensure it runs in constant time.  If you generated the numbers first, and then checked for duplicates, you would not be able to guarantee that any replacement number is unique and therefore the program could run forever in an infinite loop (bad).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;List%26lt;int%26gt; searchSpace = new List%26lt;int%26gt;(new int[] { 1, 2, 3, 4, 5 });&lt;br&gt;&lt;br /&gt;&lt;br /&gt;List%26lt;int%26gt; results = new List%26lt;int%26gt;();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for (int i = 0; i %26lt; 5; i++)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int randomIndex = random.Next(searchSpace.Count);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;results.Add(searchSpace[randomIndex]);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;searchSpace.RemoveAt(randomIndex);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;// results will contain a list of numbers from 1 to 5, each being unique and random&lt;br&gt;Reply:var randomNumber = new List%26lt;int%26gt;(4);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   var random = new System.Random();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   while (randomNumber.Count %26lt; 4)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    var pseudo = random.Next(1, 5);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    if (!randomNumber.Contains(pseudo))&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     randomNumber.Add(pseudo);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   foreach (var number in randomNumber)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    Console.WriteLine(number);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   }&lt;br&gt;Reply:Basically, I would do this in a loop, and store the numbers, as they are generated in an array. If you know that there are going to be 4 numbers chosen, you can declare a static array with four positions. There are a couple of different ways you could go about checking to make sure there are no duplicates. You could generate all four numbers and assign each of them to the array, then loop through the array checking for dup's, OR, you could actually generate the randoms in the loop itself, and check against the previous numbers entered. You would need to define rules for what number would be used to replace the duplicate as well. If you get some code going, and post it, I will be glad to help you refine it. Good luck.&lt;br&gt;Reply:I went with a recursive solution:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;static Random generator = new Random(); //global variable to generate random numbers&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;static void Main(string[] args)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      List%26lt;int%26gt; numbers = new List%26lt;int%26gt;();//list to hold results&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      const int LOOPS = 4;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      const int MIN=1;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      const int MAX=5;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      for (int i = 0; i %26lt; LOOPS; i++)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            AssignNumbers(numbers,MIN,MAX);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      for (int i = 0; i %26lt; numbers.Count; i++)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            Console.WriteLine(numbers[i].ToString())...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;//************************************...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;//assigns a number. If the list has a number, recurses again.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;static void AssignNumbers(List%26lt;int%26gt; list,int min, int max)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            int temp = GetNumber(min, max);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            if (!list.Contains(temp))&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                list.Add(temp);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            else&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                AssignNumbers(list,min,max);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;//************************************...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;//Helper function to assign the random numbers.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        static int GetNumber(int min, int max)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            return generator.Next(min, max + 1);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;       &lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;Reply:A basic solution (forgive hardcoding of index limits) :&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Do a for.. loop through an array of your number range, and for each index, generate a random index 0..4 with which you swap values in the array, and then just take the values at indices 0..3.......&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int[] aiPool = new int[] { 1, 2, 3, 4, 5 };&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Random rnd = new Random();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for (int iIndex = 0; iIndex %26lt; 5; iIndex++)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int iRandomIndex = Random.Next(5);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;// Swap values at iIndex and iRandomIndex&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int iCopy = aiPool[iIndex];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;aiPool[iIndex] = aiPool[iRandomIndex];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;aiPool[iRandomIndex] = iCopy;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rndNumberA = aiPool[0];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rndNumberB = aiPool[1];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rndNumberC = aiPool[2];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rndNumberD = aiPool[3];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Each rndNumberX is guaranteed to be unique, and will be random as every index in the pool is swapped.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;This approach ensures that the minimum of calls to Random.Next are made and no "seen that" tracking is needed.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Vera - your approach I think should use || instead of %26amp;%26amp; as the condition a=1, b=1, c=2 ends the loop, but does not enforce uniqueness. Also, you would need 3+2+1 comparisons - a-b, a-c, a-d, b-c, b-d and c-d&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2192605587168657427?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2192605587168657427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/validating-numbers-in-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2192605587168657427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2192605587168657427'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/validating-numbers-in-c.html' title='Validating Numbers in C#?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-939702225356116366</id><published>2009-07-14T22:00:00.000-07:00</published><updated>2009-07-14T22:00:13.732-07:00</updated><title type='text'>Anyone good at stats ... its very basic?</title><content type='html'>Sample Methods: Health Care. Modern Managed Hospitals (MMH) is a national for-profit chain of hospitals. Management wants to survey patients discharged this past year to obtain patient satisfaction profiles. They wish to use a sample of such patients. Several sampling techniques are described below. Categorize each technique as simple random sample, stratified, systematic sample, cluster sample, or convenience sample.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(a) Obtain a list of patients discharged from all MMH facilities. Divide the patients according to length of hospital stay (2 days or less, 3-7 days, 8-14 days, more than 14 days). Draw simple random samples from each group.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(b) Obtain lists of patients discharged from all MMH facilities. Number these patients, and then use a random-number table to obtain the sample.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c) Randomly select some MMH facilities from each of the five geographic regions, and then include all the patients on the discharge lists of the selected hospitals.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Anyone good at stats ... its very basic?&lt;br&gt;(a) is a stratified sample (the strata are the length of stays and then a simpe random sample is taken from each strata)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(b) is a simple random sample&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(c) is a cluster sample (the clusters are the geographic region and all observations in each randomly selected cluster are selected)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(d) is a systematic sample (every 500th is selected)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(e) is a convenience sample (no obvious randomization is put into selecting the sample)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-939702225356116366?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/939702225356116366/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/anyone-good-at-stats-its-very-basic.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/939702225356116366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/939702225356116366'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/anyone-good-at-stats-its-very-basic.html' title='Anyone good at stats ... its very basic?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5244586254990273285</id><published>2009-07-14T21:59:00.002-07:00</published><updated>2009-07-14T21:59:59.542-07:00</updated><title type='text'>RaNdOm NuMbErS?!?</title><content type='html'>Once again, I'm kinda taking a survey but instead of asking you a question for you to answer, I'm going to try a new technique! (BE PATIENT WITH ME! lol) Ok, I'm going to try to make this real simple. There should be two parts to your answer. The first part should be a number 60 or less. The second part is going to be either "A" "B" or "C" so your answer should look something like this:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;26 C&lt;br&gt;&lt;br /&gt;&lt;br /&gt;See it's simple! lol Try to be as random as you possibly can and PLEASE don't be rude or give a mean comment. This is a survey for school. I know it's not a conventional survey but the one I tried before didn't work too well. If I get 10 responses that's GREAT but if I get 20, that's even better. So if ypou see a lot of people have already responded, STILL RESPOND. The best answer will go to the person who has the lowest score or the person who is CLOSEST to getting to the next level! EASIEST 10 POINTS ever! Ok BEGIN lol ♥&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;RaNdOm NuMbErS?!?&lt;br&gt;4 A&lt;br&gt;Reply:34D&lt;br&gt;Reply:16 B&lt;br&gt;Reply:37 C&lt;br&gt;Reply:20 B, well, I guess there is no way I'm going to win, I have 4k points to get to level 6.&lt;br&gt;Reply:34A&lt;br&gt;Reply:32 c&lt;br&gt;Reply:15 B&lt;br&gt;Reply:37m&lt;br&gt;Reply:38 C&lt;br&gt;Reply:36d&lt;br&gt;Reply:48 B&lt;br&gt;Reply:45C&lt;br&gt;Reply:21 c&lt;br&gt;Reply:66 B&lt;br&gt;Reply:59 B&lt;br&gt;Reply:42 dd Oh not my bra size&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;24 a&lt;br&gt;Reply:19 A&lt;br&gt;Reply:13 C&lt;br&gt;Reply:12 B&lt;br&gt;Reply:2 A&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5244586254990273285?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5244586254990273285/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-numbers_14.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5244586254990273285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5244586254990273285'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-numbers_14.html' title='RaNdOm NuMbErS?!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5403865292421922794</id><published>2009-07-14T21:59:00.001-07:00</published><updated>2009-07-14T21:59:43.235-07:00</updated><title type='text'>Fafsa form for finacial aid for college?? Help!!?</title><content type='html'>Does anyone remember what there pin number conisits of b/c i need my pin #....like is it your SS number and you birthday combined or is it just some random number they give to you...its been a few years since i had one givin to me and i forgot what it is.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Fafsa form for finacial aid for college?? Help!!?&lt;br&gt;your pin is just a random number.  i'm sorry about your situation, the only thing i can think of is alert your school to your situation and e-mail the site that you retrieve your pin from explaining the same to them.&lt;br&gt;Reply:go to the fafsa website and request  your pen # to be sent to u by email and u will receive it in a couple of days.&lt;br&gt;Reply:There will be a link on the site to have your pin emailed to you.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://2flash-cards.blogspot.com/&gt;flash cards&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5403865292421922794?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5403865292421922794/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/fafsa-form-for-finacial-aid-for-college.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5403865292421922794'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5403865292421922794'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/fafsa-form-for-finacial-aid-for-college.html' title='Fafsa form for finacial aid for college?? Help!!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7043332058531292896</id><published>2009-07-14T21:59:00.000-07:00</published><updated>2009-07-14T21:59:27.094-07:00</updated><title type='text'>S Fafsa form for finacial aid for college?? Help!!?</title><content type='html'>Does anyone remember what there pin number conisits of b/c i need my pin #....like is it your SS number and you birthday combined or is it just some random number they give to you...its been a few years since i had one givin to me and i forgot what it is. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;the prob is i need the form printed out by tomorrow so they dont cancel my classes b/c i need to take out a loan and i exceeded the limit of trys to request a duplicate pin : (&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;S Fafsa form for finacial aid for college?? Help!!?&lt;br&gt;Its a random number and they can email it to you, but my sister said it took 4 hours for hers to come.  Just be patient and watch your email box.  What i did once i got mine was wrote it on a small pc of paper and taped it to the back of my computer monitor, that way every yr when i have to re apply i know where its at.  Good Luck!&lt;br&gt;Reply:Its a random number.  If you can't remember it you'll have to get one reassigned.  I've never exceeded the limit of getting a duplicate.  I'm sure there's a phone number you can call to get help from.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.fafsa.ed.gov&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7043332058531292896?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7043332058531292896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/s-fafsa-form-for-finacial-aid-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7043332058531292896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7043332058531292896'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/s-fafsa-form-for-finacial-aid-for.html' title='S Fafsa form for finacial aid for college?? Help!!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-8251348560360698152</id><published>2009-07-12T22:54:00.000-07:00</published><updated>2009-07-12T22:54:08.001-07:00</updated><title type='text'>Random sample?</title><content type='html'>I’m interested in studying the relationship between people who smoke per week and the number of hours spent exercising.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If I use a random sample...wouldn't that be wrong b/c i will be sleecting people under 13 b/c i'm randomly choosing people? I don't get it????&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Random sample?&lt;br&gt;You could choose a random sample of people over 18.&lt;br&gt;Reply:When you choose someone randomly, if you want to exclude people under 13, you ask their age and drop the sample if they are 13 (don't ask any questions) and go to another person who is a smoker as well as an exerciser and the minimum age you want.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://flower-girl2.blogspot.com/&gt;flower girl&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-8251348560360698152?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/8251348560360698152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-sample.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8251348560360698152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8251348560360698152'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-sample.html' title='Random sample?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1505098920070487200</id><published>2009-07-12T22:53:00.003-07:00</published><updated>2009-07-12T22:53:52.458-07:00</updated><title type='text'>Problem1.  1.?</title><content type='html'>1.  It is late night and a drunkard is walking along a very long street.  The drunkard is not sure which is the way home, so he randomly takes steps of length 1.0 m forward or backward. He takes one step every second continuously for 1 hr.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. Simulate this process by using a random number generator . Note that  the C Library provides one;  use man srand to learn more about this.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. Generate 100 different realizations of  the  random sequence of steps by using a different seed each  time. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. Graphically show the randomwalks.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. Calculate the displacement of the drunkard for each realization, and show graphically how these are distributed using a histogram.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e. Calculate the mean and the  root mean square (rms.) displacement of  the drunkard after 1hr.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;f. Increase the time (number of steps) and show that the mean displacement  tends to 0 and the rms. displacement scales as the square -root of the time.  Also try to derive the same result analyticaly.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Problem1.  1.?&lt;br&gt;Not meaning to be rude, but this is not a homework completion service.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If you have specific questions about how to complete this task, I and many others would be more than happy to help you out. We are not here to do your homework for you.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1505098920070487200?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1505098920070487200/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/problem1-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1505098920070487200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1505098920070487200'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/problem1-1.html' title='Problem1.  1.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5734036362378401670</id><published>2009-07-12T22:53:00.002-07:00</published><updated>2009-07-12T22:53:36.824-07:00</updated><title type='text'>Virus- Mal/Generic A tmp1.tmp ??????</title><content type='html'>Norton tells me it's called Trojan.Horst, can't get rid of it.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Sophos tells me it's Mal/Generic A, also can't get rid of it.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I'm sick of downloading crappy programs that can't get rid of this thing that's causing pop up alert after alert telling me that &lt;br&gt;&lt;br /&gt;&lt;br /&gt;C:/WINDOWS/Temp/tmp[insert random number here].tmp had been detected, high risk, can't do anything about it. 400 at a time. Google gives me nothing useful. I don't want to nuke the computer. Does anyone have something to offer that I HAVEN'T HEARD ALREADY?!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Virus- Mal/Generic A tmp1.tmp ??????&lt;br&gt;I have AVG anti-virus, and it works really good. It detects and removes viruses,worms,Trojan horse's really efficiently. I've used it for about 4-5 years and I barely have any viruses. They have a free version and a pay one. Look at the site, they have anti-spyware, anti-rootkit, firewall too...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Get rid of it fast, I had some that made fake"back up copies" in my computer. They use the "back door". If it takes over, you have to reboot/reset (delete everything and start over)your computer.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://free.grisoft.com/&lt;br&gt;Reply:You've mentioned using two different antivirus programs (Norton and Sophos). Anytime you have more than one antivirus installed they will conflict with each other causing neither to work properly.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I strongly suggest that you invest in a proper security suite (antivirus, firewall, antispyware, etc) preferably from one reliable vendor (like McAfee or Norton) and ensure it is properly configured and kept completely and vigilantly up to date.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;However, before you install the proper security suite you MUST uninstall all of these other ones and reboot. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Then ensure it is properly configured and that you completely update the proper security suite and reboot... once you have rebooted make sure ALL programs are closed and run a complete scan.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If this still does not allow you to remove the malware then you MUST read the instructions / messages that tell you what file it is not wanting to delete ... and you can either go into safe mode and manually remove the file and/or go into safe mode and attempt to run the scan.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If you are unable to handle this then it's time to contact a reliable and qualified technician.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Good Luck&lt;br&gt;Reply:one thing that was said hear that is true, you can only have one virus porgram on the computer at a time, but you may have as many spyware programs as you wish, personally I run 3, but only 1 at a time OK&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ONe that will run in safe mode is AVG anti spyware, and its for spyware, malware and rootkits&lt;br&gt;&lt;br /&gt;&lt;br /&gt;also you can go to www.snapfiles.com&lt;br&gt;&lt;br /&gt;&lt;br /&gt;go to the freeware section&lt;br&gt;&lt;br /&gt;&lt;br /&gt;anti=virus tools section, look for the stand alone ones, save to a disk or jumpdrive, these can then be run in safe mode also, they will not clean ever thing but will usually get computer up enough for your normal programs to work&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If your smart dump Norton's of which you pay ever yr for and try the free ones, free forever more&lt;br&gt;&lt;br /&gt;&lt;br /&gt; SIMPLE STEPS TO&lt;br&gt;&lt;br /&gt;&lt;br /&gt;DOWNLOADING&lt;br&gt;&lt;br /&gt;&lt;br /&gt;VIRUS %26amp; SPYWARE PROTECTION&lt;br&gt;&lt;br /&gt;&lt;br /&gt;For XP&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AVG   FOR VIRUS PROTECTION&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AVG anti  FOR SPYWARE, MALWARE, ROOTKITS&lt;br&gt;&lt;br /&gt;&lt;br /&gt;BOTH FOUND AT http://www.grifsoft.com  or go to yahoo and enter in search box - AVGfree and the first or 1. Item that is listed is the web site for you to go to.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Once there you will see advertisement for both free %26amp; paid plus updates, at the left upper side you’ll see download for free basic protection, click the orange download bar and this will get the free program for AVG virus&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Under that picture you will see the words AVG anti-spy ware Free edition the writing is in orange, click it for your download of AVG anti spy ware program&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If for any reason someone just needs the updates to the current program and cannot download on their machine, a person a look to bottom right corner of page and find them, put on jump drive and just plug in and AVG will find it when you click update on the program. (this is just for the virus program)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now for your next layer of protection download the following also but remember you can only run one program at a time, but each of these will fine things the other didn’t.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Spybot search %26amp; destroy found at www.safer-networking.org&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Superantispyware found at http://superantispyware.com &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And finally go to this web site for this program to clean up your internet history, cookies, browser history, recycle bin, IE Explorer, etc all the boxes can be preset and basically in 4 steps you can clean computer. It does so well that disc clean usually only will find 32-100MB after its done&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.snapfiles.com go to the freeware section, look for Internet Cleanup, then look for the software called IE Privacy Keeper&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Last but not least do Defrag at least 2 times in a row even if program says not needed, as XP Defrag program isn’t the best and needs to be run more often.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And also go to http://www.glaryulitilies.com  for free registry repair programs or to http://www.snapfiles.com and to their freeware section to find them also. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;(need only one virus program but you may have as many spy ware programs as you wish as long as you run only one at a time, and only one firewall)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;PROGRAMS FOR VISTA&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;LOTS OF FREE PROGRAM CAN BE FOUND AT P.C WORLD.COM&lt;br&gt;&lt;br /&gt;&lt;br /&gt;JUST GO TO THE SEARCH BOX AND TYPE IN VISTA DOWNLOADS AND A LIST OF 39 AS OF JULY 2007 WILL COME UP. THERE ARE QUITE A FEW THAT ARE FREE AND SOME THAT WOULD COME IN HANDY UNDER SHAREWARE IF NEEDED TO FIX A COMPUTER AND YOU HAD NO OTHER CHOICES.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ZONEALARM- FIREWALL&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AVG VIRUS&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AVG-ANTI VIRUS ( WHICH IS THE SPYWARE,MAL-WARE,ROOTKITS PROGRAM)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;SPYBOT 5.1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;GOOGLE EARTH&lt;br&gt;&lt;br /&gt;&lt;br /&gt;GOOGLE DESKTOP&lt;br&gt;&lt;br /&gt;&lt;br /&gt;BELARC&lt;br&gt;&lt;br /&gt;&lt;br /&gt;IE PRIVACY KEEPER&lt;br&gt;&lt;br /&gt;&lt;br /&gt;All these are version from after date march 2007.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ANOTHER PROGRAM TO PUT ON IS JAVA 6.1 AND TO GET THIS YOU MUST GO TO JAVA sun AND DOWNLOAD.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Again be sure use newest version for vista.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;WHERE TO DOWLOAD AVG AND SPYBOT, IE PRIVACY KEEPER:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;BOTH FOUND AT http://www.grifsoft.com  or go to yahoo and enter in search box - AVGfree and the first or 1. Item that is listed is the web site for you to go to.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Once there you will see advertisement for both free %26amp; paid plus updates, at the left upper side you’ll see download for free basic protection, click the orange download bar and this will get the free program for AVG virus&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Under that picture you will see the words AVG anti-spy ware Free edition the writing is in orange, click it for your download of AVG anti spy ware program&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If for any reason someone just needs the updates to the current program and cannot download on their machine, a person a look to bottom right corner of page and find them, put on jump drive and just plug in and AVG will find it when you click update on the program. (this is just for the virus program)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Spybot search %26amp; destroy found at www.safer-networking.org&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.snapfiles.com go to the freeware section, look for Internet Cleanup, then look for the software called IE Privacy Keeper&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AND THESE ARE HELPFUL TOO: And also go to http://www.glaryulitilies.com  for free registry repair programs or to http://www.snapfiles.com and to their freeware section to find them also.&lt;br&gt;Reply:Do a complete scan of your computer with dr web&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ftp://ftp.drweb.com/pub/drweb/cureit/cur... &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Run the anti spyware remove programs spybot http://securitynewsfromthenet.blogspot.c... and superantispyware http://securitynewsfromthenet.blogspot.c...  to get rid of the nasties&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5734036362378401670?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5734036362378401670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/virus-malgeneric-tmp1tmp.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5734036362378401670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5734036362378401670'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/virus-malgeneric-tmp1tmp.html' title='Virus- Mal/Generic A tmp1.tmp ??????'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4103578744389969614</id><published>2009-07-12T22:53:00.001-07:00</published><updated>2009-07-12T22:53:20.598-07:00</updated><title type='text'>How do i create two different random numbers in the same button click?</title><content type='html'>I am trying to create two different random numbers but i keep getting the same number with two different instances.  This is C# btw.  Here is the problematic code:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;public int Roll1()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            //Rolling the dice&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            System.Random Roll1 = new System.Random();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            int DiceRoll1 = Roll1.Next(1, 7);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            lblPlayer1Position.Text = DiceRoll1.ToString();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        public int Roll2()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            //Rolling the dice&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            System.Random Roll2 = new System.Random();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            int DiceRoll2 = Roll2.Next(1, 7);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            lblPlayer2Position.Text = DiceRoll2.ToString();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;            return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;How do i create two different random numbers in the same button click?&lt;br&gt;Create 2 different variables then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;assign first instance of random number to 1st variable then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;assign next instance of random number to 2nd variable.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Viola!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4103578744389969614?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4103578744389969614/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-do-i-create-two-different-random.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4103578744389969614'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4103578744389969614'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-do-i-create-two-different-random.html' title='How do i create two different random numbers in the same button click?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2369827127341669527</id><published>2009-07-12T22:53:00.000-07:00</published><updated>2009-07-12T22:53:04.212-07:00</updated><title type='text'>Random numbers?</title><content type='html'>from the numbers 3 to 12 inclusive, two numbers are chosen at random.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) what is the cardinality of the sample space?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) list the event in which one number is a factor of the other number and find its cardinality&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) list the event in which the sum of the numbers is 15&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) list the event in which the sum of the numbers is 15 and one number is a factor of the other number&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Random numbers?&lt;br&gt;a) The cardinality of a set is simply the number of elements in the set.  An element of this sample space is an ordered pair of numbers from 3 to 12, such as (5,6) or (7,9).  There are ten possibilities for each selection, and two selections.  Since repeats are allowed (unless stated otherwise), the number of total posibilities we have is 10x10=100.  Thus, the cardinality of the sample space is 100.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) Since we are only going up to 12, we know that only numbers going up to 6 (half of 12) can be a factor of a number greater than itself.  Then we add in all the "doubles" (such as (6,6)), since every number is a factor of itself.  So our possibilities are (3,3), (3,6), (3,9), (3,12), (4,4), (4,8), (4,12), (5,5), (5,10), (6,6), (6,12), (7,7), (8,8), (8,4), (9,9), (9,3), (10, 10), (10,5), (11,11), (12,12), (12,6), (12,3).  So we count them up and that's our cardinality.  So the answer is 22.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) Based on the first selection, there is exactly one possibility for the second number that gives a sum of the two as 15.  So the elements with sum of 15 are (3,12), (4,11), (5,10), (6,9), (7,8), (8,7), (9,6), (10,5), (11,4), (12,3).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) Now we are looking for the elements which meet the criteria of both parts b and c, so we are looking for the intersection of the two sets.  So this means we take every element that appears on both lists.  So the answer is (3,12),(5,10), (10,5), (12,3).&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://curse-of-the-golden-flower.blogspot.com/&gt;curse of the golden flower&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2369827127341669527?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2369827127341669527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2369827127341669527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2369827127341669527'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-numbers.html' title='Random numbers?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1130367504897849353</id><published>2009-07-12T22:52:00.003-07:00</published><updated>2009-07-12T22:52:49.424-07:00</updated><title type='text'>Find the standard deviation of the random variable.?</title><content type='html'>In a box of 10 batteries, 8 are dead. You choose two batteries at random from the box.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let the random variable X be the number of good batteries you get. Find the standard deviation of of X. &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;a.  = 0.53 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b.  = 0.51 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c.  = 0.32 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d.  = 0.28 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;e.  = 0.65&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Find the standard deviation of the random variable.?&lt;br&gt;Number your batteries from zero to nine.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Here are the possible picks from the box.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;.. 01 02 03 04 05 06 07 08 09&lt;br&gt;&lt;br /&gt;&lt;br /&gt;10 .. 12 13 14 15 16 17 18 19&lt;br&gt;&lt;br /&gt;&lt;br /&gt;20 21 .. 23 24 25 26 27 28 29&lt;br&gt;&lt;br /&gt;&lt;br /&gt;30 31 32 .. 34 35 36 37 38 39&lt;br&gt;&lt;br /&gt;&lt;br /&gt;40 41 42 43 .. 45 46 47 48 49&lt;br&gt;&lt;br /&gt;&lt;br /&gt;50 51 52 53 54 .. 56 57 58 59&lt;br&gt;&lt;br /&gt;&lt;br /&gt;60 61 62 63 64 65 .. 67 68 69&lt;br&gt;&lt;br /&gt;&lt;br /&gt;70 71 72 73 74 75 76 .. 78 79&lt;br&gt;&lt;br /&gt;&lt;br /&gt;80 81 82 83 84 85 86 87 .. 89&lt;br&gt;&lt;br /&gt;&lt;br /&gt;90 91 92 93 94 95 96 97 98 ..&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hope this helps, I'll edit it if I learn more.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;OKAY, THE ANSWER IS A.) 0.533333&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I just did the whole thing on paper.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;0.4^2 + 0.6^2 + 1.6^2 is 12.80 and divide by 45&lt;br&gt;&lt;br /&gt;&lt;br /&gt;to get 0.284444 and square root to get 0.53333&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The mean is 0.4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and there are 28 zeros that are 0.4 away.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and there are 16 ones that are 0.6 away.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and there is one two that is 1.6 away from the mean, because 2 minus 0.4 is 1.6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;See?&lt;br&gt;Reply:x = 2  prob. 1/10   then the mean= 0.2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; variance =  0.4 - 0.04 =0.36&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;standard deviation  = 0.6&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1130367504897849353?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1130367504897849353/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/find-standard-deviation-of-random.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1130367504897849353'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1130367504897849353'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/find-standard-deviation-of-random.html' title='Find the standard deviation of the random variable.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4010686534704656404</id><published>2009-07-12T22:52:00.002-07:00</published><updated>2009-07-12T22:52:32.807-07:00</updated><title type='text'>Find the expected value of the random variable.?</title><content type='html'>In a box of 9 batteries, 7 are dead. You choose two batteries at random from the box.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Let the random variable X be the number of good batteries you get. Find the expected value of X. &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;A.  = 0.44 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;B.  = 0.25 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;C.  = 0.56 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;D.  = 0.88 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;E.  = 1.56&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Find the expected value of the random variable.?&lt;br&gt;P(G) = 2/9&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(B) = 7/9&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X) = ∑ xp&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 0*(7/9)(7/9) + 1*2*(2/9)(7/9) + 2(2/9)(2/9)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 28/81 + 8/81&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 36/81&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 0.444&lt;br&gt;Reply:2&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4010686534704656404?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4010686534704656404/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/find-expected-value-of-random-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4010686534704656404'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4010686534704656404'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/find-expected-value-of-random-variable.html' title='Find the expected value of the random variable.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6540610378233114341</id><published>2009-07-12T22:52:00.001-07:00</published><updated>2009-07-12T22:52:17.297-07:00</updated><title type='text'>Probability question, topic "Random Variables"?</title><content type='html'>Here is the question:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;List the values of the given random variable X together with the probability distributions in the given scenario:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;An urn contains 4 red balls and 6 white balls.  Three balls are drawn with replacement.  The random variable X is the number of red balls that are drawn.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I know X can only assume values of 3, 2, 1, or 0.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So I do:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1) Since there are 10 balls altogether and three balls are drawn with replacement, there are 10^3, or 1000, possible combinations for the sample size.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;2) I calculate Probability (X=3) first. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. Since there are 4^3 sequences of red balls with replacement, so the probability is 4^3/10^3=0.064.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3) I calculate P (X=2) now. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. There will be 2 red balls, and 1 white ball.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. There are 3 positions for the white ball, and there are 6 white balls that can go into this position.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. There are 4^2 =16 sequences of two red balls for the remaining positions.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. So I calculate: 3*6*16/10^3=0.228&lt;br&gt;&lt;br /&gt;&lt;br /&gt;But answer says P(X=3)=1/30 and P(X=2)=3/10.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Why??&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Probability question, topic "Random Variables"?&lt;br&gt;You have the correct answers for doing the problem WITH replacement... The book has the answers for doing it WITHOUT replacement.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Here's the math for without replacement:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(x=3) = (4/10)*(3/9)*(2/8) = 1/30&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(x=2) = (4/10)*(3/9)*(6/8)*3) = 3/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I hope this helps!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6540610378233114341?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6540610378233114341/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/probability-question-topic-random.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6540610378233114341'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6540610378233114341'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/probability-question-topic-random.html' title='Probability question, topic &quot;Random Variables&quot;?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-9087506424686223488</id><published>2009-07-12T22:52:00.000-07:00</published><updated>2009-07-12T22:52:01.005-07:00</updated><title type='text'>Tmp file virus.. can any1 tell me exactly wat this virus is...?</title><content type='html'>i appear to have a self replicating virus on my computer, detected as Mal/Generic-A with sophos antivirus and infostealer with norton antivirus. at periodic intervals i get popup messages from norton advising me of a high security risk in the form of (random number).tmp files in c:\WINDOWS\Temp folder. on occasion there has been over 1000 of these files to deal with at a time and hundreds of popups from norton. my antivirus software continues to resolve these problems but i need to acquire specific malware software to remove the source. i need 2 know the ACTUAL NAME of this virus so i can find the appropriate malware removal software. ne1 got ne ideas as to the specifics of this virus???&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Tmp file virus.. can any1 tell me exactly wat this virus is...?&lt;br&gt;As with nearly all 'viruses', it will be known by a different name to each anti-malware company. If your AV finds this it should be able to remove it. Try this:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Turn off system restore: http://www.bleepingcomputer.com/tutorial...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Boot up in Safe Mode: http://www.bleepingcomputer.com/tutorial...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Scan again. Also try an online scan:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;NOD32: http://www.eset.com/onlinescan/&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Sometimes crap can reside in System Restore. When you boot up in safe mode only the key essentials are loaded, any crap shouldn't. Gives your AV more chance of removing it.&lt;br&gt;Reply:I don't know the name, but this works on most malware...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://siri.urz.free.fr/Fix/SmitfraudFix...&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://1apricot.blogspot.com/&gt;apricot&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-9087506424686223488?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/9087506424686223488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/tmp-file-virus-can-any1-tell-me-exactly.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/9087506424686223488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/9087506424686223488'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/tmp-file-virus-can-any1-tell-me-exactly.html' title='Tmp file virus.. can any1 tell me exactly wat this virus is...?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2856111607205426845</id><published>2009-07-12T22:51:00.002-07:00</published><updated>2009-07-12T22:51:44.577-07:00</updated><title type='text'>This is a c program problem: Thanks a lot for those who'll help.:)?</title><content type='html'>Given an array of 50 random numbers in the range 1...100. write a function for each of the following process:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a]printf the array ten(10) values to a line.make sure that the valuies are aligned in rows.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b]print the even values, ten to a line, and return a count of the number of even numbers.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c]Return the location of the smallest value in the array. if the smallest number appeared more than once, display all the locations where the smallest number is found.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2856111607205426845?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2856111607205426845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/this-is-c-program-problem-thanks-lot.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2856111607205426845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2856111607205426845'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/this-is-c-program-problem-thanks-lot.html' title='This is a c program problem: Thanks a lot for those who&apos;ll help.:)?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1929442077096099361</id><published>2009-07-12T22:51:00.001-07:00</published><updated>2009-07-12T22:51:28.836-07:00</updated><title type='text'>Can someone please check this code for me it is in C programing due today so please hurry?</title><content type='html'>#include %26lt;stdio.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdlib.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;time.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;conio.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;ctype.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main (void)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{   &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    //creating random balance for user&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    srand(time(NULL));&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int ranBal;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    ranBal = rand();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    printf("\t\t Virtual Bank at Osceola\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    printf("\t\t\t WELCOME\n\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    char num1, num2, num3, num4;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    printf("Please enter you 4 digit pin number: \n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    scanf("%c%c%c%c", %26amp;num1, %26amp;num2, %26amp;num3, %26amp;num4);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    //Pin  number code&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    for (int count = 0; count %26lt; 4; count++)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    { &lt;br&gt;&lt;br /&gt;&lt;br /&gt;      if (count == 3)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        printf("Sorry You can't continue, contact your bank for assistance");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      if ((isdigit(num1)) %26amp;%26amp; (isdigit(num2)) %26amp;%26amp; (isdigit(num3)) %26amp;%26amp;(isdigit(num4)))&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         printf("Valid Pin");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         break;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      }//end if&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      else&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        printf("Invalid Pin");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        printf("Please try to enter your pin again");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        scanf("%c%c%c%c", %26amp;num1, %26amp;num2, %26amp;num3, %26amp;num4);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      }//end else&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    }//end for   &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int receipt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    printf("For Receipt enter 1, For no receipt enter 2\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    scanf("%d", %26amp;receipt);      &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    if (receipt == 1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;       printf("Please take your receipt\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    else if (receipt == 2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         printf("No receipt will be printed\n\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    else &lt;br&gt;&lt;br /&gt;&lt;br /&gt;         printf("Invalid Entry\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    //clear screen&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    //clrscr();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int again = 1;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int option;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    while (again == 1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    printf("Please choose one of the following numbers\n\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    printf("1: Get Card Back 2: Fast Cash 3: Withdraw 4: Deposit 5: Balance\n\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    scanf("%d", %26amp;option);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int fastCash;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    if (option == 1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;       {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;               printf("Goodbye!\n\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;       }//end option 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;       printf("Press 1: Another Transaction or Press 2: Get Card Back");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    scanf("%d", %26amp;again);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    else if (option == 2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   printf("1: $20.00 2: $40.00 3: $80.00 4: $100.00\n\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   scanf("%d", %26amp;fastCash);           &lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   if (fastCash == 1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                      printf("You have withdrawn $20.00\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   if (fastCash == 2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                      printf("You have withdrawn $40.00\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   if (fastCash == 3)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                      printf("You have withdrawn $80.00\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   if (fastCash == 4)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                      printf("You have withdrawn $100.00\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   &lt;br&gt;&lt;br /&gt;&lt;br /&gt;                   printf("Press 1: Another Transaction or Press 2: Get Card Back");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    scanf("%d", %26amp;again);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         }//end option 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    else if (option == 3)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    int withdrawl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    printf("Please enter withdrawl amount\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    scanf("%d", withdrawl);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    ranBal = ranBal - withdrawl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    if (ranBal %26lt; 0)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                               printf("");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    //compare to actual balance which must be a randomized number&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    printf("Press 1: Another Transaction or Press 2: Get Card Back");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    scanf("%d", %26amp;again);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         }//end option 3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    else if (option == 4)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    printf("Please enter deposit amount\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    printf("Press 1: Another Transaction or Press 2: Get Card Back");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    scanf("%d", %26amp;again);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         }//end option 4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    else if (option == 5)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;         {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    printf("Your balance is %d.\n", ranBal);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    printf("Press 1: Another Transaction or Press 2: Get Card Back");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    scanf("%d", %26amp;again);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    //just print off randomized balance number &lt;br&gt;&lt;br /&gt;&lt;br /&gt;         }//end option 5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    else&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    printf("Invalid Entry\n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    printf("Press 1: Another Transaction or Press 2: Get Card Back");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                    scanf("%d", %26amp;again);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    &lt;br&gt;&lt;br /&gt;&lt;br /&gt;   }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   if (again == 2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      printf("Goodbye!");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   &lt;br&gt;&lt;br /&gt;&lt;br /&gt;   if ((again != 1) %26amp;%26amp; (again != 2))&lt;br&gt;&lt;br /&gt;&lt;br /&gt;      printf("Invalid Entry");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    system("pause");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    return (0);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}//end main&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Can someone please check this code for me it is in C programing due today so please hurry?&lt;br&gt;I stopped reading after this line:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;char num1, num2, num3, num4;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;printf("Please enter you 4 digit pin number: \n");&lt;br&gt;&lt;br /&gt;&lt;br /&gt;scanf("%c%c%c%c", %26amp;num1, %26amp;num2, %26amp;num3, %26amp;num4);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;which is so hopelessly messed up, I had to laugh for a few hours.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Anyway, there is no way to judge this program since you just threw code at us and not what it is supposed to do. So yeah, this code looks perfect, just like any other code someone might post.&lt;br&gt;Reply:That program is screwed up in more ways than a dozen.  Good luck.   You need to talk to your professor and tell her or him to help you.  Your professor has obviously not communicating with you on how to write a program. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;RJ&lt;br&gt;Reply:This must be for a university course.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;It's hard to read because it's all crammed over to the left.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Review the use of indention, and ANSI standards.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Also, you have everything in the main function which also makes it hard to read, too much in one function.&lt;br&gt;Reply:Couple of things - &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for (int count = 0; count %26lt; 4; count++) - what exactly is this for loop for? You should probably be using a switch statement.&lt;br&gt;Reply:Can you try with system("CLS") ; instead of clescr();&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1929442077096099361?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1929442077096099361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/can-someone-please-check-this-code-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1929442077096099361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1929442077096099361'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/can-someone-please-check-this-code-for.html' title='Can someone please check this code for me it is in C programing due today so please hurry?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2571208768109244856</id><published>2009-07-12T22:51:00.000-07:00</published><updated>2009-07-12T22:51:12.436-07:00</updated><title type='text'>HELP questions about Charles Dawin and evolution?</title><content type='html'>I need some help. I am studying evolution and need i am confused about these questions. Please help : ]&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Which statement is in agreement with Darwin's theory of natural selection?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. more offspring are produced than can possibe survive&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. the organisms that are fittest are always the largest and strongest&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. the number of offspring is not realted to fitness&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. acquired characteristic that are inherited are the cause of evolution&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Which factor would most likely disrupt genetic equilibrium in a large population?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a.  production of large numbers of offspring&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b.mating  that is not random&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. the absense o movement into and out of the population&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. absense of mutations&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;sedimentary rock is formed from___&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. soft parts of organisms&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. hard parts of organisms&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. small particles of sand silt and clay&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. wood shell and bone&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;HELP questions about Charles Dawin and evolution?&lt;br&gt;1.) a. more offspring are produced than can possibe survive  BUT, it's the variation of the characteristics in the offspring ("d") that may determine which survive and which don't.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2.)   I would say b.mating that is not random - if females chose males that are larger, more colorful, louder, etc. it would perpetuate those traits over others that weren't selected in the offspring.  But you would already have to have mutations in the population to produce those differences, so "d" also applies.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3.) c. small particles of sand silt and clay is the closest to being right, but it doesn't include all the possibilities (sand, precipitated chemicals)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;After looking at these questions, I can see why you're confused!&lt;br&gt;Reply:1. a&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2. b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3. b&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I'm not sure about the 3rd one&lt;br&gt;Reply:i only know the first one which is A. more offspring are produced than can possibly survive.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2571208768109244856?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2571208768109244856/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/help-questions-about-charles-dawin-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2571208768109244856'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2571208768109244856'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/help-questions-about-charles-dawin-and.html' title='HELP questions about Charles Dawin and evolution?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6519855506308346962</id><published>2009-07-12T22:50:00.003-07:00</published><updated>2009-07-12T22:50:56.633-07:00</updated><title type='text'>I need help with this BIOLOGY questions ??</title><content type='html'>Normal somatic human cells contain &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. 52 chromosomes. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. 46 chromosomes. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. a variable number of chromosomes. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;d. a random number of chromosomes of the sperm and egg.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;I need help with this BIOLOGY questions ??&lt;br&gt;b. 46&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;23 from each parent&lt;br&gt;Reply:b. 46 somatic chromosomes, plus xx or xy&lt;br&gt;Reply:easy question lah.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://4song-words.blogspot.com/&gt;song words&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6519855506308346962?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6519855506308346962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/i-need-help-with-this-biology-questions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6519855506308346962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6519855506308346962'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/i-need-help-with-this-biology-questions.html' title='I need help with this BIOLOGY questions ??'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2268881591737139443</id><published>2009-07-12T22:50:00.002-07:00</published><updated>2009-07-12T22:50:40.425-07:00</updated><title type='text'>Random Variables Question Help Please!!!!!?</title><content type='html'>Please help me with this question...I've tried all kinds of ways of solving this but none of the numbers add up. Please let me know how you did it. Thank You!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The following table shows the probability of rolling the numbers 1 through 6 on a fair die.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X 1 2 3 4 5 6 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X) 1/6 1/6 1/6 1/6 1/6 1/6 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;What is the standard deviation of the random variable X, "the number that comes up on the die?"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   A. 1.708 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;   B. 2.917 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;   C. 14.028 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;   D. 3.745 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;   E. 3.5&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Random Variables Question Help Please!!!!!?&lt;br&gt;The expected value i.e. mean is 3.5 so you will have to sum the squares 2.5^2 1.5^2 .5^2 (twice) divide by 6 and take the sqaure root. Ithink it comes out at A)&lt;br&gt;Reply:Okay you need to calculate standard deviation =sqrt(%26lt;x^2%26gt;-%26lt;x%26gt;^2).  You know the average value of x, %26lt;x%26gt;=3.5.  Now you just have to calculate the average squared value which is just %26lt;x^2%26gt;=(1+4+9+16+25+36)/6.  Plug that in and you're done.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2268881591737139443?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2268881591737139443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-variables-question-help-please.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2268881591737139443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2268881591737139443'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/random-variables-question-help-please.html' title='Random Variables Question Help Please!!!!!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5896735246673492809</id><published>2009-07-12T22:50:00.001-07:00</published><updated>2009-07-12T22:50:24.691-07:00</updated><title type='text'>Needhelp on a) Find the discrete probability distribution for x, the number lemons selected. the rest i can do</title><content type='html'>Suppose that of the next 12 cars to come off the assembly line in a large automobile company,&lt;br&gt;&lt;br /&gt;&lt;br /&gt;three (3) are known to be lemons (lots of problems). Two of the twelve are chosen at random.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) Find the discrete probability distribution for x, the number lemons selected.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) Construct a discrete probability histogram for x, the number of lemons selected.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) Calculate the expected number of ‘lemons’ chosen for this sample.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) Calculate the standard deviation for the number of ‘lemons’ chosen.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Needhelp on a) Find the discrete probability distribution for x, the number lemons selected. the rest i can do&lt;br&gt;Number of ways to get 0 lemons in a sample of 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=Choose(9,2)=36&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Number of ways to get 1 lemon in a sample of 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=Choose(3,1)*Choose(9,1)=27&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Number of ways to get 2 lemons in a sample of 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=Choose(3,2)=3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Number of possible samples of 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=Choose(12,2)=66&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Probability of getting 0 lemons in a sample of 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=Choose(9,2)/Choose(12,2)=6/11&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Probability of getting 1 lemon in a sample of 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=Choose(3,1)*Choose(9,1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/Choose(12,2)=9/22&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Probability of getting 2 lemons in a sample of 2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=Choose(3,2)/Choose(12,2)=1/22&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;See distribution at&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://i25.tinypic.com/21n0ead.jpg&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;where Choose(a,b)=a!/b!/(a-b)!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Expected lemons=0*6/11+1*9/22+2*1/22&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=1/2=.5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Expected lemons^2=0^2*6/11+1^2*9/22&lt;br&gt;&lt;br /&gt;&lt;br /&gt;+2^2*1/22=13/22&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Variance=(Expected lemons^2)-(Expected lemons)^2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=(13/22)-(1/2)^2=15/44&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Standard Deviation=sqrt(Variance)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=1/22*sqrt(165)=.5838742081&lt;br&gt;Reply:It's Binomial.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X~Bin(n, p)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;n = 2, p = 3/12 = 0.25&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;X~Bin (2, 0.25)&lt;br&gt;Reply:This is NOT a binomial distribution as I first thought, and as two of the answerers stated. A binomial distribution requires the trials be independent, but in this question the probability on the second choice depends on the result of the first choice.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ksoileau has the correct distribution and the derivation for expectation and variance. (with a small glitch on the last line. It should be sqrt(15/44) =.5838742081) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I will show another way to get the distribution, but please also learn the method that ksoileau used as it is more powerful.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(lemons = 0) = (9/12)(8/11) = 6/11&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(lemons = 1) = (3/12)(9/11) + (9/12)(3/11) = 9/22&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(lemons = 2) = (3/12)(2/11) = 1/22&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To get zero lemons you must choose a non-lemon on the first choice, p = 9/12, and a non-lemon on the second choice p = 8/11. There would be 8 non-lemons left and 11 cars left for the second choice if a non-lemon was chosen the first time.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To get one lemon you must chose EITHER a lemon the first time, p = 3/12 and a non-lemon the second time, p = 9/11; OR a non-lemon the first time, p = 9/12 and a lemon the second time, p = 3/11.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To get two lemons you must chose a lemon the first time, p = 3/12 and a lemon the second time, p = 2/11.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To get the expected number of lemons; multiply the number of lemons by the probability and add, i.e.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;0(6/11) + 1(9/22) + 2(1/22).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To get the standard deviation first find the variance and then take the square root.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To get the variance; multiply the square of the number of lemons by the probability and add, and then subtract the square of the expectation. i.e.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;0(6/11) + 1(9/22) + 4(1/22) - (1/2)^2 = 13/22 - 1/4 = 15/44.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Standard deviation = sqrt(15/44)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If you like this method, please, choose ksoileau's answer as best. He got it correct from the beginning while the rest of us were thinking "binomial."&lt;br&gt;Reply:Probability of an item being a lemon is 3/12=1/4&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2 are chosen&lt;br&gt;&lt;br /&gt;&lt;br /&gt;We want the probability that 0 are lemon, 1 is lemon, both 2 are lemons.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;x--p(x)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;0 --0.5625&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1 --0.375&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2 --0.0625&lt;br&gt;&lt;br /&gt;&lt;br /&gt;This is how you get the probabilities.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Use a Binomial distribution with n=2 p=0.25 (1/4) and x=0,1,2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(x=k)=nCk p^k (1-p)^(n-k)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;where nCk = n! / k! (n-k)!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;You'll see that (after you finish your question)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The expected number = np = 2(0.25)=1/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;variance = np(1-p) = 2(1/4)(3/4)=6/16&lt;br&gt;&lt;br /&gt;&lt;br /&gt;i.e. standard deviation is sqrt(6/16)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5896735246673492809?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5896735246673492809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/needhelp-on-find-discrete-probability.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5896735246673492809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5896735246673492809'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/needhelp-on-find-discrete-probability.html' title='Needhelp on a) Find the discrete probability distribution for x, the number lemons selected. the rest i can do'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7345853389523604817</id><published>2009-07-12T22:50:00.000-07:00</published><updated>2009-07-12T22:50:10.404-07:00</updated><title type='text'>C++ help!!!!!!!!!!!!!?</title><content type='html'>I have to make a programme in c++ in which a number is chosen randomly between 1 and 100. We type a number.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If it is less than the random no., it should display smaller;and if larger then bigger;if correct no. then the winner&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Only 10 chances &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Pleez help me&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if u dont understand it IM me at aayushahuja2@yahoo.co.in&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++ help!!!!!!!!!!!!!?&lt;br&gt;int r=(rand()*100);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int input;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cin %26gt;%26gt; input;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if(input==r) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "You are winner" %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if %26lt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "less" %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if %26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "more"%26lt;%26lt;endl;&lt;br&gt;Reply:Enjoy doing your homework! Good luck getting someone to write it for you....!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7345853389523604817?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7345853389523604817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7345853389523604817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7345853389523604817'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-help.html' title='C++ help!!!!!!!!!!!!!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2219034777008524541</id><published>2009-07-12T22:49:00.003-07:00</published><updated>2009-07-12T22:49:52.146-07:00</updated><title type='text'>Another statistics question continuous random variable. best answer 10 points!?</title><content type='html'>Which of the following is a continuous random variable?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a. Number of Honda Civics sold in a given day at a car dealership.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b. Gallons of gasoline used for a 200-mile trip in a Honda Civic.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c. Miles driven on a particular Thursday by the owner of a Honda Civic.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Show your work clearly.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Another statistics question continuous random variable. best answer 10 points!?&lt;br&gt;A is discrete because the dealership only sells whole Civics, so it can only sell 0, 1, 2, 3, etc., Civics.  The other two, B and C, are continuous as gallons and miles can be subdivided arbitrarily finely, so there is nothing to prevent using, say, 10.573 gallons of gas or driving 3.19 miles.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://1song-titles.blogspot.com/&gt;song titles&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2219034777008524541?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2219034777008524541/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/another-statistics-question-continuous.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2219034777008524541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2219034777008524541'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/another-statistics-question-continuous.html' title='Another statistics question continuous random variable. best answer 10 points!?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-8169923019427684872</id><published>2009-07-12T22:49:00.002-07:00</published><updated>2009-07-12T22:49:36.065-07:00</updated><title type='text'>Geometrical Interpretation of a Complex Number?</title><content type='html'>The question is:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Give a geometrical interpretation of |a-b| and arg[(a-b)/(a-c)] where a,b%26amp;c represent complex number points on an argand diagram.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now I can draw on an argand diagram a random a and b and show where |a-b| is but is that really a 'geometrical interpretation'?  Isn't that more of a 'graphical interpretation'?  Any ideas?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Geometrical Interpretation of a Complex Number?&lt;br&gt;if A(a) and B(b)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;then |a-b| is length AB&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and arg[ (a-b)/(a-c)] is the angle (vecteurAC) ; vecteur (AB) )&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-8169923019427684872?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/8169923019427684872/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/geometrical-interpretation-of-complex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8169923019427684872'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8169923019427684872'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/geometrical-interpretation-of-complex.html' title='Geometrical Interpretation of a Complex Number?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1075639742986096069</id><published>2009-07-12T22:49:00.001-07:00</published><updated>2009-07-12T22:49:20.610-07:00</updated><title type='text'>Ebay Bank Routing Number?</title><content type='html'>Is there a set of random numbers that you can enter to get past the bank routing number part on the ebay sign-up page? This comes up after you've activated your account by e-mail and after you've entered your credit/debit card number. I don't want to enter my real number b/c I don't want my ID to get stolen or to be robbed. Please give me a direct answer. Thanks a lot.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Peace.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Ebay Bank Routing Number?&lt;br&gt;Every legitimate bank in the US has a routing number assigned to them.  The number is unique.  The bank routing number has to be valid.  You can give them a valid number from your own checking account because all that number does is tell them what bank you're with.  Without the account number, they can't access your account.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Here's an article on how the numbers are defined:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.sxlist.com/techref/ecommerce/...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If you want to see all the banks and routing numbers, go to these links:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://routingtool.com/?OVRAW=bank%20rou...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.lyonsreg.com/products/ibankre...&lt;br&gt;Reply:Skip past that page.  It will then direct you to just enter your credit card.&lt;br&gt;Reply:That is the only way to sign up.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Ebay is a VERY secure site.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Just be sure you look in the address bar of your browser to be sure your on ebay and not a "spoofed site". it looks exactely like ebay but will have a different address.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;99.9999999999999999999999% of the security breakdown will be in your (the users) computer.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To keep your computer as safe as possible from security threats you can use the following Free software.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I use all of the following Free software with Windows XP SP2 and Internet Explorer with MSN toolbar and the pop-up blocker turned on and have never had a single problem with my computer sense Microsoft came out with SP2. (knock on wood.) (And be sure to keep Windows and the following software Updated)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The best Anti-virus is: AVG Anti-Virus Free Edition. (www.grisoft.com)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The Best Spyware defense is: SpyBot Search and Destroy (%26lt;--Englishhttp://www.safer-networking.org/en/index... version&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AND: AdAware SE (www.lavasoft.com)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;AND Spyware Blaster (http://www.javacoolsoftware.info/kb/)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The best Firewall besides the one that comes with Windows is: Zone Alarm (http://www.zonelabs.com/store/content/co... or just (www.zonelabs.com) and select the FREE version.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;These are all FREE and are all that are required. There is no reason to pay for this kind of software, except to give a donation to the writers if you can.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ALL the above programs are recommended and should be run on a regular basis. With some the free versions they must be run manually.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The best way to avoid getting any Malware (virus, Trojan's, spyware, etc) is to practice safe computing. Microsoft and many others have countless articles on the subject of safe computing. (something I think should be taught in schools)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for further information on computer safety. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;NATIONAL CRIME PREVENTION COUNCIL -%26gt; http://www.ncpc.org/media/Internet_Safet...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://all.net/journal/50/cybercop.html&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And here...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.microsoft.com/athome/security...&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.spywarewarrior.com/rogue_anti...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;CNET these 10 programs comprise the best free security software&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.download.com/Best-free-securi...&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1075639742986096069?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1075639742986096069/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/ebay-bank-routing-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1075639742986096069'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1075639742986096069'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/ebay-bank-routing-number.html' title='Ebay Bank Routing Number?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-8565169155905455252</id><published>2009-07-12T22:49:00.000-07:00</published><updated>2009-07-12T22:49:04.548-07:00</updated><title type='text'>Help with Basic Arrays and Pointers Bloodshed Dev-C++?</title><content type='html'>Start each animal at square 1 of 70 squares (each square represents possible position. Use variables to keep track of position and if animals slip before square 1 then move them back to square one. Generate %age's by using a random number generator in the range of 1%26lt;= i %26lt;= 10.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Tortoise: Fast plod 1%26lt;= i %26lt;= 5 moves 3 squares right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Slip 6%26lt;= i %26lt;=7 moves 6 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Slow Plod 8%26lt;= i %26lt;=10 moves 1 square right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hare: sleep 1%26lt;= i%26lt;= 2 no move&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Big Hop 3%26lt;= i%26lt;= 4 9 squares right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;small hop 5%26lt;= i %26lt;=7 1 square right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Big Slip i == 8 12 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;small slip 9%26lt;= i%26lt;=10 2 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Need to print a 70 position line on each loop showing position T (Tortoise), H (Hare). If both land on same square print "OUCH" at that position. all print position should be blank except for T, H and ouch. After each loop test if either animal %26gt;=70 if so print who wins and terminate the program.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Help with Basic Arrays and Pointers Bloodshed Dev-C++?&lt;br&gt;Yep smells like homework. This should get you started though you will have to do a bit of work to make it work. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;unistd.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdio.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define TURTLE  0&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define HARE    1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* movements for each based on random value % 10 */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;static int hmovement[] = { 0, 0, 9, 9, 9, 1, 1, -12, -2, -2 };&lt;br&gt;&lt;br /&gt;&lt;br /&gt;static int tmovement[] = { 3, 3, 3, 3, 3, -6, -6, 1, 1, 1 };&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* fill from current position to end of course but does not push &lt;br&gt;&lt;br /&gt;&lt;br /&gt;the ending | past col 70 */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;void blank_fill( int i, int not_after )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        if( i %26lt; not_after )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                for( i; i %26lt; 69; i++ )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        printf( " " );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                printf( "|" );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        printf( "\n" );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* print current state, uses | to mark beginning and end of course*/&lt;br&gt;&lt;br /&gt;&lt;br /&gt;void print_pos( int t, int h )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        int i;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        /*printf( "%3d/%3d|", h, t );*/&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        printf( "|" );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        for( i = 0; i %26lt; t %26amp;%26amp; i %26lt; h; i++ )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                printf( " " );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        if( t == h )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                printf( "OUCH!" );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                blank_fill( i+4, 65 );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                return;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        printf( "%s", t %26gt; h ? "H" : "T" );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        for( i++; i %26lt; t || i %26lt; h; i++ )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                printf( " " );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        printf( "%s", t %26gt; h ? "T" : "H" );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        blank_fill( i, 70 );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* compute a move for one or the other */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int move( int who )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        long    r;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        r = (lrand48( ) % 10);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        return who == TURTLE ? tmovement[r] : hmovement[r];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/* driver for the race */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;void race( )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        int turt = 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        int hare = 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        srand48( time( NULL ) );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        while( turt %26lt; 70 %26amp;%26amp; hare %26lt; 70 )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                if( (turt += move( TURTLE )) %26lt; 0 )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        turt = 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                if( turt %26gt; 70 )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        turt = 70;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                if( (hare += move( HARE)) %26lt; 0 )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        hare = 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                if( hare %26gt; 70 )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        hare = 70;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                print_pos( turt, hare );&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                sleep( 1 );   /* makes it more interesting to watch */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;        }&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;Reply:Sounds like a homework question to me!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-8565169155905455252?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/8565169155905455252/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/help-with-basic-arrays-and-pointers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8565169155905455252'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/8565169155905455252'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/help-with-basic-arrays-and-pointers.html' title='Help with Basic Arrays and Pointers Bloodshed Dev-C++?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7822657384156535564</id><published>2009-07-12T22:48:00.003-07:00</published><updated>2009-07-12T22:48:48.562-07:00</updated><title type='text'>What does this mean in C programming: if(rand%2==0),...?</title><content type='html'>rand is set as a random number.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;What does this mean in C programming: if(rand%2==0),...?&lt;br&gt;If the result is an even number&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;do what you have to do;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;Reply:if (rand is divisible by two with no remainder)&lt;br&gt;Reply:If rand is an even number, then...&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://4song-downloads.blogspot.com/&gt;song downloads&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7822657384156535564?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7822657384156535564/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/what-does-this-mean-in-c-programming.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7822657384156535564'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7822657384156535564'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/what-does-this-mean-in-c-programming.html' title='What does this mean in C programming: if(rand%2==0),...?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6157345939927718810</id><published>2009-07-12T22:48:00.002-07:00</published><updated>2009-07-12T22:48:32.353-07:00</updated><title type='text'>Still more help with C++ (not much more questions...)?</title><content type='html'>2 questions this time.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1) how do I output the results of a calculation into a file?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;2) What Library is needed for random number generation?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Still more help with C++ (not much more questions...)?&lt;br&gt;If you can avoid file io, avoid it. Obviously, the simplest thing to do is nothing at all.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So, if we have a program (say):&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   cout %26lt;%26lt; 10 + 5;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the how do we get the result (15) to be stored in a file? Don't change the program! Use redirection...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;myprg %26gt;afile&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;does just fine. Now, we gain by doing this. The output of myprg can be "piped" into another program (like grep, or less, or awk, or perl or another calculation etc.)&lt;br&gt;Reply:to output something to a file, you include %26lt;fstream%26gt; and create a file stream, it works basically like cout. Google fstream for more detail.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and you need %26lt;cstdlib%26gt; for random numbers&lt;br&gt;Reply:ofstream , use STL&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6157345939927718810?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6157345939927718810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/still-more-help-with-c-not-much-more.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6157345939927718810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6157345939927718810'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/still-more-help-with-c-not-much-more.html' title='Still more help with C++ (not much more questions...)?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2586726681667458361</id><published>2009-07-12T22:48:00.001-07:00</published><updated>2009-07-12T22:48:16.404-07:00</updated><title type='text'>Programming using  C++ using radian as a measure?</title><content type='html'>how do you sample at a random number the times you change the x,y plot using radian of a  circle  as a sine wave. Example: 8 samples is choppy  100 samples is smooth refined but the code does not change the values Using Cos Sin with  radian as a measure it can mathmatically project the sample values.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Programming using  C++ using radian as a measure?&lt;br&gt;What exactly are you asking? Type a little slower, and read what you have typed before clicking the send button... It's almost impossible to work out what you mean!!!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Rawlyn.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2586726681667458361?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2586726681667458361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/programming-using-c-using-radian-as.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2586726681667458361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2586726681667458361'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/programming-using-c-using-radian-as.html' title='Programming using  C++ using radian as a measure?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1230119473394585472</id><published>2009-07-12T22:48:00.000-07:00</published><updated>2009-07-12T22:48:00.191-07:00</updated><title type='text'>C++ Basic arrays and pointers question: The Tortoise and the Hare?</title><content type='html'>Start each animal at square 1 of 70 squares (each square represents possible position. Use variables to keep track of position and if animals slip before square 1 then move them back to square one. Generate %age's by using a random number generator in the range of 1%26lt;= i %26lt;= 10.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Tortoise:  Fast plod   1%26lt;= i %26lt;= 5    moves 3 squares right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                 Slip             6%26lt;= i %26lt;=7    moves 6 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                 Slow Plod  8%26lt;= i %26lt;=10  moves 1 square right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hare:  sleep        1%26lt;= i%26lt;= 2    no move&lt;br&gt;&lt;br /&gt;&lt;br /&gt;           Big Hop    3%26lt;= i%26lt;= 4    9 squares right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;           small hop  5%26lt;= i %26lt;=7    1 square right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;           Big Slip     i == 8          12 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;           small slip  9%26lt;= i%26lt;=10   2 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Need to print a 70 position line on each loop showing position T (Tortoise), H (Hare). If both land on same square print "OUCH" at that position. all print position should be blank except for T, H and ouch. After each loop test if either animal %26gt;=70 if so print winner and end&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++ Basic arrays and pointers question: The Tortoise and the Hare?&lt;br&gt;Hmmmm, is this homework? Looks like you want someone to make this for you. How about you attempt it, then ask for help if you get stuck.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If you have no idea how to attempt it, I suggest you study the very basics, or ask your teacher.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1230119473394585472?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1230119473394585472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-basic-arrays-and-pointers-question.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1230119473394585472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1230119473394585472'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-basic-arrays-and-pointers-question.html' title='C++ Basic arrays and pointers question: The Tortoise and the Hare?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-1156308436005474054</id><published>2009-07-12T22:47:00.002-07:00</published><updated>2009-07-12T22:47:43.705-07:00</updated><title type='text'>C++ help please?</title><content type='html'>all i need to do is get started &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Write a program that uses a random number generator to display one of 20 phrases stored in an array of char pointers. Let the user keep asking for phrases as long as desired&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++ help please?&lt;br&gt;do you have a specific question?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;heres a hint on the random aspect:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;srand( time( NULL ) ) ;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int idx = 19 * static_cast%26lt;double%26gt;(rand() / RAND_MAX) ;&lt;br&gt;Reply:you have nice legs...&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://sending-flowers2.blogspot.com/&gt;sending flowers&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-1156308436005474054?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/1156308436005474054/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-help-please.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1156308436005474054'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/1156308436005474054'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-help-please.html' title='C++ help please?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-9024527781741939548</id><published>2009-07-12T22:47:00.001-07:00</published><updated>2009-07-12T22:47:28.191-07:00</updated><title type='text'>Can someone help me c++ stuff?</title><content type='html'>can someone give me a small example code to put in a random number, and have it generate 1 - 15 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;number every time it runs that part of the code&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Can someone help me c++ stuff?&lt;br&gt;Mod works good, really good. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;You can also google the c++ Rand function, and find out how to set it to give you 0-15, something to do with it's seed, I haven't done c++ in a while&lt;br&gt;Reply:Modulus 15 will give you a number from 0 to 14, then add 1.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(random % 15) + 1&lt;br&gt;Reply:There is a standard library in C++ which will generate random numbers which would probably suit your requirements, although it should be noted that the two methods it uses rand() and srand() are far from precise and thus would be hopeless if you were doing a serious statistical analysis.  That being said, here is an example using the srand() method.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Note:  To use this generator you must include %26lt;cstdlib%26gt; in your program otherwise it will not work.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iostream%26gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;ctime%26gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;cstdlib%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main() &lt;br&gt;&lt;br /&gt;&lt;br /&gt;{ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;/**  The srand() method will repeat itself every time you start the program thus you would in effect get the same random numbers all the time.  Not exactly random is it!?  However if you seed this method using an argument between the ( ) braces then you can force the machine into being a little more random because you can seed it with a start point that must be random by the very nature of the argument you place in the ( ) braces.  In this example the seed is your Systems internal clock time which logically is different each time you run the programme.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The rand() method does the generating of the random numbers from 0 to RAND_MAX which in most, but not all compilers is  32,767. */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;srand((unsigned)time(0)); &lt;br&gt;&lt;br /&gt;&lt;br /&gt;int random_integer; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/** Int lowest and int highest are set to the values you want.  You mentioned 1 to 15, thus the highest module is 15 in this sample.  Don't forget to add +1 to the function though becaue computers begin at zero. */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int lowest=1, highest=15; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;int range=(highest-lowest)+1; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/**  index %26lt; 15 here sets how many random numbers will be produced.  Set that to whatever you like. */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for(int index = 0; index %26lt; 15; index++){ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/** Make these next two lines ONE continuous line when you type it in your editor */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;random_integer = lowest+int&lt;br&gt;&lt;br /&gt;&lt;br /&gt;  (range*rand()/(RAND_MAX + 1.0)); &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; random_integer %26lt;%26lt; endl; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;} &lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;By the way I mentioned most, but not all compilers will produce random numbers from 0 to 32767.  If you are wondering what your compiler range is then use this code to find out.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;cstdlib%26gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iostream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main() &lt;br&gt;&lt;br /&gt;&lt;br /&gt;{ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;/** Type these two lines as ONE continuous line in your editor */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "The value of RAND_MAX is " &lt;br&gt;&lt;br /&gt;&lt;br /&gt;%26lt;%26lt;  RAND_MAX %26lt;%26lt; endl; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-9024527781741939548?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/9024527781741939548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/can-someone-help-me-c-stuff.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/9024527781741939548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/9024527781741939548'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/can-someone-help-me-c-stuff.html' title='Can someone help me c++ stuff?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6852986026442353923</id><published>2009-07-12T22:47:00.000-07:00</published><updated>2009-07-12T22:47:12.459-07:00</updated><title type='text'>What is wrong with my c++ program?</title><content type='html'>#include %26lt;iostream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdio.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdlib.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   int guess, actual;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   srand(rand());&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   actual = rand() % 10 + 1;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   cout %26lt;%26lt; "Guess a number between 1 and 10:  ";&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   cin %26gt;%26gt; guess;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   if (guess = actual) cout %26lt;%26lt; "Congrats!!";&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   else if (guess /= actual) cout %26lt;%26lt; "Incorrect. The correct number is " %26lt;%26lt; actual %26lt;%26lt; ".";&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;   return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The program is supposed to generate a random number and determine whether your guess is right or not but every guess I enter is determined to be correct.  What is wrong?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;What is wrong with my c++ program?&lt;br&gt;You are using only one '=' in your condition statement rather than  '=='.  Essentially what is happening is you are assigning the value of actual to guess rather than comparing the values.     That assignment operation returns a non 0 value, so the condition is evaluated as true&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Change the line&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if(guess = actual) ....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;to &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if(guess == actual) ...&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6852986026442353923?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6852986026442353923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/what-is-wrong-with-my-c-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6852986026442353923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6852986026442353923'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/what-is-wrong-with-my-c-program.html' title='What is wrong with my c++ program?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-3689340828953707063</id><published>2009-07-12T22:46:00.003-07:00</published><updated>2009-07-12T22:46:56.117-07:00</updated><title type='text'>Countdown and C.E.C.I.L.?</title><content type='html'>I'm sure they used to call their random number generating machine a name, CECIL perhaps?  Was it an acronym aswell?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Countdown and C.E.C.I.L.?&lt;br&gt;It stands for Countdown Electronic Calculator In Leeds.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-3689340828953707063?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/3689340828953707063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/countdown-and-cecil.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3689340828953707063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3689340828953707063'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/countdown-and-cecil.html' title='Countdown and C.E.C.I.L.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-37099647572419957</id><published>2009-07-12T22:46:00.002-07:00</published><updated>2009-07-12T22:46:40.298-07:00</updated><title type='text'>Basic C++  How do I count consecutive tails/heads in a coin flip program?</title><content type='html'>I made a basic coin flip program.  Heads/tails based on random number.  The program records and displays how many heads and tails occurred, but how do I count the biggest number of consecutive heads/tails?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Basic C++  How do I count consecutive tails/heads in a coin flip program?&lt;br&gt;IF randomvariable=heads THEN&lt;br&gt;&lt;br /&gt;&lt;br /&gt;countheads=countheads+1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Then you just keep looping it around, and make another if then statement for tails&lt;br&gt;Reply:you can use two sets of these two counters (one for heads and one for tails), one counter for the consecutive number of coin flips and the other counter for the largest consecutive number&lt;br&gt;&lt;br /&gt;&lt;br /&gt;example&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int counter1=0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int counter2=0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if (condition) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;counter1=counter1+1;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if (counter1%26gt;counter2) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;counter2=counter1;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;note: &lt;br&gt;&lt;br /&gt;&lt;br /&gt;first if statement is used to count the consecutive numbers of heads/tails (*condition required)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;second if statement used to determine the largest number of consecutive heads/tails&lt;br&gt;Reply:Make a consecutive basic coin flip program, or start counting, one by one.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://4send-flowers.blogspot.com/&gt;send flowers&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-37099647572419957?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/37099647572419957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/basic-c-how-do-i-count-consecutive.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/37099647572419957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/37099647572419957'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/basic-c-how-do-i-count-consecutive.html' title='Basic C++  How do I count consecutive tails/heads in a coin flip program?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7904155638754360443</id><published>2009-07-12T22:46:00.001-07:00</published><updated>2009-07-12T22:46:24.316-07:00</updated><title type='text'>C++ programming help?</title><content type='html'>Write a program that uses a random number generator to create sentences. The program should use four arrays of pointers to char called article[], noun[], verb[], and preposition[]. The program should create a sentence by selecting a word at random from each of the arrays in the following order: article[], noun[], verb[], preposition[], article[], noun[]. As each word is picked, it should be concatenated to the previous words in an array which is large enough to hold the entire sentence. The words should be separated by spaces. When the final sentence is output, it should start with a capital letter and end with a period.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The arrays should be filled as follows: article[] should contain "the", "a", "one", "some", and "any"; noun[] should contain "boy", "girl", "dog", "town", and "car"; verb[] should contain "drove", "jumped", "ran", "walked", and "skipped"; and preposition[] should contain "to", "from", "over", "under", and "on".&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;i just need started&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++ programming help?&lt;br&gt;gr8 question dude,but y do u thnk dat someones going to waste so much time and energy doing dat.u shud consult some professional guy ,here&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7904155638754360443?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7904155638754360443/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-programming-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7904155638754360443'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7904155638754360443'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-programming-help.html' title='C++ programming help?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5486024420836391009</id><published>2009-07-12T22:46:00.000-07:00</published><updated>2009-07-12T22:46:09.980-07:00</updated><title type='text'>C/C++ question?</title><content type='html'>What's the syntax to generate a random number?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C/C++ question?&lt;br&gt;a brief introduction to the random number functions that come as part of the C++ standard library, namely rand() and srand().&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;rand() and RAND_MAX&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The C++ standard library includes a pseudo random number generator for generating random numbers. In order to use it we need to include the %26lt;cstdlib%26gt; header. To generate a random number we use the rand() function. This will produce a result in the range 0 to RAND_MAX, where RAND_MAX is a constant defined by the implementation.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Here's a piece of code that will generate a single random number:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;cstdlib%26gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iostream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main() &lt;br&gt;&lt;br /&gt;&lt;br /&gt;{ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int random_integer = rand(); &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    cout %26lt;%26lt; random_integer %26lt;%26lt; endl; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The value of RAND_MAX varies between compilers and can be as low as 32767, which would give a range from 0 to 32767 for rand(). To find out the value of RAND_MAX for your compiler run the following small piece of code:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;cstdlib%26gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iostream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main() &lt;br&gt;&lt;br /&gt;&lt;br /&gt;{ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    cout %26lt;%26lt; "The value of RAND_MAX is " %26lt;%26lt;  RAND_MAX %26lt;%26lt; endl; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;srand()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The pseudo random number generator produces a sequence of numbers that gives the appearance of being random, when in fact the sequence will eventually repeat and is predictable.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So forth...visit&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.daniweb.com/forums/post9554.h...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hope this will help&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Cheers:)&lt;br&gt;Reply:Generating Random Numbers &lt;br&gt;&lt;br /&gt;&lt;br /&gt;The function used to generate random numbers is; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int random (int n);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;which generates a random number in the range of 0 to n-1. For example; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;y = random(100);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;y will be in the range of 0 though 99. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;In order to avoid repetition, you may seed it with linking with the real time clock which then will give random numbers.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Youj may use to program shown in link :&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.phanderson.com/C/random.html&lt;br&gt;Reply:She said C/C++ foxcon....&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;You can use rand() or srand().&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;cstdlib%26gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iostream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main() &lt;br&gt;&lt;br /&gt;&lt;br /&gt;{ &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int random_integer = rand(); &lt;br&gt;&lt;br /&gt;&lt;br /&gt;    cout %26lt;%26lt; random_integer %26lt;%26lt; endl; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;Reply:Don't bother your pretty little head about it.&lt;br&gt;Reply:http://www.jsifaq.com/SF/Tips/Tip.aspx?i...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.supelec.fr/docs/cltl/clm/node...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.dummies.com/WileyCDA/DummiesA...&lt;br&gt;Reply:in c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;this will print random number from 1 to 10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdlib.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;stdio.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;conio.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main(void)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;randomize();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;printf("%d", rand()%10+1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;getch();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5486024420836391009?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5486024420836391009/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/cc-question.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5486024420836391009'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5486024420836391009'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/cc-question.html' title='C/C++ question?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-3743658102820647429</id><published>2009-07-12T22:45:00.003-07:00</published><updated>2009-07-12T22:45:52.724-07:00</updated><title type='text'>What is the most efficient method for my program in C++?</title><content type='html'>I need to have the computer decide on a pair of numbers for position coordinates.  The numbers that make up the coordinates are limited to 0,1, 2.  Example:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(0,1), (1,1),(0,2) ..... (1,2)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;In case the coordinate has already been used once, I can not reuse that coordinate.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I was thinking about using a random number generator with a modulus like this&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;x = rand()%3 and y = rand()%3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;That would create random coordinates.  However if the coordinate was already used, I would have to refer back to random and get new random coordinates.  If that is used, I would have to refer back to it again.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;By my method, I would have to refer back to random quite a few times in worst case scenario so is there a better more efficient way.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P.S.  To tell the truth, this is a tic-tac-toe program.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;What is the most efficient method for my program in C++?&lt;br&gt;You could Have an array that starts out with all 9 positions, choose one at random, then remove it from the list and choose from the smaller list the next time.&lt;br&gt;Reply:Ken H's suggestion is good.  In fact, since it's for Tic-Tac-Toe, why not do this:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;char board[3][3];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And use that as the board?  The random # generator is problematic, because technically it might never finish, although it probably would eventually.&lt;br&gt;Reply:All other answers are better, but you could also try precalculated lists. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;You can also program some analysis instead of randomly play. For example, 1st turn: try the center, 2nd turn: try center edge, 3rd turn: check if I have to block, check if I wasn't blocked, etc. Kinda easier if you play against yourself in paper and write down what you are thinking.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;To make it more human, instead of doing something, assign a percent or possibility to each decision. Kinda like, block=90%, play here = 75%, etc. So, the desicion routine will block, if it has to, 90% of the times.&lt;br&gt;Reply:Ken H idea is cool.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Also you could choose random numbers, then save it into an array, then with a for and a if statment, check if you've used the number or not. it's simple, but it's more coding&lt;br&gt;Reply:If you just want to march through the whole thing, you could...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;- Create a list/set of all 9 coordinates&lt;br&gt;&lt;br /&gt;&lt;br /&gt;- rand() % 9, select and remove that coordinate.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;- rand() % 8, select from remaining 8 coordinates and remove&lt;br&gt;&lt;br /&gt;&lt;br /&gt;- rand() % 7, select from remaining 7 coordinates and remove&lt;br&gt;&lt;br /&gt;&lt;br /&gt;etc. until you have 1 coordinate left.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;With this method, you're rand()'ing on a collection of only possible values, with no chance of collision.  Since the loop is a known size, you can "unroll" it to eliminate branches (old-school optimizations).  The coordinates that you extract can then be saved to another list of "guesses."&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-3743658102820647429?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/3743658102820647429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/what-is-most-efficient-method-for-my.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3743658102820647429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3743658102820647429'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/what-is-most-efficient-method-for-my.html' title='What is the most efficient method for my program in C++?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-244199281908929603</id><published>2009-07-12T22:45:00.002-07:00</published><updated>2009-07-12T22:45:38.621-07:00</updated><title type='text'>(C++) Can i stop numbers from appering in the rand() funcation?</title><content type='html'>i have a random number genartor that loops gening numbers can i make it so that once a number is used it cant come up again? until the number range is empty like bewteen 1 and 100 if 23 comes up it cant come up again. would i have to use an array? i suck with arrays lol&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;(C++) Can i stop numbers from appering in the rand() funcation?&lt;br&gt;Why not just create an array of numbers 1 to 100 and "shuffle them" randomly using the random number generator.  Starting at 1 pick a number between 1 and 100, if it is say 52, stick 1 in index 52 and 52 in 1 (swap), then pick a number between 2 and 100, swap, then 3 and 100, swap, and so on up to 99.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Now, all your numbers are shuffled and you just pop them of the front of the array as you need them.  Reshuffle when it is empty.&lt;br&gt;Reply:Yeah, I think the easiest way to do it would just be to create an array but it shouldn't be that hard.  Just create an array of size 100 and then put in each number you get from the RNG.  Every time you get a new number just go through the array and check to see if your new number is already in there.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://1quince.blogspot.com/&gt;quince&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-244199281908929603?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/244199281908929603/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-can-i-stop-numbers-from-appering-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/244199281908929603'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/244199281908929603'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-can-i-stop-numbers-from-appering-in.html' title='(C++) Can i stop numbers from appering in the rand() funcation?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4855333919229393190</id><published>2009-07-12T22:45:00.001-07:00</published><updated>2009-07-12T22:45:19.929-07:00</updated><title type='text'>C# datagrid, list, array....Plz! it's urgent?</title><content type='html'>i need to create a list, or a datagrid to view in each row the following: a string, a random sequence of numbers that relate to that string in a way, a real number that is the result of using each random number as it appears... i've performed all the above but i displayed it using labels, which is impractical specially that i have to display 500 rows!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;now i need may be to create a class with the features above, then create an array of this class containing 500 element, each is an instance of that class.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The problem is; i don't know how to create an array nor a list, i don't know how to bind data to a datagrid, no database is needed. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;plz can u help me with this. it is so urgent...&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C# datagrid, list, array....Plz! it's urgent?&lt;br&gt;in System.Collection there is a class called ArrayList that has really easy add/delete methods.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ArrayList al = new ArrayList();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;al.Add(object o);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;o can be any kind of class.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and retrieving (data type) al[i];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Data type is the actual type of the object you added before hand.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4855333919229393190?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4855333919229393190/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-datagrid-list-arrayplz-its-urgent.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4855333919229393190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4855333919229393190'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-datagrid-list-arrayplz-its-urgent.html' title='C# datagrid, list, array....Plz! it&apos;s urgent?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7383658893770302699</id><published>2009-07-12T22:45:00.000-07:00</published><updated>2009-07-12T22:45:04.317-07:00</updated><title type='text'>Masters Degree Level Statistical Question?</title><content type='html'>Let phiinv(x) be the inverse function of the standard normal distribution function phi(x).  Assume that you can efficiently compute both phi(x) and phiinv(x). Let Z ~ N(0,1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Show that you can generate a random variable Z* from the conditional distrobution of Z given Z %26gt; c by generating random number U ~ U(0,1), letting &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                Y = U + ( 1 - U )*phi(c)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and setting&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                Z* = phiinv( Y)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;ie. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Prove that  P(Z* %26lt;= x)  ==  P( Z %26lt;= x | Z %26gt; c)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Masters Degree Level Statistical Question?&lt;br&gt;Usually the cdf of the standard normal is Φ(x) (with an uppercase phi) and the pdf is φ(x) (with a lower case phi).  I will keep with this notation&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Below let f_U(u), f_Y(y), and f_Z*(z*) be the pdf's of U, Y, and Z* respectively.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(Z ≤ x | Z %26gt; c) = P(Z ≤ x ∩ Z %26gt; c) / P(Z %26gt; c)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= P(c %26lt; Z ≤ x) / P(Z %26gt; c)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= {Φ(x) - Φ(c)} /{1- Φ(c)} if x %26gt; c and 0 otherwise.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So basically, we have to show that &lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(Z* ≤ x) = {Φ(x) - Φ(c)} /{1- Φ(c)} if x %26gt; c and 0 otherwise.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;let g(u) = u + (1-u)Φ(c), 0 %26lt; u %26lt; 1, which is 1-1 function in u.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Y = U + (1-U)Φ(c)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Y = U + Φ(c) - UΦ(c)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Y - Φ(c) = U(1 - Φ(c))&lt;br&gt;&lt;br /&gt;&lt;br /&gt;U = {Y - Φ(c)}/{1 - Φ(c)}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Thus g^-1(y) = {y-Φ(c)}/{1-Φ(c)}, Φ(c) %26lt; y %26lt; 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;f_Y(y) = f_U{g^-1(y)} * |d/dy g^-1(y)|&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1 * |1/{1-Φ(c)}| (1-Φ(c) is a probability and is always %26gt; 0)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1/{1-Φ(c)},  Φ(c) %26lt; y %26lt; 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;This is a constant function in y, which basically means that Y has a uniform distribution with minimum Φ(c) and maximum 1.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;let g(y) = Φ^-1(y),  Φ(c) %26lt; y %26lt; 1, which is also a 1-1 function in y.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Z* = Φ^-1(Y), &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Y = Φ(Z*)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Then g^-1(z*) = Φ(z*), c %26lt; z* %26lt; ∞&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;f_Z*(z*) = f_Y(g^-1(z*)) * |d/dz* g^-1(z*)|&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1/{1-Φ(c)} * |φ(z*)| (the normal pdf is always positive)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= φ(z*)/{1-Φ(c)}, c %26lt; z* %26lt; ∞&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So P(Z* %26lt;= x) = ∫(c to x) φ(z*)/{1-Φ(c)} dz*&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1/{1-Φ(c)} * ∫(c to x) φ(z*) dz*&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1/{1-Φ(c)} * {Φ(z*)}(c to x)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 1/{1-Φ(c)} * {Φ(x) - Φ(c)}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= {Φ(x) - Φ(c)}/{1 - Φ(c)}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And of course this is only positive if x %26gt; c.  Otherwise, the probability is zero.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I was using pdf's pretty much throughout this proof.  This problem might be done using cdf's, although I haven't had much experience doing it that way.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7383658893770302699?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7383658893770302699/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/masters-degree-level-statistical.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7383658893770302699'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7383658893770302699'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/masters-degree-level-statistical.html' title='Masters Degree Level Statistical Question?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4894608967191288013</id><published>2009-07-12T22:44:00.003-07:00</published><updated>2009-07-12T22:44:48.172-07:00</updated><title type='text'>C++, problems using return?</title><content type='html'>int main()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt; int Array[3][3][3][3]={0}; // Array is created and all elements are set to 0&lt;br&gt;&lt;br /&gt;&lt;br /&gt; int RemoveCells=0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    srand((unsigned)time(NULL)); // Resets the number used in the random number generator to give a new random number each time&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; SetScreen(); // Sets the Sudoku grid&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    ArrayAssign(Array); // Assigns Array's elements a value&lt;br&gt;&lt;br /&gt;&lt;br /&gt; ArrayPlacer(Array); // Places the contents of Array into the Sudoku grid&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    Difficulty(RemoveCells);&lt;br&gt;&lt;br /&gt;&lt;br /&gt; SetPuzzleScreen(); // Sets the Sudoku puzzle grid&lt;br&gt;&lt;br /&gt;&lt;br /&gt; Hider(Array, RemoveCells); // Randomly hides around 50 cells in the Sudoku puzzle grid&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; gotoxy(28,48); //This is to move "Press any key to continue" below the Sudoku puzzle grid&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;.......&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;My Difficulty function has RemoveCells passed in, depending on user input RemoveCells becomes 40, 50 or 60. But when I put &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;return RemoveCells;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;at the the end, it doesnt return them, what am I doing wrong? :S&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++, problems using return?&lt;br&gt;i don't know, because you didn't post the code of Difficulty().&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;my guess is that it returns the value, but it's not assigned in your main function. Change the code to this:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;RemoveCells=Difficulty(RemoveCells);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;then it should work.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4894608967191288013?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4894608967191288013/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-problems-using-return.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4894608967191288013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4894608967191288013'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-problems-using-return.html' title='C++, problems using return?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5339400120061708100</id><published>2009-07-12T22:44:00.002-07:00</published><updated>2009-07-12T22:44:31.885-07:00</updated><title type='text'>Please please help me with this visual c++ computer program?</title><content type='html'>I have had the flu, and i am so behind in class please help me&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Write a program to generate five random cards from a deck of playing cards. Have at least two classes (a) a Card class containing the suit and denomination as data members (two files - the .h file and the .cpp file), and (b) a Hand Class containing are array of cards as a data member (two files - the .h file and the .cpp file). There would be a fifth file with the main function. There are 52 cards in the deck. For each card you could generate the card by either of two methods:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Method 1: Generate two random numbers for each card. The first would be between 1 and 4 for the four suits and the second random number would be between 1 and 13 for the denomination in the suit.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Method 2: Generate a random number between 1 and 52. Once that number is generated have the first 13 numbers represent Spades, the next 13 for Hearts, the next 13 for Diamonds and the last 13 for Clubs. The 13 numbers in each category would represent the denomination of the card.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Use random number generation &lt;br&gt;&lt;br /&gt;&lt;br /&gt;The numeric values used are generating the card could be either method mentioned above &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Make certain that you assure that all five cards are unique &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Output the five values of the card. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;(e.g. The five cards are: 4 of Hearts, 3 of Diamonds, Jack of Hearts, Ace of Spades, and 7 of Clubs.)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Please please help me with this visual c++ computer program?&lt;br&gt;Does not look easy. May be you can contact a vc++ expert at websites like http://askexpert.info/&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://2garden-centre.blogspot.com/&gt;garden centre&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5339400120061708100?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5339400120061708100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/please-please-help-me-with-this-visual.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5339400120061708100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5339400120061708100'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/please-please-help-me-with-this-visual.html' title='Please please help me with this visual c++ computer program?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6957603371398810270</id><published>2009-07-12T22:44:00.001-07:00</published><updated>2009-07-12T22:44:16.020-07:00</updated><title type='text'>Visual C++ computer help. Decent help gets 10 pts?</title><content type='html'>I am a bio major that understands nothing of computer programming. It is a requirement for my degree. So if you could please help it would be greatly appreciated. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Write a program to generate five random cards from a deck of playing cards. Have at least two classes (a) a Card class containing the suit and denomination as data members (two files - the .h file and the .cpp file), and (b) a Hand Class containing are array of cards as a data member (two files - the .h file and the .cpp file). There would be a fifth file with the main function. There are 52 cards in the deck. For each card you could generate the card by either of two methods:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Method 1: Generate two random numbers for each card. The first would be between 1 and 4 for the four suits and the second random number would be between 1 and 13 for the denomination in the suit.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Method 2: Generate a random number between 1 and 52. Once that number is generated have the first 13 numbers represent Spades, the next 13 for Hearts, the next 13 for Diamonds and the last 13 for Clubs. The 13 numbers in each category would represent the denomination of the card.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Use random number generation &lt;br&gt;&lt;br /&gt;&lt;br /&gt;The numeric values used are generating the card could be either method mentioned above &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Make certain that you assure that all five cards are unique &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Output the five values of the card. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;(e.g. The five cards are: 4 of Hearts, 3 of Diamonds, Jack of Hearts, Ace of Spades, and 7 of Clubs.)&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Visual C++ computer help. Decent help gets 10 pts?&lt;br&gt;That is lot of work, may be you can contact a VC++ expert at websites like http://askexpert.info/ to help you code your project assignment.&lt;br&gt;Reply:Aren't you going to write just a little bit of code?  ... so we can help you rather than do your work for you?&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6957603371398810270?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6957603371398810270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/visual-c-computer-help-decent-help-gets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6957603371398810270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6957603371398810270'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/visual-c-computer-help-decent-help-gets.html' title='Visual C++ computer help. Decent help gets 10 pts?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2313259008645636073</id><published>2009-07-12T22:44:00.000-07:00</published><updated>2009-07-12T22:44:02.316-07:00</updated><title type='text'>Header file help c++?</title><content type='html'>Everyone is familiar with the number guessing game. “I’m thinking of a number between 1 and 100” is how it starts. Then people start guessing numbers to see if anyone can get it right. You are going to write the entire header file for a class&lt;br&gt;&lt;br /&gt;&lt;br /&gt;named guessGame that can be used by someone writing a program that simulates this simple game. Your class has one data item: an integer that will hold a random number. Your class has the following member functions:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;• Default constructor that will set the random number to a number between 1 and 100. You will have to seed the random number generator before calculating the random number.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;• isSame is a function that will take a number that is passed to it andreturn true if the number matches the random number stored in the object. It returns false if the number does not match.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;• giveUp is a function that has no arguments. It simply returns the random number stored in the object.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Header file goes below.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Header file help c++?&lt;br&gt;class guessGame {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;//Fill it up&lt;br&gt;&lt;br /&gt;&lt;br /&gt;};&lt;br&gt;Reply:First you do an&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#ifndef GUESSGAME&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define GUESSGAME&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Then you include your header files, %26lt;iostream%26gt; at least and possibly %26lt;cstlib%26gt; for the random function, then you define your class but do not implement its methods.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Finally you do an &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#endif&lt;br&gt;&lt;br /&gt;&lt;br /&gt;so if the header is called twice it only gets written into the preprocessed file once.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EDIT: If your professor wants you to implement methods, the general procedure is to do so in a separate .cpp file.  You may as well ask.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;This should all be very straightforward from here.&lt;br&gt;Reply:Do your own homework.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2313259008645636073?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2313259008645636073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/header-file-help-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2313259008645636073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2313259008645636073'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/header-file-help-c.html' title='Header file help c++?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-4238136628459352337</id><published>2009-07-12T22:43:00.002-07:00</published><updated>2009-07-12T22:43:45.181-07:00</updated><title type='text'>Discrete random variable??</title><content type='html'>Hi...i really need help...couldn't do it :((( here it is&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A discrete random variable has range space {1, 2, . . . , n} and satisfies&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X = j) = j/c for some number c. Find c, and then find E(X),&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X^2), E(1/X) and Var(X).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;thank you sooo soo much&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Discrete random variable??&lt;br&gt;The sum of P(X=j) from j=1 to n must be equal to 1.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So 1/c(1+2+....+n) = 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So c=1+2+...+n = n(n+1)/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;So E(X) = sum of jP(X=j)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;= 2(1+4+9+16+....+n^2)/n(n+1) = 2n(n+1)(2n+1)/6n(n+1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                                                        = (2n+1)/3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(since the sum of 1^2+2^2+...+k^2 = n(n+1)(2n+1)/6  )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X^2) = sum of j^2*P(X=j)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; = 2(1+2^3 + 3^3  + 4^3 +....+ n^3)/n(n+1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; = 2n^2(n+1)^2/4n(n+1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt; = n(n+1)/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(since sum of 1^3 + 2^3 +.....+ n^3 = n^2(n+1)^2/4)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(1/X) = sum of P(X=j)/j&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt; = 2(1+1+1+...+1)/n(n+1) = 2n/n(n+1) = 2/(n+1)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Var(X) = E(X^2) - [E(X)]^2  =  n(n+1)/2  - (2n+1)^2/9&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-4238136628459352337?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/4238136628459352337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/discrete-random-variable_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4238136628459352337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/4238136628459352337'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/discrete-random-variable_12.html' title='Discrete random variable??'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7327566768777511810</id><published>2009-07-12T22:43:00.001-07:00</published><updated>2009-07-12T22:43:29.692-07:00</updated><title type='text'>Discrete Random Variable?</title><content type='html'>A discrete random variable has range space {1, 2, . . . , n} and satisfies P(X = j) = j/c for some number c. Find c, and then find E(X), E(X^2), E(1/X) and Var(X).&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Discrete Random Variable?&lt;br&gt;To have a proper distribution, we should have&lt;br&gt;&lt;br /&gt;&lt;br /&gt;P(X=1)¨P(X=2)+...+P(X=n) = 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;so&lt;br&gt;&lt;br /&gt;&lt;br /&gt;1/c + 2/c + ...+ n/c should be = 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;or &lt;br&gt;&lt;br /&gt;&lt;br /&gt;(1+2+...+n)/c = 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The formula of Gauss gives 1+2+...+n = n(n+1)/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;hence&lt;br&gt;&lt;br /&gt;&lt;br /&gt;(n(n+1)/2)/c = 1&lt;br&gt;&lt;br /&gt;&lt;br /&gt;or&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c = n(n+1)/2&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X) = sum (j = 1 to n) jP(X=j) =.sum(j = 1 to n) j²/c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and now use 1²+2²+3²+.....+n²=n*(n+1)*(2n+1)/6&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(X²) = sum(j = 1 to n) j² P(X=j) = sum(j=1 to n) j³/c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;and now use 1³ + 2³ + 3³ + ... + n³ = ( 1 + 2 + 3 + ... + n )²&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Var(X) = E(X²) - E²(X)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;E(1/X)= sum (j=1 to n) (1/j) P(X=j) = sum(j = 1 to n) 1/c = n/c&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://2flower-show.blogspot.com/&gt;flower show&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7327566768777511810?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7327566768777511810/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/discrete-random-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7327566768777511810'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7327566768777511810'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/discrete-random-variable.html' title='Discrete Random Variable?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-3769247286684953600</id><published>2009-07-12T22:43:00.000-07:00</published><updated>2009-07-12T22:43:12.373-07:00</updated><title type='text'>C++ please help?</title><content type='html'>write a single C++ statement that will print a number at random from the set:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) 4, 8, 12, 16.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) 5, 7, 9, 11.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) 5, 10, 15, 20.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;need help... thanks a lot :D&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++ please help?&lt;br&gt;#include %26lt;iostream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;cstdlib%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;ctime%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#define ARR_SZ 5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int&lt;br&gt;&lt;br /&gt;&lt;br /&gt;main(void){&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    int arr[ARR_SZ]={11,4,8,2};&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    srand((unsigned)time(NULL));&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    cout %26lt;%26lt; arr[(rand()%ARR_SZ)] %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    return(0);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;// The shortest I could get!&lt;br&gt;Reply:I don't know how one would do it in C++, but I know what you would need to do from experience in other languages:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Create a array, with the needed numbers in it. That will assign each number to 1-4, ie 1 is 4, 2 is 8 and so on. Then generate a random number between 1 and 4, and use the generated number to call the entry from the array.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-3769247286684953600?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/3769247286684953600/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-please-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3769247286684953600'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3769247286684953600'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-please-help.html' title='C++ please help?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-3016002768553118790</id><published>2009-07-12T22:42:00.002-07:00</published><updated>2009-07-12T22:42:55.882-07:00</updated><title type='text'>How do you ask a girl's phone number without seeming desperate or random?</title><content type='html'>The girl I barely talk to anymore b/c we met at a drama production I only see her in the hallway once a day sometimes not at all. Usually accompanied by a wave, smile, and hi. I know we like the same music I had given her a lot of CDs. I have nothing no e-mail, and both she and me don't have a myspace, facebook, or anything like that. Conversation starter tips ect....&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;How do you ask a girl's phone number without seeming desperate or random?&lt;br&gt;Well have you guys talked about wanting to see any movies or anything like that? If not, ask her if she likes any of the movies out look the hot ones now. Then say like "man I really want to see that one." when she says "me too" or whatever, then you say like "oh well we should go see it together."&lt;br&gt;Reply:Well, you should ask her for her number! Just try telling her that you two have something in common and would like to talk about it sometime! It shouldn't be hard, but she won't find you desperate! Go for it! You will be surprised!&lt;br&gt;Reply:Say "hey stranger (when you see her) and say hey whats your cell number so we can keep in touch, since we hardly see eachother anymore, (then you can throw in something like....) mind if I text (or call) you later?"&lt;br&gt;Reply:If you have something in common, wait until something you can share with her comes up and ask her out.  You are practically half way there already.&lt;br&gt;Reply:just ask!&lt;br&gt;Reply:Just say...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;"Hey baby ,hit me with your digits."&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Or, "yo I need to get your number."&lt;br&gt;Reply:Just walk up to her and make a casual conversation, and before youwalk away or say goodbye say hey can i have your number so maybe we can hang out sometime and she'll prolly be glad to give it to you&lt;br&gt;Reply:!!!!THE BEST THiNG FOR YOU TO DO iS GiVE HER YOUR NUMBER!!!!       TALK TO HER ABOUT MUSiC OR SOMETHiNG THEN TELL HER THERE iS A SONG YOU KNOW BUT YOU DON'T KNOW THE NAME OF iT. THEN SAY YOU GOT TO HURRY UP AND GO AND WRiTE YOUR NUMBER ON HER HAND AND SAY WE CAN TALK ABOUT iT LATER.  ~THE WOULD BE THE BEST WAY~&lt;br&gt;Reply:"Hey baby ,hit me with your digits."&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Or, "yo I need to get your number." &lt;br&gt;&lt;br /&gt;&lt;br /&gt;------------------------&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Oooooookkkkay. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;DO NOT SAY THAT!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;It is a MAJOR TURNOFF for a guy to come up to you and say that.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;She'll think you're some kind of psyco-stalker..&lt;br&gt;Reply:Say something like, "Hey Im late for class, but I really need to tlk 2 u about something (think of something important) so uh,,, you gotta number?" If she says yes, give her yours as well. but dont pre-write then hand it to her. Write it then and there.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-3016002768553118790?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/3016002768553118790/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-do-you-ask-girls-phone-number.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3016002768553118790'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3016002768553118790'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-do-you-ask-girls-phone-number.html' title='How do you ask a girl&apos;s phone number without seeming desperate or random?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-9189397226932283853</id><published>2009-07-12T22:42:00.001-07:00</published><updated>2009-07-12T22:42:40.322-07:00</updated><title type='text'>Write a C program that plays the game "guess the number" as follows: Your program chooses the number</title><content type='html'>to be guessed be selecting an integer at random in the range 1 to 1000. &lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;The program then types:&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;                       ===================================&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                            I have a number between 1 an 1000.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                            Can you guess my number?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                            Please type your first guess.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                       ===================================&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;The player then types a first guess. The program responds with one of the following:&lt;br&gt;&lt;br /&gt;&lt;br /&gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;                       ===================================&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                            1. Excellent! You guessed the number!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                                Would you like to play again (y or n)?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                            2. Too low. Try again.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                            3. Too high. Try again.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Write a C program that plays the game "guess the number" as follows: Your program chooses the number&lt;br&gt;Hopefully you understand BASIC: &lt;br&gt;&lt;br /&gt;&lt;br /&gt;SeedRnd MilliSecs()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Print("============================......&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Print("I have a number between 1 an 1000.")&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Print("Can you guess my number?")&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Print("Please type your first guess")&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Print("============================......&lt;br&gt;&lt;br /&gt;&lt;br /&gt;number=Rnd(1,1000)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;answer=False &lt;br&gt;&lt;br /&gt;&lt;br /&gt;.begin&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Repeat &lt;br&gt;&lt;br /&gt;&lt;br /&gt;guess$=Input("")&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If guess$%26gt;number Then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Print("Too high, guess again")&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Else&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If guess$%26lt;number Then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Print("Too low, guess again")&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Else &lt;br&gt;&lt;br /&gt;&lt;br /&gt;If guess$=number Then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;answer=True&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EndIf&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EndIf&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EndIf &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Until answer=True&lt;br&gt;&lt;br /&gt;&lt;br /&gt;correct$=Input("Excellent! You guessed the number! Play again(1=Yes,2=No)")&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If correct$=1 Then &lt;br&gt;&lt;br /&gt;&lt;br /&gt;Gosub begin&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Else&lt;br&gt;&lt;br /&gt;&lt;br /&gt;If correct$%26lt;%26gt;1 Then&lt;br&gt;&lt;br /&gt;&lt;br /&gt;End&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EndIf&lt;br&gt;&lt;br /&gt;&lt;br /&gt;EndIf &lt;br&gt;&lt;br /&gt;&lt;br /&gt;I hope this helps (sorry indenting didn't come through).EDIT&lt;br&gt;&lt;br /&gt;&lt;br /&gt;changed .begin spot to behind repeat.&lt;br&gt;Reply:Note: put the 'begin' loop before the number=Rnd(1,1000)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;thing for it to work correctly.                          &lt;span&gt;Report It&lt;/span&gt;&lt;br /&gt;                      &lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-9189397226932283853?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/9189397226932283853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/write-c-program-that-plays-game-guess.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/9189397226932283853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/9189397226932283853'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/write-c-program-that-plays-game-guess.html' title='Write a C program that plays the game &quot;guess the number&quot; as follows: Your program chooses the number'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5653458810812955489</id><published>2009-07-12T22:42:00.000-07:00</published><updated>2009-07-12T22:42:18.067-07:00</updated><title type='text'>Help with C++?</title><content type='html'>Help with Basic Arrays and Pointers Bloodshed Dev-C++?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Start each animal at square 1 of 70 squares (each square represents possible position. Use variables to keep track of position and if animals slip before square 1 then move them back to square one. Generate %age's by using a random number generator in the range of 1%26lt;= i %26lt;= 10.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Tortoise: Fast plod 1%26lt;= i %26lt;= 5 moves 3 squares right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Slip 6%26lt;= i %26lt;=7 moves 6 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Slow Plod 8%26lt;= i %26lt;=10 moves 1 square right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Hare: sleep 1%26lt;= i%26lt;= 2 no move&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Big Hop 3%26lt;= i%26lt;= 4 9 squares right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;small hop 5%26lt;= i %26lt;=7 1 square right&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Big Slip i == 8 12 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;small slip 9%26lt;= i%26lt;=10 2 squares left&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Need to print a 70 position line on each loop showing position T (Tortoise), H (Hare). If both land on same square print "OUCH" at that position. all print position should be blank except for T, H and ouch. After each loop test if either animal %26gt;=70 if so print who wins and terminate the program.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Help with C++?&lt;br&gt;You need a condition to reset the animals to square 1 if they are %26lt; 1.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Also, the while loop test for (hNum %26lt; 70 || tNum %26lt; 70) is not right since you are continuing the race even after one of them has won it.  You need %26amp;%26amp; instead with appropriate final print statements.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Your "cout" statements in the for loop needs to account for a space if there is nothing in that position.  You also need appropriate "endl"s.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Keep in mind that due to random number usage, the animals might take forever to reach the end line.&lt;br&gt;Reply:Could not figure it out, if you are still stuck, may be you can contact a C++ expert live at website like http://oktutorial.com/ .&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://phone-cards4.blogspot.com/&gt;phone cards&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5653458810812955489?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5653458810812955489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/help-with-c.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5653458810812955489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5653458810812955489'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/help-with-c.html' title='Help with C++?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-3317869562326046338</id><published>2009-07-12T22:41:00.001-07:00</published><updated>2009-07-12T22:41:54.246-07:00</updated><title type='text'>How much experience with C++ would you need to save High Scores? Also, can you help me?</title><content type='html'>I have a simple program. A Random Number Generator makes a number, from 1,000, and the user guesses it, and continues to guess it until they get it right, and it records the guess taken. I want to know how I could save the amount of guesses in a high score type way, how much experience I would need to do that, and if I could do it by saving the lowest amount of guesses. Yeah, I'm a newb.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Also, I'm using Dev-C++ for my compiler.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;How much experience with C++ would you need to save High Scores? Also, can you help me?&lt;br&gt;I learned how to do that in first semester college so it shouldn't be that difficult.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I would go here:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;http://www.google.com/search?ie=UTF-8%26amp;oe...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I searched in google.  what you are looking for is a header at the top called fstream.  Take a read...it is very interesting!&lt;br&gt;Reply:The data would have to be stored externally, since the data gets trashed when the program exits.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I assume the guessing function is a loop right?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The only thing you need to do is output the results to a file somewhere, and then retrieve it again when the program loads again.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-3317869562326046338?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/3317869562326046338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-much-experience-with-c-would-you.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3317869562326046338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/3317869562326046338'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-much-experience-with-c-would-you.html' title='How much experience with C++ would you need to save High Scores? Also, can you help me?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6365830891581979146</id><published>2009-07-12T22:41:00.000-07:00</published><updated>2009-07-12T22:41:36.249-07:00</updated><title type='text'>How to generate random numbers and store into array?</title><content type='html'>I'd like to use the random number generator and store it into an array of 10 in my C++ program. How do I do this? I'd like the numbers it gets to be between 0 and 1000. Thanks&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;How to generate random numbers and store into array?&lt;br&gt;First, declare your array, like &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int array[999];&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;And then, use the rand() function to create your random numbers. You'll need to include stdlib.h and time.h for the functions to work.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Use a for loop that goes through your array, adding each of the rand() numbers to the array.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;That's it!&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6365830891581979146?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6365830891581979146/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-to-generate-random-numbers-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6365830891581979146'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6365830891581979146'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/how-to-generate-random-numbers-and.html' title='How to generate random numbers and store into array?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-947347731948540334</id><published>2009-07-09T06:03:00.002-07:00</published><updated>2009-07-09T06:03:29.840-07:00</updated><title type='text'>I have a question about programming in ti basic b/c i have an assignment in math to make a game.?</title><content type='html'>I would like some help b/c i dont know how to get a randomly assigned number to get into the getkey code, meaning the different letters and numbers need to "fall" from the top of the ti 84 screen. i know how to make the random number to generate, using the randInt(x,y) function. but how do i get that number into the program to make the assigned letter or number "fall"?         thank you for your time in helping me&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;I have a question about programming in ti basic b/c i have an assignment in math to make a game.?&lt;br&gt;you can use the randInt(x,y) [and any other function you can type in the normal input screen] in your programs.&lt;br&gt;Reply:This sounds like a really old version of basic. I'd ask the teacher.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-947347731948540334?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/947347731948540334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/i-have-question-about-programming-in-ti.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/947347731948540334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/947347731948540334'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/i-have-question-about-programming-in-ti.html' title='I have a question about programming in ti basic b/c i have an assignment in math to make a game.?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-6465066955263673638</id><published>2009-07-09T06:03:00.001-07:00</published><updated>2009-07-09T06:03:17.414-07:00</updated><title type='text'>Grade 12 Data Management?</title><content type='html'>Numbers from 0 to 99 inclusively are formed by choosing the units digit and the tens digit ( which may be 0) at random from the numbers 0,1,2,.....,9. calculate the probabilty that:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a) the random number is even&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b) the random number is greater than 85&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c) the random number is less than 33&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d) the tens digit and the units digit are consecutive numbers; eg. 23&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Grade 12 Data Management?&lt;br&gt;You can easily enumerate the possibilities.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;They are 100 total possibilities, half of them are even&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;a = 50%&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;14 of the 100 are greater than 85&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;b = 14%&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;33 of the 100 are less than 33&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;c = 33%&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;01 12  23 34 45 56 67 78 89&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;they are 9 (unless you want the ones that go down as well)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;d  = 9%&lt;br&gt;Reply:A) 50% - 100 numbers, 50 of which are even, and 50 of which are odd...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;B) 10% * 40% + 10% = 14% {86, 87, 88, 89, and 90-99}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;C) 33% {0 to 32} is 33 numbers.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;D) {01, 12, 23, 34, 45, 56, 67, 78, 89} of 100 numbers = 9%&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://11orange.blogspot.com/&gt;orange&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-6465066955263673638?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/6465066955263673638/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/grade-12-data-management.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6465066955263673638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/6465066955263673638'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/grade-12-data-management.html' title='Grade 12 Data Management?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-7139891402457689640</id><published>2009-07-09T06:03:00.000-07:00</published><updated>2009-07-09T06:03:05.383-07:00</updated><title type='text'>A number is drawn at random from the numbers 1 through 20. The probability the number is a multiple of 3 is?</title><content type='html'>A.  1/3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;B.  1/5&lt;br&gt;&lt;br /&gt;&lt;br /&gt;C.  3/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;D.  7/20&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;A number is drawn at random from the numbers 1 through 20. The probability the number is a multiple of 3 is?&lt;br&gt;There are 6 multiples of 3 between 1 and 20, &lt;br&gt;&lt;br /&gt;&lt;br /&gt;so 6/20 is the probabiltiy, reduced equals 3/10 so&lt;br&gt;&lt;br /&gt;&lt;br /&gt;the answer is (c)&lt;br&gt;Reply:3,6,9,12,15,18&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;6/20 = 3/10&lt;br&gt;Reply:C- 3/10&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;because the multiples of 3 from 1-20 are&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3, 6, 9, 12, 15, and 18&lt;br&gt;&lt;br /&gt;&lt;br /&gt;those are 6 numbers&lt;br&gt;&lt;br /&gt;&lt;br /&gt;put it in a fraction form like this:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;6/20 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;and then reduce and you will get &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3/10 as your answer&lt;br&gt;Reply:C. 3/10, because there are 6 multiples of 3 in 20, multiply 20 by 5 (to get to a hundred) then do the same with how many multiples, and there you go!&lt;br&gt;Reply:the answer is c &lt;br&gt;&lt;br /&gt;&lt;br /&gt;multipuls are 3 6 9 12 15 18&lt;br&gt;&lt;br /&gt;&lt;br /&gt;fraction is 6/20&lt;br&gt;&lt;br /&gt;&lt;br /&gt;lowest terms 3/10&lt;br&gt;Reply:c&lt;br&gt;&lt;br /&gt;&lt;br /&gt;3,6,9,12,15,18,&lt;br&gt;&lt;br /&gt;&lt;br /&gt;it is 6/20 which reduces to 3/10&lt;br&gt;Reply:c: 3,6,9,12,15,18 = 6 numbers. 6/20 reduces to 3/10&lt;br&gt;Reply:multiples of 3 between 1 and 20 are:  3,6,9,12,15, 18&lt;br&gt;&lt;br /&gt;&lt;br /&gt;so you have 6 chances out of 20 to get a multiple of 3&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;6/20 reduces to 3/10&lt;br&gt;Reply:C. 3/10 There are 6 multiples of three and 20 chances so it would be 6:20 or simplified 3:10&lt;br&gt;Reply:c. 3/10&lt;br&gt;Reply:c&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-7139891402457689640?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/7139891402457689640/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/number-is-drawn-at-random-from-numbers.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7139891402457689640'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/7139891402457689640'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/number-is-drawn-at-random-from-numbers.html' title='A number is drawn at random from the numbers 1 through 20. The probability the number is a multiple of 3 is?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-2123357053909062183</id><published>2009-07-09T06:02:00.002-07:00</published><updated>2009-07-09T06:02:46.047-07:00</updated><title type='text'>C++ Help Again =( !?</title><content type='html'>I've tried everything I know and I don't know what to do now. I'm using a random number generator and I need helping getting the average of the numbers the generator makes plz help!&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iostream.h%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;fstream.h%26gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;math.h%26gt;   &lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iomanip.h%26gt; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main (void) &lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     int n;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     int repeat; &lt;br&gt;&lt;br /&gt;&lt;br /&gt;     int random_integer;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     float dem;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     ifstream infile;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     infile.open("C:\Numbers.DAT", ios::in);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     if (infile)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;     {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                infile %26gt;%26gt; repeat;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                infile.ignore(80, '\n');&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                for(int x = 1; x %26lt;= repeat; x++)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                {&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        infile %26gt;%26gt; random_integer;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        infile.ignore(80, '\n');&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        cout %26lt;%26lt; random_integer %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;                        dem = random_integer%2;&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++ Help Again =( !?&lt;br&gt;///Hope the following helps&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;///average of n no.s= (sum of n.nos) / n&lt;br&gt;&lt;br /&gt;&lt;br /&gt;///Add a new variable&lt;br&gt;&lt;br /&gt;&lt;br /&gt;float sum=0.0f;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;for(int x = 1; x %26lt;= repeat; x++)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;infile %26gt;%26gt; random_integer;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;infile.ignore(80, '\n');&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; random_integer %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;sum += random_integer;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;///find the average&lt;br&gt;&lt;br /&gt;&lt;br /&gt;dem = sum / repeat;&lt;br&gt;Reply:try typing = average then type the numbers.&lt;br&gt;Reply:Do you know how to use a debugger?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I suggest you learn how. Then, you can step through code, set breakpoints and check the values of the items in question.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;At least that would point to a more specific problem.&lt;br&gt;Reply:You could declare an array enter the random numbers into the array. Total the values and divide by array length -1. The code you display is incomplete to offer a better answer entire code file should be shown. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;To generate  "random" number:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;random_integer = rand() % 100;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Generates a psuedo random number between 0 %26amp; 99&lt;br&gt;Reply:One really easy way is to stick all the numbers in a vector, use accumulate on the vector, and divide by the vector length to get your average (avg = sum/num of elements, right).&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;You haven't even posted anything near compiling code, so I'm not going to waste my time pointing out problems in your code. I'll just give you a generic method, and you can go ahead and try to fix things.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;algorithm%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;vector%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    vector%26lt;int%26gt; elements;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    /*&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    Some code and function calls that populate elements&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    */&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    float avg = accumulate(elements.begin(), elements.end(), 0.f)/vector.size();&lt;br&gt;&lt;br /&gt;&lt;br /&gt;    return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-2123357053909062183?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/2123357053909062183/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-help-again.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2123357053909062183'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/2123357053909062183'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-help-again.html' title='C++ Help Again =( !?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-5924540088478244031</id><published>2009-07-09T06:02:00.001-07:00</published><updated>2009-07-09T06:02:30.611-07:00</updated><title type='text'>C++ COmputer programming help?</title><content type='html'>We have to write a guess the numver game program in visual c++. This is what it reads your program chosesthe number to be guessed by selecting an integer at random in the range 1 to 1000. The Programthen displays the following&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;I have a number between 1 and 1000 &lt;br&gt;&lt;br /&gt;&lt;br /&gt;can you guess my number?&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Please type your first guess.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;The player then typesa first guess. With one of the following.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;excellent&lt;br&gt;&lt;br /&gt;&lt;br /&gt;too low try again&lt;br&gt;&lt;br /&gt;&lt;br /&gt;too high try again&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;It then wants you to modify the program to count the number of guesses the player makes. If the number is 10 or fewer print "either you know the secret or you got lucky. " If player guesss the number in ten tries then print " you should do better" &lt;br&gt;&lt;br /&gt;&lt;br /&gt;THis is what I have.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#pragma once&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;class GuessNumber&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;public:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;GuessNumber(void);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;~GuessNumber(void);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;};&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;iostream%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;cstdlib%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include %26lt;ctime%26gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;#include "GuessNumber.h"&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;using namespace std;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int main()&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;srand(time(0)); // seed random number generator&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int theNumber = rand() % 100 + 1; //random number between 1 and 100&lt;br&gt;&lt;br /&gt;&lt;br /&gt;int tries = 0, guess;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "\tWelcome to Guess My Number\n\n";&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;//Guessing Loop&lt;br&gt;&lt;br /&gt;&lt;br /&gt;do&lt;br&gt;&lt;br /&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "Enter a guess:";&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cin %26gt;%26gt; guess;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;++tries;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if (guess %26gt; theNumber)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "Too high!\n\n";&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if (guess %26lt; theNumber)&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "Too low!\n\n";&lt;br&gt;&lt;br /&gt;&lt;br /&gt;} while (guess != theNumber);&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "\nThat's it! You got it in" %26lt;%26lt; tries %26lt;%26lt; "guesses!\n";&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;return 0;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;}&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a1.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;C++ COmputer programming help?&lt;br&gt;Add the following lines before "return 0" statement:&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=================================&lt;br&gt;&lt;br /&gt;&lt;br /&gt;if( tries %26lt; 10 )&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "Either you know the secret or you got lucky" %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;else&lt;br&gt;&lt;br /&gt;&lt;br /&gt;cout %26lt;%26lt; "You should do better" %26lt;%26lt; endl;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;=================================&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;Sounds silly that you ask this much if you have written the rest of it. Are you sure that YOU wrote the program you quoted? Whataver, please do not forget to give me 10 points :-)&lt;br&gt;Reply:You aren't using the GuessNumber class at all, so its not necessary. It looks ok, you just need to add the feedback about the number of tries being less than 10 or greater than 10.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-5924540088478244031?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/5924540088478244031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-computer-programming-help.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5924540088478244031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/5924540088478244031'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/c-computer-programming-help.html' title='C++ COmputer programming help?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3903213161018335472.post-9216131851000083266</id><published>2009-07-09T06:02:00.000-07:00</published><updated>2009-07-09T06:02:13.583-07:00</updated><title type='text'>Understanding Boltzmann's formula?</title><content type='html'>Boltzmann's formula is usually written as S = k ln W.  Match each symbol in this equation with its meaning...&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;S=&lt;br&gt;&lt;br /&gt;&lt;br /&gt;k=&lt;br&gt;&lt;br /&gt;&lt;br /&gt;W=&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br /&gt;A. A fraction indicating the probability of obtaining a result.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;B. A random number.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;C. The number of ways the state may be obtained.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;D. The universal gas constant divided by Avogadro's number.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;E. The number of moles.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;F. A correction factor for states being indistinguishable.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;G. The absolute entropy.  &lt;br&gt;&lt;br /&gt;&lt;br /&gt;H. The work/mole&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a2.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;Understanding Boltzmann's formula?&lt;br&gt;S=G. The absolute entropy. &lt;br&gt;&lt;br /&gt;&lt;br /&gt;k= D. The universal gas constant divided by Avogadro's number.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;W=C. The number of ways the state may be obtained.&lt;br&gt;&lt;script language=JavaScript src=http://www.chinese-kungfu.org/a3.js type=text/javascript&gt;&lt;/script&gt;&lt;br&gt;&lt;a href=http://2flash-cards.blogspot.com/&gt;flash cards&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3903213161018335472-9216131851000083266?l=c-random-number.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://c-random-number.blogspot.com/feeds/9216131851000083266/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://c-random-number.blogspot.com/2009/07/understanding-boltzmanns-formula.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/9216131851000083266'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3903213161018335472/posts/default/9216131851000083266'/><link rel='alternate' type='text/html' href='http://c-random-number.blogspot.com/2009/07/understanding-boltzmanns-formula.html' title='Understanding Boltzmann&apos;s formula?'/><author><name>fqewuj</name><uri>http://www.blogger.com/profile/02852214685992531194</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
