An education researcher has the hypothesis that higher education only reinforces…
- User
An education researcher has the hypothesis that higher education only reinforces existing education inequalities, rather than making students catch up and excel. More specifically, he makes the strong hypothesis that the student with the highest SAT score coming in will have the highest GPA upon graduation, the student with the second-highest SAT score will have the second-highest GPA, and so on. To be consistent, he hypothesizes that students coming in with the same SAT score will also have the exact same GPA. He would like you to write a program to test his theory on data sets. Each data set will contain students sorted alphabetically, with their GPA and SAT score given. Your program should determine whether his hypothesis is true. Add your code to the skeleton on the next page. Because he expects to run on several large data sets, your algorithm must run in time O(nlogn) for data sets of n students.
I have to solve the problem above by filing in the skeleton code below, and im currently stuck, dont show me the result but i want you to give me clues and guide on where i should get started to sovle this struct StudentRecord { string name; // name of the student int SAT; // SAT score double GPA; // GPA at graduation // feel free to add functionality here if you need it. }; int main (int nargs, char** args) { int n; // number of students in data set StudentRecord students; read_data (args[1], &n, students); / this function reads all the data correctly from the file and puts them in the array ‘students’. When the function returns, the students in the array will be sorted by name. n will be the size of the array. No two students will have the same name. */ // Your code goes here. You should output "Yes" if the hypothesis is true, and "No" otherwise. return 0; }
- Assistant
- User
We have a Bloom Filter with an array of 10 elements (the elements of the set are integers), and using three hash functions h1(x) = h2(x) = h3(x) = (7x + 4) mod 10, (2x + 1) mod 10, (5x + 3) mod 10. We execute the sequence of operations given below. What does the program output? Which of the answers are false positives (the Bloom filter says “Yes”, even though the correct answer is “No”)? Which are false negatives (the Bloom filter says “No”, even though the correct answer is “Yes”)? If your final answer is incorrect, you may get more partial credit if you show enough work for us to isolate the mistake. BloomFilterSet bf (10); bf.add (0); bf.add (1); bf.add (2); bf.add (8); // Show us what the Bloom Filter’s Array looks like at this point. if (bf.contains (2)) std::cout << "2\n"; if (bf.contains (3)) std::cout << "3\n"; if (bf.contains (4)) std::cout << "4\n"; if (bf.contains (9)) std::cout << "9\n";
- Assistant