...StatCrunch Assignment 2 First save this file to your computer. Answer each of the following questions, then resave the file along with your answers and turn it in using the assignment link in Module 3, Activity 4. the first four problems are worth 10 points each. Problems 5 and 6 are worth 30 points each. 1. If the original sample is 48, 55, 43, 61, 39, which of the following would not be a possible bootstrap sample? Explain why it wouldn’t be. a) 48, 55, 43, 61, 39 b) 43, 39, 56, 43, 61 c) 55, 48, 55, 48, 61 d) 39, 39, 39, 39, 39 The answer is be because the number “56” is not part of the original data so it cannot be used in bootstrapping. 2. The following bootstrap output is for mileage of a random sample of 25 mustang cars. Based on a 90% confidence interval, which of the following would not be a plausible value of the population mean, µ? Explain why it wouldn’t be. a) 60.01 b) 80.01 c) 55 d) 52 Based on the 90% confidence interval, the values are between 5th percentile and 95th percentile, which are between 52.096 and 80.012 3. Which of the following p-values would provide more evidence in support of the alternate hypothesis and against the null hypothesis? Explain your answer. a) 0.15 b) 0.85 c) 0.009 The greater the P-Value, the easier it is to justify rejecting the null hypothesis. d) 0.05 4. In a sample of 56 addicts, 28 were given a new drug to help them overcome their addiction, while the remaining 28 were given the current drug...
Words: 931 - Pages: 4
...Hashing hash functions collision resolution applications References: Algorithms in Java, Chapter 14 http://www.cs.princeton.edu/introalgsds/42hash 1 Summary of symbol-table implementations implementation unordered array ordered array unordered list ordered list BST randomized BST red-black tree guarantee search N lg N N N N 7 lg N 3 lg N insert N N N N N 7 lg N 3 lg N delete N N N N N 7 lg N 3 lg N search N/2 lg N N/2 N/2 1.39 lg N 1.39 lg N lg N average case insert N/2 N/2 N N/2 1.39 lg N 1.39 lg N lg N delete N/2 N/2 N/2 N/2 ? 1.39 lg N lg N ordered iteration? no yes no yes yes yes yes Can we do better? 2 Optimize Judiciously More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason including blind stupidity. - William A. Wulf We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. - Donald E. Knuth We follow two rules in the matter of optimization: Rule 1: Don't do it. Rule 2 (for experts only). Don't do it yet - that is, not until you have a perfectly clear and unoptimized solution. - M. A. Jackson Reference: Effective Java by Joshua Bloch. 3 Hashing: basic plan Save items in a key-indexed table (index is a function of the key). Hash function. Method for computing table index from key. hash(“it”) = 3 ?? hash(“times”) = 3 0 1 2 3 4 5 “it” Issues. 1. Computing the hash function 2. Collision resolution:...
Words: 4332 - Pages: 18
...1. Factorial program in cFactorial program in c: c code to find and print factorial of a number, three methods are given, first one uses for loop, second uses a function to find factorial and third using recursion. Factorial is represented using '!', so five factorial will be written as (5!), n factorial as (n!). Alson! = n*(n-1)*(n-2)*(n-3)...3.2.1 and zero factorial is defined as one i.e. 0! = 1. #include <stdio.h> int main() { int c, n, fact = 1; printf("Enter a number to calculate it's factorial\n"); scanf("%d", &n); for (c = 1; c <= n; c++) fact = fact * c; printf("Factorial of %d = %d\n", n, fact); return 0; } 2. c program to check odd or evenc program to check odd or even: We will determine whether a number is odd or even by using different methods all are provided with a code in c language. As you have study in mathematics that in decimal number system even numbers are divisible by 2 while odd are not so we may use modulus operator(%) which returns remainder, For example 4%3 gives 1 ( remainder when four is divided by three). Even numbers are of the form 2*p and odd are of the form (2*p+1) where p is is an integer. #include<stdio.h> main() { int n; printf("Enter an integer\n"); scanf("%d",&n); if ( n%2 == 0 ) printf("Even\n"); else printf("Odd\n"); return 0; } 3. C program to check whether input alphabet is a vowel or notThis code checks whether an input alphabet is a vowel...
Words: 7510 - Pages: 31