Tuesday, July 14, 2009

Statistics Homework?

This question has to do with central limit theorem.





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.





a. X=


b. Xbar ~ "blank" X~ "blank"





c. draw and label both distributions from b.


(you don't really have to answer this if there is no way to draw it online)





d. the probability that the sample mean is no more than 2.5





e. find the probability that any given random number is no more than 2.5





f. find the 45th percentile for the average random number generated.





can you please show some work. THANK YOU.

Statistics Homework?
Let X1, X2, ... , Xn be a simple random sample from a population with mean μ and variance σ².





Let Xbar be the sample mean = 1/n * ∑Xi


Let Sn be the sum of sample observations: Sn = ∑Xi





then, if n is sufficiently large:





Xbar has the normal distribution with mean μ and variance σ² / n


Xbar ~ Normal(μ , σ² / n)





Sn has the normal distribution with mean nμ and variance nσ²


Sn ~ Normal(nμ , nσ²)





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.





if the sample comes from a uniform distribution the sufficient sample size is as small as 12


if the sample comes from an exponential distribution the sufficient sample size could be several hundred to several thousand.





if the data comes from a normal distribution to start with then any sample size is sufficient.


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.





if we now the population standard deviation then we can use the z statistic from the beginning.


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.














P(X = 1) = 0.20


P(X = 2) = 0.20


P(X = 3) = 0.20


P(X = 4) = 0.20


P(X = 5) = 0.20





E(X) = 3


Var(X) = 2








Xbar ~ Normal(μ = 3 , σ² / n = 2/75)








e) P(X %26lt; 2.5 ) = P(X = 1) + P(X = 2) = 0.40








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.)





You can translate into standard normal units by:


Z = ( X - μ ) / σ





Moving from the standard normal back to the original distribuiton using:


X = μ + Z * σ





Where Z ~ Normal( μ = 0, σ = 1). You can then use the standard normal cdf tables to get probabilities.





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.





If a sample of size is is drawn from a population with mean μ and standard deviation σ then the sample average xBar is normally distributed





with mean μ and standard deviation σ /√(n)





An applet for finding the values


http://www-stat.stanford.edu/~naras/jsm/...





calculator


http://stattrek.com/Tables/normal.aspx





how to read the tables


http://rlbroderson.tripod.com/statistics...





We know from the standard normal that


P(Z %26lt; z) = 0.45


= P(Z %26gt; z) = 0.55


when z = -0.1256613





x = μ + z * σ


x = 3 + -0.1256613 * 0.1632993


x = 2.979480





P(X %26lt; 2.979480 ) = 0.45


P(X %26gt; 2.979480 ) = 0.55


Why rand() doesn't work in visual studio??

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!!!


That means that it doesn't even exist.... What is the problem??





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!!!





Thanks in advance......... :):):):)

Why rand() doesn't work in visual studio??
You need to #include %26lt;math.h%26gt; for rand().





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.

apricot

How do I get rid of the newline character in C++ using ignore?

I have this class structure, I'm trying to read in strings.


for (int count = 0; count %26lt; num; count++) {


cfile %26gt;%26gt; library[count].name.last;


cfile %26gt;%26gt; library[count].name.first;


getline(cfile, library[count].book.title);


cfile %26gt;%26gt; library[count].book.pages;


getline(cfile, library[count].book.genre);


getline(cfile, library[count].book.other.publisher);


cfile %26gt;%26gt; library[count].book.other.year;


}


And I asked this guy and he said:


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.





How do I get rid of the newline character, something to do with cin.ignore????

How do I get rid of the newline character in C++ using ignore?
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.





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





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').





Please read the entire article. It is technically accurate as well.





In the future, use Google to find out answers. There's good resources at "C++ FAQ", cplusplus.com , cppreference.com.
Reply:cin.ignore('\n');


Can you help me with this homework?

OK, OK, I'll start with a few 'dead-easy' ones just to 'prepare' you for the killers later.





The Dice Roll:


"oooh... that's just impossible" rating: 0.8/10





If you throw a dice 6 times, what's the chance that you'd get a six on:


a: exactly one of the throws.


b: one or more of the throws.


[Back to top]











The Square Cross-over:


"oooh... that's just impossible" rating: 2.5/10





3 points are chosen at random along the square's outline. They then combine to form a triangle.


a: What is the probability that the centre of the square will be 'engulfed' by this triangle?


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!...


"oooh... that's just impossible" sub-rating: 6.5/10


(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")


(still 3) What is the probability that the centre of the dodecahedron will be engulfed by this tetrahedron?


(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]








The Infinity Thing:


"oooh... that's just impossible" rating: 4/10





First off, here's a slightly simpler question (difficulty sub-rating: 1.4/10) to ease you in ;-)


a: You throw a coin multiple times. What's the average amount of throws required to obtain 2 heads in a row?


and the main question (b)...


Starting at number zero, you throw a coin.


Tails means you go down one (therefore equalling -1)


Heads means you go up one (therefore equalling 1)





You repeat this procedure infinite times, so here's an example variation:


0, 1, 2, 3, 2, 3, 4, 3, 2, 3, 4, 3, 4, 5, 6, 7, 6, 7.........





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.


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/.





Now the killer /when even a computer/ won't be much help (impossibility sub-rating 5/10)





What's the average amount of times you'd have to throw the coin before zero was hit upon again?


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]








The Enveloping Lines:


"oooh... that's just impossible" rating: 3/10


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.





a: ('easy' ^-^ difficulty rating: 2.5) What is the average length of any one of the lines?


b: ('moderate' ~.~ difficulty rating: 4.0)


(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).


(2)What is the chance of a point at the centre of the square being 'engulfed' by this "polygon"? [Back to top]








The Ant Walk:


"oooh... that's just impossible" rating: 4/10





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


(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).


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.


What is the average amount of walks required for the ant to escape the circle?


[Back to top]








Enveloping Lines: The Revenge


"oooh... that's just impossible" rating: 4.5/10





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.





Now take a look at the example purple square below.


10 points are randomly chosen within the square - and are connected to form 9 lines.


Can you guess what I'm going to ask next? %26gt;;)





Yup:





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?





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) ?


* = 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]





The Zig-zagger:


"oooh... that's just impossible" rating: 5/10


.....A bit like the earlier coin question, but with the addition of some geometry.





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.


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?


See left for a brown diagram showing the various lucky possibilities that hit the target.





That too easy for you? ok....





Now the killer (as if that previous one wasn't hard enough) (impossibility sub-rating 6.5/10):





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?


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).





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]





Next horribly, horribly complicated question








The Cricket Pitch:


"oooh... that's just impossible" rating: 6/10





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:





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.


b: the catchers always catch the ball if they can reach it.


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'.


d: The ball travels at a speed of 10 metres per second.


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):


Row a: 1 mps


Row b: 1.5 mps


Row c: 2 mps


Row d: 2.5 mps


Row e: 3 mps





And the killer question (impossibility rating 7/10):





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]





The Mega-sphere


"oooh... that's just impossible" rating: 6/10





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 ;-)


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:


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?








b: A sphere 5.5 centimetres in diameter is filled with 1cm diameter hemi-spheres.


What is the theoretical maximum amount of spheres that can be crammed into the mega-sphere?





Now the real question (difficulty rating 6/10):


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?


I hear that Mr know-it-all will spare you the crammed Augmented Tridiminished Icosahedrons for another time. [Back to top]




















Oh...


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]"





The Curvy Rebound:


An easier version of an angle prob to prepare you for what's to come.





"oooh... that's just impossible" rating: 7/10





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.





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.


(difficulty sub-rating: 5/10) What's the chance the 'ball' will contact the yellow circle?





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.


At which point Mr Know-it-all concedes:


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]








----------------The Starry Rebound:


"oooh... that's just impossible" rating: 7.5/10


They get harder....





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.


On average, how many sides will have been hit once the ball has travelled 1000m ?





And the killer question: (impossibility sub-rating 8/10)


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.





Now how many sides on average will have been hit once the ball has travelled 1000m ?


Also, where are the most likely points that the ball will end up?





Extra added 'Argghhh' factor.


(impossibility sub-rating 8.5/10)


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:


0 revolutions per 10 metres of ball travel: (when the ball has travelled 0 - 10 metres)


0.5 revolutions per 10 metres of ball travel: (when the ball has travelled 10 - 20 metres)


1.0 revolutions per 10 metres of ball travel: (when the ball has travelled 20 - 30 metres)


1.5 revolutions per 10 metres of ball travel: (when the ball has travelled 30 - 40 metres)


etc. etc.





Now how many sides on average will have been hit once the ball has travelled 1000m ?


[Back to top]








Mega-sphere: The Revenge


"oooh... that's just impossible" rating: 9/10


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.





A sphere 5.5 metres in diameter is filled with 1m diameter hemi-spheres.





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:


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.





(2) By cramming them as efficiently as possible, a relatively small volume will be left. How large is this volume?





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?





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]

















The nightmare of nightmare questions :


The Snooker Table of Doom


"oooh... that's just impossible" rating: 9.5/10





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:


2m,1m...(white ball)


...and red balls...


1m,5m... 2m,5m... 3m,5m


1m,6m... 2m,6m... 3m,6m


1m,7m... 2m,7m... 3m,7m





The white ball is then shot at a particular angle from 0 to 360 degrees (0 being north, and going clockwise).


Just to make it clear, a ball is 'potted' if at least half of the ball is in area of the 'pocket'





Assuming the balls travel indefinitely (i.e. no loss of energy via friction, air resistance or collisions), answer the following:





a: What exact angle/s should you choose to ensure that all the balls are potted the quickest?


b: What is the minimum amount of contacts the balls can make with each other before they are all knocked in?


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).


d: What proportion of angles will leave the white ball the last on the table to be potted

Can you help me with this homework?
How long did it take you to type this up?!?!?!?!?!
Reply:This is way too long. delete this question and enter them in individually.
Reply:615
Reply:i dont think this are serious questions.


If i have to answer stuff like that when i get older


i am dropping out of school now
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
Reply:how come you could write that much?? ppl only get to write 1000 characters, and yours looks like a lot more
Reply:what grade r u in???


I have a Page in ASP.NET During Debug IT WORKS FINE, Accessing it online variables arnt working PLEASE HELP?!?

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


Ex FileName54233142.txt





EVERYTHING, i mean EVERYTHING works perfectly fine when debugging it in MS Visual Studio 2008, works great





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.





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





why is the integer not being populated when i access it through the net??





The integer is populated by a method i created that returns an integer that it finds in a SQL Database





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

I have a Page in ASP.NET During Debug IT WORKS FINE, Accessing it online variables arnt working PLEASE HELP?!?
after uploading to the webserver, did you change the path of the file location? eg. server.mappath


Statistics. Please check.?

(F3)


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):





a) Number all the units in the area and use a random number table to select the apartments to include in the sample.





Systematic Sampling





b) Classify the apartment units according to the number of bedrooms and then take a random sample from each of the classes.





Stratified Sampling





c) Classify the apartments according to zip code and take a random sample from each of the zip code regions.





Cluster Sampling





d) Look in the newspaper and choose the first apartments you find that list rents.





Convenience Sampling

Statistics. Please check.?
well done. you're answers are correct.

song words

Statistics. Are these correct?

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):





a) Number all the units in the area and use a random number table to select the apartments to include in the sample.





Systematic Sampling





b) Classify the apartment units according to the number of bedrooms and then take a random sample from each of the classes.





Stratified Sampling





c) Classify the apartments according to zip code and take a random sample from each of the zip code regions.





Cluster Sampling





d) Look in the newspaper and choose the first apartments you find that list rents.





Convenience Sampling

Statistics. Are these correct?
yes ur right


all correct