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


From the numbers 3 to 12 inclusive two numbers are chosen at random.?

a) What is the cardinality of the sample space?


b) List the event in which number is a factor of the other number and find its cardinality.


c) List the event in which the sum of the numbers is 15.


d)List the event in which the sum of the numbers is 15 and one number is a factor of the other number.

From the numbers 3 to 12 inclusive two numbers are chosen at random.?
A)What is the cardinality of the sample space?


The sample space O={3,4,5,6,7,8,9,10,11,12} and its C is 10 as it has 10 items


B)These are the pairs:


(3,6),(3,9),(3,12),(4,8),(4,12),(5,10)...


So A={(3,6),(3,9),(3,12),(4,8),(4,12),(5,10... and its C is 7


C)These are the pairs:


(3,12),(4,11),(5,10),(6,9),(7,8)


So B={(3,12),(4,11),(5,10),(6,9),(7,8)} and its C is 5


D)C=A AND B={(3,12),(5,10)} and its C is 2





Notes:


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


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





Note that none, either or both of those notes can be defined.


I need help with samples?

i havent figures these out, i need some help





identify each of the following methods as a simple random sample, stratified random sample, cluster sample, or convenience sample?





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





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.

I need help with samples?
This is confussing. Type Sampling(statistics) in your search bar and you may be able to figure it out. Good Luck.


Problem with Microsoft Windows XP SP2?

Hey !!


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.

Problem with Microsoft Windows XP SP2?
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.


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


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


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.


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


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.





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.





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.





Pray that your backups were good.





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





Good luck
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
Reply:sounds like your file allocation tables and stuff are shot away.





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





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.
Reply:which drive has your OS..?


well try degfragmenting and also...





download uniblue regisry repair
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.....

song titles

Help please?

all i need to do is get started its in the C++ language





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

Help please?
Random Numbers





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.





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





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.





The simplest set of functions is:





int rand(void);


void srand(unsigned int seed);





rand() returns successive pseudo-random numbers in the range from 0 to (2^15)-1.


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:





srand( (unsigned int) time( NULL ));





The following program card.c illustrates the use of these functions to simulate a pack of cards being shuffled:





/*


** Use random numbers to shuffle the "cards" in the deck. The second


** argument indicates the number of cards. The first time this


** function is called, srand is called to initialize the random


** number generator.


*/


#include %26lt;stdlib.h%26gt;


#include %26lt;time.h%26gt;


#define TRUE 1


#define FALSE 0





void shuffle( int *deck, int n_cards )


{


int i;


static int first_time = TRUE;





/*


** Seed the random number generator with the current time


** of day if we haven't done so yet.


*/


if( first_time ){


first_time = FALSE;


srand( (unsigned int)time( NULL ) );


}





/*


** "Shuffle" by interchanging random pairs of cards.


*/


for( i = n_cards - 1; i %26gt; 0; i -= 1 ){


int where;


int temp;





where = rand() % i;


temp = deck[ where ];


deck[ where ] = deck[ i ];


deck[ i ] = temp;


}


}


My random quiz!!!?

1. what would u say if i said i'm a girl and i want a mustache?





a) HURRA!!


b) WTF?!!?


c) that's nice


d) OMG!!! ME 2!!! LET"S BE BUDDIES!!!!!!





2. how do u feel RIGHT THIS SECOND!!!!??





a) bored


b) happy


c) *my feet r numb


d) AHA!!!


e) i feel.... how i feel





3. HELLO!!!! how's it going?





a)ok


b) HI im ok... today was..... i like this animal... so on... so so on....


c) hey... im ok...


d) LEAVE ME ALONE!!!





4. i like ducks





a) WELL i DONT!!!


b) ok


c) i want to be ur friend!!


d) LEAVE!!! AAAAAAAAAAAAHHHHHH!!!!!!!!





5. Here i will write a story and you have to continue...





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





now it's ur turn...





a) HAHAH


b) we shall be the best of friends!!!


c) ooooookkkk... u have problems...


d) bye!

My random quiz!!!?
1. d)





2.d)





3. b)





4. c)





5. b)





P.S. the girl is your story is like my one and only idol!!! (apart from Dr. Phil!!! DUHHH)
Reply:1. what would u say if i said i'm a girl and i want a mustache?





c. That's nice? lol





2. how do u feel RIGHT THIS SECOND!!!!??





a. bored!





3. HELLO!!!! how's it going?





b. HI im ok... today was..... i like this animal... so on... so so on....





4. i like ducks





b. ok?





5. Here i will write a story and you have to continue...





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





c. ooooook... u have problems...
Reply:D- i dont relly, but i would say that


e


d


b


c
Reply:c


a


a


b


and she stopped going on Yahoo Answers for the rest of her life.


d
Reply:Hahahaha how random and funny!
Reply:1.d) OMG! me 2! elt's be buddies!


2.e) i feel...how i feel


3.b)Hi i'm ok....today was...i like this animal....so on...so on..


4.b) ok


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.


and then the girl said she wanted a toupee.....


lol
Reply:You have way too much time on your hands.
Reply:c, on the last question, oooooooooooooookkkk... u have problems... and d, bye!! YOUR FUNNY THOUGH, LOVE THE STORY!!! lol
Reply:b


a


c


b


c
Reply:I have no time time to waste over it.
Reply:1.WTF??


2.bored


3.leave me alone


4.ok, just get the heck away from me


5.you seriously do have problems
Reply:1.c


2.e


3.d


4.a


5.a
Reply:1. b


2. c


3. c


4. c


5. a
Reply:Well, ok then...
Reply:. what would u say if i said i'm a girl and i want a mustache?





c) that's nice





2. how do u feel RIGHT THIS SECOND!!!!??





a) bored





3. HELLO!!!! how's it going?





a)ok





4. i like ducks


b) ok








5. Here i will write a story and you have to continue...





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.





now it's ur turn...








b) we shall be the best of friends!!!


W4002-Set up a 95% confidence interval estimate of the population average number of shares traded for......?

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.





Company Shares


AllenTel 408700


Banctec 29500


CDI 32500


CTS 36700


Dover 169100


Fluor 332000


Grace 237700


Hartmx 49700


KCS 110300


LizClab 219400


NuvPP 50700


Presly 133500


StJude 163500


Scripps 27900


SunEng 63400


Thai 67200


Tyson 161800


YorkIn 120000





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





(b) What sample size is needed if you want to be 95% confident of being correct to within :t:20,000 shares?





(c) If you were to perform this study today, do you think that your answer to (b) is valid? Explain.





THANKS!

W4002-Set up a 95% confidence interval estimate of the population average number of shares traded for......?
I computed mean m=134088.89 and


standard deviation s=105878.03.


I know that the statististic


T=sqrt(n) * (X-134088.89)/105878.03


has a Student t-distribtuion with 18-1=17 degrees of freedom.


The table of the Student-t distribution gives the solution c


of the equation. P(T%26gt;=c )-P(T%26lt;=-c) = 0.95, c =2.11


So -2.11 %26lt;sqrt(n) * (X-134088.89)/105878.03%26lt;2.11


gives the interval.


I leave the rest to you!


This is a joint PDF question. (c) Draw up a table showing the joint probability function Px,y(x,y) of X and Y.

a random variable Y has probability function P(Y=2)= 0.6, P(Y=3)=0.2 and P(Y=4)=0.2.


once Y has been observed, Y fair coins are tossed; let X denote the number of heads which are observed.





(a) Write downt the conditional expectation of X given Y= y, for each y=2,3,4.


hence express E[X l Y] as a function of Y.


(b) Find E(Y) and use this to calculate E(X).


(c) Draw up a table showing the joint probability function Px,y(x,y) of X and Y.


(d) find the marginal probability function of X and verify that the expectation of this distribution agrees with the value calculated in (b)

This is a joint PDF question. (c) Draw up a table showing the joint probability function Px,y(x,y) of X and Y.
.. X ....... 0 ................. 1 ................ 2 ................ 3 ............... 4


Y=2 . (.25)(.6) ...... (.5)(.6) ........ (.25)(.6) ............ 0 .............. 0


3 .... (.125)(.2) .... (.375)(.2) ...... (.375)(.2) ..... (.125)(.2) ...... 0


4 ... (.0625)(.2) ..... (.25)(.2) ... (.375)(.2) . (.25)(.2) . (.0625)(.2)








If y = 2, 0 head: 1/4 , 1 head: 2/4, 2 heads: 1/4 (then multiply 0.6)





If y = 3, 0 H: 1/8 , 1H: 3/8 , 2H: 3/8 , 3H: 1/8





If y = 4: 0H: 1/16, 1H: 4/16 , 2H: 6/16 3H: 4/16 4H: 1/16





Also, E[Y] = 2*.6 + 3*.2 + 4*.2 = 2.6


I had now given you the table. Multiply to get the values and use that to determine the rest of the answers. ©
Reply:a)





E[X|Y=2] = 0.5*2 = 1


E[X|Y=3] = 0.5*3 = 1.5


E[X|Y=4] = 0.5*4 = 2


E[X|Y=y] = 0.5*y





b)





E[Y] = 2*0.6 + 3*0.2 + 4*0.2 = 2.6





E[X] = E[ E[ X|Y ] ] = Sum over all y of E[X|Y=y]P[Y=y]


= 1 * 0.6 + 1.5 * 0.2 + 2 * 0.2 = 1.3





c)


These are all found using the binomial distribution and mulitplied by P[Y=y]





Y = y | 2_________3___________4_______total P[X= x]





X = 0 | 0.25*0.6____0.125*0.2____0.0625*0.2


X = 1 | 0.5*0.6_____0.375*0.2____0.25*0.2


X = 2 | 0.25*0.6____0.375*0.2_____0.375*0.2


X = 3 | 0_________0.125*0.2_____0.25*0.2


X = 4 | 0_________0___________0.0625*0.2





total P[Y=y]





to finish the table sum the columns to get P[Y=y] and sum the rows for P[X=x]

song downloads

A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use comput...?

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.





Which of the following will provide a more informative (i.e., narrower) confidence interval than the one in problem 3?





(a) Using a sample of size 400 (instead of 81).





(b) Using a sample of size 36 (instead of 81).





(c) Using a different sample of size 81.





(d) Using a 90% level of confidence (instead of 95%).





(e) Using a 99% level of confidence (instead of 95%).





(f) Both (a) and (d) are correct.





(g) Both (a) and (e) are correct.

A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use comput...?
wow...lucky if someone bothers to answer this.


A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a

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.





Question 2:


Point value: 10








Which of the following will provide a more informative (i.e., narrower) confidence interval than the one in problem 3?








(a) Using a sample of size 400 (instead of 81).





(b) Using a sample of size 36 (instead of 81).





(c) Using a different sample of size 81.





(d) Using a 90% level of confidence (instead of 95%).





(e) Using a 99% level of confidence (instead of 95%).





(f) Both (a) and (d) are correct.





(g) Both (a) and (e) are correct.

A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a
F.





Smaller levels of confidence means smaller margins of error.


And more people surveyed reduces varience.


At a large department store, the average number of years of service was 13.5 with a standard deviation of 6.2?

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?











a. 0.0318





b. 0.0852





c. 0.1875





d. 0.2862





e. 0.4679





f. 0.6566





g. none of these

At a large department store, the average number of years of service was 13.5 with a standard deviation of 6.2?
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.
Reply:z = (X - μ) / σ





z = (14 - 13.5) / 6.2 ≈ 0.0806


P(z %26gt; 0.0806) ≈ 0.4679





The answer is e.


A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a

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.





We are 95% confident that the mean number of weekly hours that U.S. adults use computers at home is:








(a) between 8.1 and 8.9.





(b) between 7.8 and 9.2.





(c) between 7.7 and 9.3.





(d) between 7.5 and 9.5.





(e) between 7.3 and 9.7.

A study was conducted in order to estimate μ, the mean number of weekly hours that U.S. adults use computers a
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.





The range is thus the sample mean +/- 2(σ/sqrt(n))





8.5 +/- 2 * 3.6 / sqrt(81)


8.5 +/- (7.2 / 9)


8.5 +/- 0.8





(c) between 7.7 and 9.3

sending flowers

Well...GCSE's start in a week - lots of Random Questions...?

Couple of general questions on a number of subjects...any answers be great...?





Idea's in Context for the Sciences - any good ways to prepare for them?





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





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





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?





Yes I know, all very random...but anyone can answer any of these may be able to put my mind at ease =)





Best of Luck to all those doing there exams soon =]

Well...GCSE's start in a week - lots of Random Questions...?
Spanish - just try your hardest but to be honest if its worst case C then it should be pretty easy for you





Science - same as before should be pretty easy although don't relax still keep working hard and you should fly through it





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





Good luck!


The table below shows the number of tests taken by 30 randomly selected college sophomores?

Number of tests taken/ Number of students





0/12


1/8


2/2


3/3


4 or more/5


______________________________________...





If a student is selected at random, find the probability


a)the student has taken exactly two tests


b)the student has taken at least two tests


c)the student has taken at most three tests


d)the student has taken 3 or fewer tests


e)the student has taken one or two tests.

The table below shows the number of tests taken by 30 randomly selected college sophomores?
so we know our sample isze is 30 making n=30.





Lets start with a.





2 students took 2 tests so P = 2/n = 2/30 = 1/15





b) At least 2 tests means you could have take 2 or 3 or 4 or more. Thus,





P = (2+3+5)/n = (10)/30 = 1/3





c) At most three tests means 0, 1, 2, or 3., thus:





P= (12+8+2+3)/n = 25/30 = 5/6





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.





3) One or two tests is when using th elogic above.





P = (8+2)/30 = 1/3
Reply:a) 6.67% 2/30 students


b)33.33% 10/30 students


c)83.33% 25/30 students


d)83.33% 25/30 students


e)33.33% 10/30 students
Reply:a) 2 people have taken 2 tests = 2/30


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





c) 5 have taken 4 or more 30-5 = 25 = number who have taken at most 3 p =25/30





d) same as c.





e) 8 have 1 and 2 have 2 = 10/30


What is the mean of Z, the expected total number of individuals (males and females) who are colorblind?

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





Colorblindness is gender-based with the majority of sufferers being males.





Roughly 8% of white males have some form of colorblindness, while the incidence among white females is only 1%.





A random sample of 20 white males and 40 white females was chosen.





Let X be the number of males (out of the 20) who are colorblind.





Let Y be the number of females (out of the 40) who are colorblind.





Let Z be the total number of colorblind individuals in the sample (males and females together).





Answers:


(a) .4


(b) 1.6


(c) 2


(d) 2.7


(e) The mean of Z cannot be determined.





Hint: Express Z in terms of X and Y and then apply rules for means.

What is the mean of Z, the expected total number of individuals (males and females) who are colorblind?
The answer is (c)





Let X be a random variable with mean μx and variance σx². Let a, and b be constants.





Let W = aX + b





The mean of W, E(W) = μw is:





E(W) = E(aX + b)


= E(aX) + b


= aE(X) + b











in this case we have Z = X + Y





E(X) = 20 * 0.08 = 1.6


E(Y) = 0.4





E(Z) = 1.6 + 0.4 = 2.0
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





Z = 0.08X + 0.01Y


Z = 0.08(20) + 0.01(40)


Z = 2





I would have to say c is the answer.





Hope that helps!!!!!!
Reply:The expectation should just be the weight(probability) multiply by the amount of people.





Mean of X is : (.08*20)





Mean of Y is : (.01*40)





Mean of Z is the addition of the mean of Y and the mean of X





μ_z = μ_x + μ_y





μ_z = (.08*20) + (.01*40) = 2


Women how would you feel if a random guy came up to u and asked?

a bunch of random questions?


so a guy comes up 2 u, a guy u dont no and says Hi, I wanna ask u something.





Guy-So do u watch Jay Leno?


You-Does't matter what answer u give





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





you are currently single


or


you are currently seeing someone


and you work at etc and you been workin there for x amount





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








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.





would u answer TRUTHFULLY to all the questions esp the so since yur single? u wouldnt just say yur seein some 1 to

Women how would you feel if a random guy came up to u and asked?
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.

send flowers

Another C++ input question; cin and strings.?

K so if someone has a compiler on them they may be able to tell me or if you know anyway;





Suppose I declare an array of 5 strings.





vector%26lt;string%26gt; word(5);





The I use cin to input values saying;





cin%26gt;%26gt;word(0)%26gt;%26gt;word(1)%26gt;%26gt;word(2)%26gt;%26gt;word(3...





When the program runs and I am prompted for input I write.





" apples bear lemon party "





With all these spaces in there, will C pick out the words and store them in their respective string variables?





Are the vals:





word(0) is "apples"


word(1) is "bear"


word(2) is "lemon"


word(3) is "party"





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


Can I use a simple if statement to check for such blanks?





if(word.at(4) == ' ') %26lt; does this actually tell me if it's blank?

Another C++ input question; cin and strings.?
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.





Also be careful with strings and characters:


" - for strings


' - for characters


Find the standard deviation of the random variable.?

Find the standard deviation of the random variable.


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.


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.








a. 1.109





b. 0.992





c. 0.984





d. 1.053





e. 1.173

Find the standard deviation of the random variable.?
Let X be the number of children. The possible values for X and the corresponding probabilities are





x...............P(X = x)





1 (B)............1/2


2 (GB).........1/4


3 (GGB)......1/8


4 (GGGB).. 2/16 = 1/8


or (GGGG)





The SD(X) is the square root of the variance of X (Var(X)). The variance is equal to





Var(X) = E(X^2) - (E(X))^2





So we need E(X) and E(X^2)





E(X) = 1*(1/2) + 2*(1/4) + 3*(1/8) + 4*(1/8) = 15/8





E(X^2) = 1*(1/2) + 4*(1/4) + 9*(1/8) + 16*(1/8) = 37/8





Var(X) = 37/8 - (15/8)^2 = 71/64





SD(X) = sqrt(71/64) = 1.053. So, answer (D)!





Math (and Stats) Rule!
Reply:Let X be the number of children. The possible values for X and the corresponding probabilities are





x...............P(X = x)





1 (B)............1/2


2 (GB).........1/4


3 (GGB)......1/8


4 (GGGB).. 2/16 = 1/8


or (GGGG)





The SD(X) is the square root of the variance of X (Var(X)). The variance is equal to





Var(X) = E(X^2) - (E(X))^2





So we need E(X) and E(X^2)





E(X) = 1*(1/2) + 2*(1/4) + 3*(1/8) + 4*(1/8) = 15/8





E(X^2) = 1*(1/2) + 4*(1/4) + 9*(1/8) + 16*(1/8) = 37/8





Var(X) = 37/8 - (15/8)^2 = 71/64





SD(X) = sqrt(71/64) = 1.053. So, answer (D)!


C++ Assistance, Involving reading file, calculating average, sum (running total), amount of numbers?

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





The question goes like this:





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:


A) The number of numbers in the file


B) The sum of all the numbers in the file ( a running total)


C) The average of all the numbers in the file





The program should display the numbers of numbers found in the file, the sum of the numbers, and the average of the numbers.





I really appreciated the help, I wish they had more examples in the book for this stuff. Thanks for taking the time.

C++ Assistance, Involving reading file, calculating average, sum (running total), amount of numbers?
Here you go:





// For this program to work, you have to place the random.txt


// file in the same folder where your program is. Otherwise,


// change the location of the file below





// I am also assuming that you can use arrays. Let me know if


// you have to use linked lists.





#include %26lt;iostream%26gt;


#include %26lt;fstream%26gt;





using namespace std;





int main()


{


const int MAX_SIZE = 210;


ifstream inFile;


int number;


int array[MAX_SIZE];


int currentIndex = -1;


int sum = 0;





inFile.open("random.txt");





if(!inFile.fail())


{


while(inFile %26gt;%26gt; number %26amp;%26amp; currentIndex %26lt; MAX_SIZE)


{


currentIndex++;


array[currentIndex] = number;


sum += number;


}


inFile.close();





cout %26lt;%26lt; "The file contains: (" %26lt;%26lt; currentIndex + 1 %26lt;%26lt; ") numbers" %26lt;%26lt; endl;





cout %26lt;%26lt; "The sum of all numbers is: " %26lt;%26lt; sum %26lt;%26lt; endl;





cout %26lt;%26lt; "The average is: " %26lt;%26lt; (double) sum / (double) (currentIndex + 1) %26lt;%26lt; endl;


}





else


{


cout %26lt;%26lt; "Couldn't open random.txt" %26lt;%26lt; endl;


}





return 0;


}
Reply:I guess you don't want us to do your homework for you, please specify what you don't know to do here.


Hints:


File IO read in:


http://www.cplusplus.com/doc/tutorial/fi...


have two variables: int counter = 0, sum = 0;


for every new number counter++;


for every new number sum += number;


A is counter


B is sum


C is sum / counter


IPOD/iTunes Question! How to create random playlist?

Hello all...





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.





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.





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.





I tried making a smart playlist w/ the following settings, but it did not work:


Grouping contain's "Music" (all my songs have that grouping)


Limit to 680 songs selected randomly


Live Updating





The results weren't particularly random.





I'm using a Win XP computer. So, if there is some apple script that would help me, it wont work.





Thanks for the help.

IPOD/iTunes Question! How to create random playlist?
Wikipedia.com has basically the answer up there, just type the search





Good luck with it and have a good day!

quince

C probs..PLS HELP!!!!!!!?

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


btw the file extension is .c...tnx help you could help me... :)

C probs..PLS HELP!!!!!!!?
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)
Reply:Have a random number between 0 and 1.


If 0 then add


else subtract.





Don't make it any more complicated.


Statistics problem...?

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





a. Sketch a curve of the probability distribution of this random variable, which is the continuous version of the uniform distribution.





b. What is the mean of this probability distribution?





c. Find the probability that this random variable falls between 0.25 and 0.75.





*Note:


The mean of a probability distribution for a discrete random variable is





µ = Σ x P(x)





where the sum is taken over all possible values of x.

Statistics problem...?
a) The curve of the pdf is a straight line at y=1 going from x=0 to x=1.





b) The mean is (1-0)/2 = 0.5





c) P(0.25%26lt;= x %26lt;= 0.75) = 0.75-0.25 = 0.50


Probabality questions below need help fast is about discrete random varibles and probablity distributions?

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


a) what is the probablity that exactly 1 recieved special accomadation?


b) what is the probablity that least1 recieved special accomadation?


c) what is the probablity that at least 2 recieved special accomadation?


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?


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?

Probabality questions below need help fast is about discrete random varibles and probablity distributions?
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





In general, if X has the binomial distribution with n trials and a success probability of p then





X = x] = 0 for any other value of x.





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.





a) P(X = 1) = 0.3078902





b) P(X ≥ 1) = 1 - P(X = 0) = 1 - 0.6034647


= 0.3965353





c) P(X ≥ 2) = 1 - (P(X = 0) + P(X = 1))


= 1 - (0.60346473 + 0.30789017)


= 0.0886451





d) the mean of the binomial is n * p = 25 * 0.02 = 0.5


the variance is n * p * (1-p) = 0.49


the standard deviation is the square root of the variance = 0.7





P(0.5 - 2 * 0.7 ≤ X ≤ 0.5 + 0.2 * 0.7)


= P( -0.9 ≤ X ≤ 1.9)


since you have a discrete random variable the fractions are not possible


= P( 0 ≤ X ≤ 1) = P(X = 0) + P(X = 1) = 0.9113549





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:





(24.5 * 3 + 0.5 * 4.5) / 25 = 3.03 hours





this is a good example of a weighted mean.


Probabality questions below need help fast is about discrete random varibles and probablity distributions?

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


a) what is the probablity that exactly 1 recieved special accomadation?


b) what is the probablity that least1 recieved special accomadation?


c) what is the probablity that at least 2 recieved special accomadation?


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?


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?

Probabality questions below need help fast is about discrete random varibles and probablity distributions?
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





In general, if X has the binomial distribution with n trials and a success probability of p then





X = x] = 0 for any other value of x.





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.





a) P(X = 1) = 0.3078902





b) P(X ≥ 1) = 1 - P(X = 0) = 1 - 0.6034647


= 0.3965353





c) P(X ≥ 2) = 1 - (P(X = 0) + P(X = 1))


= 1 - (0.60346473 + 0.30789017)


= 0.0886451





d) the mean of the binomial is n * p = 25 * 0.02 = 0.5


the variance is n * p * (1-p) = 0.49


the standard deviation is the square root of the variance = 0.7





P(0.5 - 2 * 0.7 ≤ X ≤ 0.5 + 0.2 * 0.7)


= P( -0.9 ≤ X ≤ 1.9)


since you have a discrete random variable the fractions are not possible


= P( 0 ≤ X ≤ 1) = P(X = 0) + P(X = 1) = 0.9113549





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:





(24.5 * 3 + 0.5 * 4.5) / 25 = 3.03 hours





this is a good example of a weighted mean.
Reply:a) 25C1 * (.02) * (.98)^24 = p(exactly 1 student)





b) 1 - p(no students received accomodation)





c) 1 - p(0 students) - p(1 student)





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)





3) [(.98)*3 + (.02)*4]/25

garden centre

Statistics...Uniform distribution?

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





a. Sketch a curve of the probability distribution of this random variable, which is the continuous version of the uniform distribution.





b. What is the mean of this probability distribution?





c. Find the probability that this random variable falls between 0.25 and 0.75.





*Note:


The mean of a probability distribution for a discrete random variable is





µ = Σ x P(x)





where the sum is taken over all possible values of x.

Statistics...Uniform distribution?
f(x)=1, 0 %26lt; x %26lt; 1 is the probability density function of the random variable x.


More generally, it is f(x)=1/(b-a) a %26lt; x %26lt; b; Here b=1 and a=0.


The source shows a sketch.


b) mean = integral (0 to 1) xdx


=x^2/2 (0 to 1)


1/2


c)integral( 0.25 to 0.75) dx


=x (between limits 0.25 and 0.75)


=0.75-0.25=0.50
Reply:f(x)=1, 0 %26lt; x %26lt; 1 is the probability density function of the random variable x.


More generally, it is f(x)=1/(b-a) a %26lt; x %26lt; b; Here b=1 and a=0.


The source shows a sketch.


b) mean = integral (0 to 1) xdx


=x^2/2 (0 to 1)


1/2


c)integral( 0.25 to 0.75) dx


=x (between limits 0.25 and 0.75)


=0.75-0.25=0.50


Here, we are dealing with a continuous (not discrete) random variable.


Anime Poll #51 (Anime Week-"Random" Day)?

What do you usually type when you see something funny in Yahoo Answers?





A) LOL


B) ROFL


C) LMAO


D) * make faces like XD *


E) Muahahahahaha


F) Depends on how funny it is.....


G) Cookie and Bunny rule!!


H) Type nothing.......


I) None of the above (and state what you usually type)





I usually type LOL, or LOLOLOLOLOL, or make faces, or type ROFL!!! XDDD


That's choices A, B, D, and E. I also type other stuff like LMAO (choice C) and Muahahaha!!! (choice E)


How 'bout you?


(By the way, broke the world record of the highest number of choices in DarthRaider666's Anime Poll)





.......GOTTA STAY TUNED 4 DA NEXT "RANDOM" QUESTION!!!! %26gt;:D

Anime Poll #51 (Anime Week-"Random" Day)?
G!!!!!!!....they rule the world!!!!!!
Reply:d
Reply:D AND E





-CHIBUNNY
Reply:hm...depends:


i usually put either:


lol!!!~


and make the XD face ...^-^





the mwahahaha is for something evil i'm planning on doing...hehehe....*laughs suspiciously*





brownies and pikcahu rule~ lol [= jk





so today's random day?


are you gonna do Naruto's day?


wait, i wasn't active yesterday all day-long, so what was yesterday's? O.o





and tomorrow shall be Death Note XP


or no???


*confused*
Reply:A and D





Somes I make ^^ instead of xD





Lol! Wouldn't it DarthRaider666's records not world records?
Reply:C! All The Way!





LMAO. I Even Say it In Real Life, But Not L-M-A-O





I Say The Real Words.





Like "I was laughing my a$$ off!!"
Reply:[secretly holding spot^^]





stupid trolls better not rat me out


^_^





A)


D)


E)


G)


F)


I)


thats pretty much what i do


^_^





this is definitely my trade mark


though [along with.........LOL]





(\ /)


( . .)


C(")(")


bunny supporter for life^^





or.........





^_^





or..........[like i stated earlier]





i do this:





^_^





or at the end of what i type i put these little things^^





[edit]


DANGET DEIDARA!!!!!!!!!!


beat me by 17 seconds........LOL


[irony SUCKS!!!!!]


LOL
Reply:i'll say A and C
Reply:Well, I'm random and everyone knows that about me....


Unless you're a newbie....





I PICK I~!!!


I say (or type) this....


~ ^^ ~





It's a wittle bwushing guy~!!!


AWWW~!!!





P.S-


ME A BLEACH FAN~!!! GO HITSUGAYA~!!! GO RUKIA~!!!


GO A LOT OF OTHER PEOPLE IN BLEACH~!!!
Reply:Bleach for tomorrow.


Oh and I usually type 'LOL'.
Reply:D) XD





Heh heh heh......... what about Kirby with his katana.... I'm going to start using that. Why? Just because.





Remember! Tomorrow is Death Note! Let's make some apples!.........................





^_^





Wait... how do you make apples?





EDIT: Drat! I still want to find out how to make apples... there's GOT TO BE A WAY!!!





EDIT: Talrimk- Yesterday was Naruto Day! You missed it! :(
Reply:A BLEACH FAN IS HERE !!!!!!!!!!!!!!!!!!!!!!!!!!!!





I ALSO PICK BLEACH DAY TOMORROW !!!!!!!!!!!!!!!!!!!!!!!!!!!!





Did you get that Bleach Day e-mail I sent you, two days ago, I do believe it was ???????????????????





A, B, C and D !!!!!!!!!!!!!!!!!!!!!!
Reply:D) XD
Reply:depends, but i use:


lol, lmao, rofl, faces like xD x] =] =D ^^ etc or bwahahaha ^^
Reply:D and E. Evil laughter is my specialty. %26gt;:D
Reply:a g or f
Reply:A.
Reply:I do A: LOL





LOL!
Reply:D) XD ^-^ %26gt;.%26lt;
Reply:Usually just 'XD' because that smiley face is amazing. ^^








Art is a bang!! XD
Reply:A or B


I'm trying to write a game program and have problems.?

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?

I'm trying to write a game program and have problems.?
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...


Which of the following is not a source of variation of alleles?,the frequencies of four alleles of a trait?

Choices for first one are:


a.crossing over during meiosis


b. the number of alleles during meiosis


c. recombination during meiosis


d. independent assortment in meiosis


2nd one:


a. 100%


b. 25%


c. 50%


d. 75%


Other questions:


Two factors that contribute to evolution


a. genetic recombination and population


b. species and population


c. inbreeding and population


d. mutation and genetic recombination


Gene frequencies are not affected by


a. frequent mutation


b. natural selection


c. random mating


d. genetic drift


Small population have many problems maintaining stable numbers, partly becasue of


a. artificial selection


b. the founder effect


c. inbreeding depression


d. limited resources


A change in allele frequencies is more likely to produce


a. microevolution


b. inbreeding


c. mutation


d. macroevolution


Gene flow promotes evolution through


a. selective breeding


b. inbreeding


c. mutation in species


d. migration between gene pools

Which of the following is not a source of variation of alleles?,the frequencies of four alleles of a trait?
I sure hope this isn't your homework that I'm answering, haha.


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.





2. (b) 100/4 = 25%





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.





4. (c) Random mating is when two organisms make without regards to genotype.





5. (c) Inbreeding depression. Inbreeding makes more disadvantageous recessive traits show up in a population, causing numbers to fluctuate.





6. (a) Macroevolution is when you have something as drastic as a new species. Microevolution is evolution within a species.





7. (d) Definition of gene flow is basically "the transfer of alleles of genes from one population to another." (Wikipedia)

flower show