Jump to content

DylsexicChciken

Senior Members
  • Posts

    44
  • Joined

  • Last visited

Everything posted by DylsexicChciken

  1. Would the inverse be true if the sequence is not a piece-wise function? It seems two textbooks I have read have been implying that the inverse is valid if the conditions for alternating test for convergence is not satisfied, albeit the textbooks does not deal with piece-wise series.
  2. So basically the converse is true in that it won't converge, thanks.
  3. The alternative series test says if the absolute value of the terms are not increasing and the limit of the absolute value terms goes to 0, then the alternating series converges. What happens if the converse is satisfied, when the absolute value terms of an alternating series are increasing or the limit of the absolute value terms does not go to zero? If either test fails, can we say the alternating series is divergent?
  4. EDIT: Expected run time = worst case rune time = O(N) for algorithm 3 not algorithm 2. I meant to copy and paste it for algorithm 3 but accidentally pasted it in algorithm 2. Sorry, I made a wrong edit yesterday. But now I can't edit anymore, so here is the edited version: I just need help verifying that I have the correct analyses to the problem below: Assume we have a random number generator function called randInt(i, j), which generates a random number between i and j. We will use this function to randomly generate a number between 1 and N, i.e., randInt(1, N). We want to fill an N-sized array with a random permutation of the first N integers using the randInt function above. We only want the run time analyses for the algorithms below: Algorithm 1 : Fill array arr_ from arr_[0] to arr_[N-1]. To do this, randomly generate numbers until you get a number that isn't contained in any of the filled slots of arr_. This ensures that all numbers from 0 to N is used. My analyses: My analysis says this algorithm has a probability, albeit extremely minute, that it will never terminate, so is this O(infinity)? This is because you can randomly generate a number that is already contained in the filled slots of arr_ every single time. After summation algebra, I find the expected run time to be O(N^2). Algorithm 2: This time we use an extra array. This array is an array of type bool, so each value is either 1 or 0. This array, which we can call contains_, is also of size N. If we randomly generate a number X, then we set contains_[X] to true, so the next time we see a randomly generated number and it turns out to be X, we don't actually have to check all of the filled slots of arr_ to know if arr_ already contains X, we merely check to see if contains_[X] is set to true. My analyses: This algorithm suffers the same problem as algorithm 1, in that you can randomly generate a number that is already contained in the filled slots of arr_ every single time. So O(infinity), albeit there is no longer a need for a checking loop to check for contains as it was in algorithm 1. Expected runtime = O(N). Algorithm 3: Fill the array one by one sequentially with 1, 2, 3, 4, ... , N. Then for each position arr_[ i ], swap it with a randomly generated location between 0 and i. e.g., for( i = 1; i < n; ++i ) swap( a[ i ], a[ randInt( 0, i ) ] ); My analyses: This has O(N) since the problem size is assuredly reduced by one each iteration, so it surely will reach N at some point unlike the last two problems. Expected run time = worst case rune time = O(N) Are my analyses correct?
  5. I just need help verifying that I have the correct analyses to the problem below: Assume we have a random number generator function called randInt(i, j), which generates a random number between i and j. We will use this function to randomly generate a number between 1 and N, i.e., randInt(1, N). We want to fill an N-sized array with a random permutation of the first N integers using the randInt function above. Algorithm 1 : Fill array arr_ from arr_[0] to arr_[N-1]. To do this, randomly generate numbers until you get a number that isn't contained in any of the filled slots of arr_. This ensures that all numbers from 0 to N is used. My analyses: My analysis says this algorithm has a probability, albeit extremely minute, that it will never terminate, so is this O(infinity)? This is because you can randomly generate a number that is already contained in the filled slots of arr_ every single time. After summation algebra, I find the expected run time to be O(N^2). Algorithm 2: This time we use an extra array. This array is an array of type bool, so each value is either 1 or 0. This array, which we can call contains_, is also of size N. If we randomly generate a number X, then we set contains_[X] to true, so the next time we see a randomly generated number and it turns out to be X, we don't actually have to check all of the filled slots of arr_ to know if arr_ already contains X, we merely check to see if contains_[X] is set to true. My analyses: This algorithm suffers the same problem as algorithm 1, in that you can randomly generate a number that is already contained in the filled slots of arr_ every single time. So O(infinity), albeit there is no longer a need for a checking loop to check for contains as it was in algorithm 1. Expected runtime = worst case run time = O(N). Algorithm 3: Fill the array one by one sequentially with 1, 2, 3, 4, ... , N. Then for each position arr_[ i ], swap it with a randomly generated location between 0 and i. e.g., for( i = 1; i < n; ++i ) swap( a[ i ], a[ randInt( 0, i ) ] ); My analyses: This has O(N) since the problem size is assuredly reduced by one each iteration, so it surely will reach N at some point unlike the last two problems. Are my analyses correct?
  6. So the 2^16 bits can store 65536 addresses, each address containing 1 byte. But how does the plus or minus 2^15 and 32,768 bytes factor into this? Plus or minus 2^15 implies there are negative addresses, meanwhile 32,768 bytes is only half the amount of addresses that can be represented.
  7. I copied the paragraph from the book and forgot to edit some mistakes. The quote above is the fixed version. Yes this is referring to MIPS instruction code. I don't know how to do the plus or minus sign, so I put it in English instead of the plus or minus symbol. It's basically saying you can store 32,768 bytes in the space of 2^16 bits in the address section of I-format instruction. I am still having trouble wrapping my head around this
  8. Let $s6 be the base address of an array A and $t0 contains some value. When you add: add $t0, $s6, $t0 Does register $s6 refer to a value or an address? More importantly, what does $t0 contain? Does $t0 contain a value or an address? How does the computer know whether the register refers to values or addresses? If it is a value, then how is it possible to do this afterward: lw $s0, 0($t0) How can a register have a set of offset addresses? Does the address of A carry over to $t0? If so where are they stored, because obviously $t0 is used to store the data. I thought offsets only applied to arrays. So does $s6 and $t0 both refer to an address and a value? Is $s6 by default equivalent to 0($s6)?
  9. I think my book made a mistake, my teacher had the same book and the same edition with different wording which was clearer and meant something different from the exact version I have, which is weird. 32,768 bytes is way too large to be equivalent to 16 bits. 32,768 bytes is 32,768 * 8 bits = 262,144 bits. There are only 2 bytes in 16 bits because there are only 8 bits in 1 byte. The book probably meant plus or minus 32,768 integers, not bytes.
  10. Book says 16 bits is equivalent to 32,678 bytes. How did my book get that?
  11. My books says that when a computer tries to subtract a large binary number form a small binary number, the computer attempts to borrow from leading 0s, and the result is a string of leading 1s. Why is this the case, especially when the smaller number don't have leading 1s to accommodate the subtraction? So how can the result be leading 1s as if the smaller number was bigger? What is happening in the hardware that forces the computer to create a string of leading 1s?
  12. For the topic of linear regression, my book says that the (coefficient of determination) = (correlation coefficient squared). But it doesn't explain why. So why is on equal to the square of the other when their formulas look completely different?
  13. I was thinking of it in terms of the definition of a. It took some time, but I formulated the below intuition: If p-value [latex] \leq [/latex] a (the equal sign under the inequality is not showing on this forum for some reason): Getting our observed statistic from the sample is at most as likely as the chance of rejecting a true [latex] H_0 [/latex]. In other words, hence we have very likely a higher chance that [latex] H_0 [/latex] is false than we have the chance of rejecting a true [latex] H_0 [/latex]. This simplifies to: we have very likely a higher chance of rejecting a false [latex] H_0 [/latex] than the chance of rejecting a true [latex] H_0 [/latex].
  14. If a type I error a for a hypothesis test is 0.05, and the p-value=0.01. We reject [latex] H_0 [/latex] because p-value [latex] \leq [/latex] a. What is the reasoning or intuition for this?
  15. I looked through the book and I don't think I see anything called acceptance criteria or decision rules. I am still reading an early section on hypothesis testing, so it might be somewhere later on. I was referring to the value b (of the test procedures on the variable being tested, p) the probability value of type II error. Type I error, a, and Type II error, b, are inversely proportional. The statistician has only control over type I error, a, therefore the statistician can control type II error, b, indirectly by minimizing or maximizing type I error, a. So even knowing this, in practice the statistician still won't be able to find the value of b(so far I haven't learned how to calculate b, if there even is a way)? I am still in an early part of the hypothesis testing chapter, so the information I learned so far should be about basic concepts of error and interpreting a problem.
  16. The book's example assumes the case when it is true that we have committed a type II error, in that p = 0.72 is false and we fail to reject it. Then the actual value of p would be [latex] p< 0.72 [/latex] or [latex] p> 0.72 [/latex]. So the proportion of on time flights can be greater or less than 0.72, but the book only considers the case when [latex] p> 0.72 [/latex]. So the question is why did they choose only one of the consequences? Is it because they just happen to choose one example of consequence? Now that I thought about it again, it makes a little more sense. This was my problem if you're still interested: When we fail to reject [latex] H_0 [/latex] given that [latex] H_0 [/latex] is false. The fact that [latex] H_0 [/latex] is false is something a statistician won't know for certain. The statistician only knows the probability that [latex] H_0 [/latex] is false and he fails to reject it. This is error is denoted by b, the probability of type II error. So therefore, the statistician could have either chosen to accept [latex] H_0 [/latex] or reject [latex] H_0 [/latex] because the samples he collected is inconclusive about the truth of [latex] H_0 [/latex]. The probability formula for b is (# of failed rejections given that [latex] H_0 [/latex] is false) / sample size. The sample size should be 362, so I believe the book made another error. As you can see, this calculation does not take into account the fact that the statistician could have accepted or rejected it. But I now understand that b is just the probability when we fail to reject a false [latex] H_0 [/latex], therefore whether or not the statistician ultimately accepts [latex] H_0 [/latex] or rejects [latex] H_0 [/latex], the error of failing to reject a false [latex] H_0 [/latex] is still made and the formula for b is only concerned with failing to reject a false [latex] H_0 [/latex], regardless of what happens afterwards.
  17. This is my book: http://www.amazon.com/Introduction-Statistics-Analysis-Available-Titles/dp/0840054904/ref=sr_1_1?s=books&ie=UTF8&qid=1416491336&sr=1-1&keywords=Introduction+to+Statistics+and+Data+Analysis+peck
  18. So the hypothesis test procedure pits the null hypothesis ([math]H_0[/math]) against the alternative hypothesis ([math]H_a[/math]). If a given sample provides more evidence that [math]H_a[/math] is true, than [math]H_0[/math] is rejected. If there isn't enough evidence to reject [math]H_0[/math], then we can't conclude anything. Two errors result from this: Type I error: the error of rejecting [math]H_0[/math] when [math]H_0[/math] is true. Type II error: the error of failing to reject [math]H_0[/math] when [math]H_0[/math] is false. 1. First example: " The U.S. Bureau of Transportation Statistics reports that for 2009, 72% of all domestic passenger flights arrived on time (meaning within 15 minutes of the scheduled arrival). Suppose that an airline with a poor on-time record decides to offer its employees a bonus if, in an upcoming month, the airline’s proportion of on-time flights exceeds the overall 2009 industry rate of .72. Let p be the actual proportion of the airline’s flights that are on time during the month of interest. A random sample of flights might be selected and used as a basis for choosing between H0: p = .72 and Ha: p >.72 In this context, a Type I error (rejecting a true H0) results in the airline rewarding its employees when in fact the actual proportion of on-time flights did not exceed .72. A Type II error (not rejecting a false H0) results in the airline employees not receiving a reward that they deserved. " The book claims that type II error, the failing to reject [math]H_0[/math] when [math]H_0[/math] is false, means that the airline employees did not receive the reward that they deserve. But isn't that not always true? Failing to reject [math]H_0[/math] means that [math]p< 0.72[/math] or [math]p > 0.72[/math], i.e. [math]p\neq0.72[/math], hence there could be less than 72% of domestic passenger flights being on time as well as there being more than 72% of domestic passenger flights being on time, yet the book only considers one possibility. Is there a reason for considering only one outcome? This is repeated in other examples that analyze type I and type II errors. 2. Another example I don't quite understand: The probability of a Type I error is denoted by a and is called the significance level of the test. For example, a test with a .01 is said to have a significance level of .01. The probability of a Type II error is denoted by b. " Women with ovarian cancer usually are not diagnosed until the disease is in an advanced stage, when it is most difficult to treat. The paper “Diagnostic Markers for Early Detection of Ovarian Cancer” (Clinical Cancer Research [2008]: 1065–1072) describes a new approach to diagnosing ovarian cancer that is based on using six different blood biomarkers (a blood biomarker is a biochemical characteristic that is measured in laboratory testing). The authors report the following results using the six biomarkers: • For 156 women known to have ovarian cancer, the biomarkers correctly identified 151 as having ovarian cancer. • For 362 women known not to have ovarian cancer, the biomarkers correctly identified 360 of them as being ovarian cancer free. We can think of using this blood test to choose between two hypotheses: H0: woman has ovarian cancer Ha: woman does not have ovarian cancer Note that although these are not “statistical hypotheses” (statements about a population characteristic), the possible decision errors are analogous to Type I and Type II errors. In this situation, believing that a woman with ovarian cancer is cancer free would be a Type I error—rejecting the hypothesis of ovarian cancer when it is in fact true. Believing that a woman who is actually cancer free does have ovarian cancer is a Type II error—not rejecting the null hypothesis when it is in fact false. Based on the study results, we can estimate the error probabilities. The probability of a Type I error, a, is approximately 5/156 .032. The probability of a Type II error, b, is approximately 2/363 .006. " From the above example, the type II error exists when we fail to reject [math]H_0[/math] when [math]H_0[/math] is false. This means that as the statistician conducting the research, the statistician could accept [math]H_0[/math] or reject [math]H_0[/math] because failure to reject [math]H_0[/math] means [math]H_0[/math] could be true or false. Therefore if by luck the statistician rejects [math]H_0[/math], then no error is made. The only error made in type II error is if he accepts [math]H_0[/math] when it is false. So why doesn't this factor into the calculation of error of type II error b? 3. Another example: From the book: " The Environmental Protection Agency (EPA) has adopted what is known as the Lead and Copper Rule, which defines drinking water as unsafe if the concentration of lead is 15 parts per billion (ppb) or greater or if the concentration of copper is 1.3 parts per million (ppm) or greater. With m denoting the mean concentration of lead, the manager of a community water system might use lead level measurements from a sample of water specimens to test H0: m = 15 versus Ha: m > 15 The null hypothesis (which also implicitly includes the m > 15 case) states that the mean lead concentration is excessive by EPA standards. The alternative hypothesis states that the mean lead concentration is at an acceptable level and that the water system meets EPA standards for lead. (How is this correct?) ... " Shouldn't [math]H_a[/math] be m < 15? Because if [math]H_a[/math]: m > 15, then it's still not save by EPA standards. So we actually want [math]H_a[/math], right?
  19. My book says on average the sampling variance [math]\dfrac{\sum (x- \bar{x})}{n} [/math] is biased because it usually gives estimates smaller than the actual variance of a population. We fix this by dividing the sum by n-1 instead of n: [math]\dfrac{\sum (x- \bar{x})}{n-1} [/math] Is there a more intuitive or formal explanation of this?
  20. A question about the diagram. Aren't we selecting 32% from the total population each year, for example 32 out of 100 people for first year and 32 out of same 100 for the second year. So why are we taking 32% of the 32 selected from last year for the second year, instead of 32% of 100 for the second year?
  21. In a small city, approximately 32% of those eligible are called for jury duty in any one calendar year. People are selected for jury duty at random from those eligible, and the same individual cannot be called more than once in the same year. (a) What is the probability that a particular eligible person in this city is selected two years in a row? The answer turns out to be 0.32 * 0.32 =0.1024=(32/100)*(32/100). Why is this the answer? At first I thought it should be (32/100) = 0.32. This is because after we select the first 32 people out of 100 for jury duty, there is a (32/100) chance we select the same person from last year's 32 people. Why do we multiply 0.32 * 0.32?
  22. The actual radius being not the same was not directly apparent in the expression. If you have [latex]x=y[/latex] and [latex]x= \sqrt{y}[/latex]: [latex] \int_0^1 x dx [/latex] [latex] \int_0^1 x dx [/latex] They look like the same integral, but are actually different when the x take different y values even when the boundaries are the same. It was just that this fact is not directly apparent to me because I was looking at the integral only and trying to find a difference. It didn't help that I used examples with the same boundaries.
  23. Yea, the whole integral isn't the same, but the radius is. That's what confused me.
  24. It's not the same radius. But it is when you integrate with respect to x for boundaries (0,0) and (1,1) and use x in place of the radius. Using y value is clearer, but I know intuitively why we use y value. [latex] y= x^2 [/latex] [latex] \sqrt{y}= x [/latex] So therefore, we can use x as the radius. The formula: [latex] \int 2 \pi x \sqrt{1+ \left ( \frac{dy}{dx} \right )^2} \, dx [/latex] is derived for [latex] y= x^2 [/latex] specifically, and in general also applies to [latex] y= x^n [/latex]. The original formula is: [latex] S = \int_a^b 2 \pi y \sqrt{1+ \left ( \frac{dy}{dx} \right )^2} \, dx [/latex]
  25. Never mind. I just did a random example using both variables for solids of revolution. It turns out you can use either variable. The example is: [latex] y= \sqrt{x}[/latex] revolved around the x-axis. [latex] y^2= x[/latex] [latex] dx= 2y\,dy[/latex] [latex] \int_0^1 \pi x \, dx = \dfrac{\pi}{2} [/latex] [latex] \int_0^1 \pi y^2 \big( 2y \, dy \big) = \dfrac{\pi}{2} [/latex] So it actually turns out you can use either variable for solids of revolution and surfaces of revolution. This is knowledge that rare amount of teachers actually explain. This is the case because I recall being told you can only use one variable for solids of revolution.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.