Presently we can solve problem instances of size 30 in 1 minute using algorithm A, which is a algorithm. On the other hand, we will soon have to solve probleminstances twice this large in 1 minute. Do you think it would help to buy a faster( and more expensive) computer?

Answers

Answer 1
Answer:

Answer:

No, if the algorithm is properly written to solve problems with minimal resources like RAM and processor speed.

Explanation:

Rather than buy a faster or more expensive computer simply upgrade the RAM else you may have to buy new computer each the size of problem instances increases.


Related Questions

What are the similarities and differences between the editor-in-chief, managing editor, assignment editor, and copyeditor? Your response should be at least 150 words.
You wrote a list of steps the user will take to perform a task. Which statement is true about this step?You have drawn pictures of what your screens will look like and identified the input-process-output that occurs on eachscreen.O Your app is functioning and ready to test.O You have defined a use case.O In this step, you defined your target audience and main goal.
Selector Next we will write a function that will help us select an output for the chatbot, based on the input it got. The overall goal of this function is to take a list of words that we got as input, a list of words to check for if they appear in the input outputs to return if something from the list to check is in the input list. Define a function, called selector. This function should have the following inputs, outputs and internal procedures: Input(s) input_list - list of string check_list - list of string return_list - list of string Output(s): output - string, or None Procedure(s): Initialize output to None Loop through each element in input_list Use a conditional to check if the current element is in check_list If it is, assign output as the returned value of calling the random.choice function on return_list Also, break out of the loop At the end of the function, return output Note that if we don't find any words from input_list that are in check_list, output will be returned as None.
In which of these places might you be most likely to find a peer-to-peer network? *In a large office buildingOn the InternetIn a homeIn a hospital
The getValue() method is overridden in two ways. Which one is correct?1.public class Test {public static void main(String[] args) {A a = new A();System.out.println(a.getValue());}class B {public String getValue() {return "Any object";}class A extends B {public Object getValue() {return "A string";}2.public class Test {public static void main(String[] args) {A a = new A();System.out.println(a.getValue());}class B {public Object getValue() {return "Any object";}class A extends B {public String getValue() {return "A string";}a.Ib.IIc.Both I and IId.Neither

What game is this? help mee?

Answers

Answer:

nooooooo

Explanation:

The utilization of a subset of the performance equation as a performance metric is a pitfall. To illustrate this, assume the following two processors. P1 has a clock rate of 4 GHz, average CPI of 0.9, and requires the execution of 5.0E9 instructions. P2 has a clock rate of 3 GHz, an average CPI of 0.75, and requi res the execution of 1.0E9 instructions. One usual fallacy is to consider the computer with the largest clock rate as having the largest performance. Check if this is true for P1 and P2.

Answers

Answer:

Given Data:

Clock rate of P1 = 4 GHz

Clock rate of P2 = 3 GHz

Average CPI of P1 = 0.9

Number of Instructions = 5.0E9 =  5 × 10^9

Clock rate of P2 = 3 GHz

Average CPI of P2 = 0.75

Number of Instructions = 1.0E9 = 10^9

To find: If the computer with largest clock rate has the largest performance?

Explanation:

Solution:

As given in the question, clock rate of P1 = 4 GHz which is greater than clock rate of P2 = 3 GHz

According to the performance equation:

CPU Time = instruction count * average cycles per instruction/ clock rate

CPU Time = I * CPI / clock rate

Where instruction count refers to the number of instructions.

Performance of P1:

CPU Time (P1) = 5 * 10^9 * 0.9 / (4 * 10^9)

                        = 5000000000 * 0.9 / 4000000000

                        = 4500000000 / 4000000000

                        =  1.125s

Performance of P2:

CPU Time (P2) = 10^9 * 0.75/ (3 * 10^9)

                        = 750000000 / 3000000000

                        = 0.25s

So the Performance of P2 is larger than that of P1,

                          performance (P2) > performance (P1)

                                         0.25 is better than 1.125

But clock rate of P1 was larger than P2

                             clock rate of P1 > clock rate of P2

                                                  4 GHz > 3 GHz

So this is a misconception about P1 and P2.

It is not true that computer with the largest clock rate as having the largest performance.

Implement the RC4 stream cipher in C++. User should be able to enter any key that is 5 bytes to 32 bytes long. Be sure to discard the first 3072 bytes of the pseudo random numbers. THE KEY OR THE INPUT TEXT MUST NOT BE HARD CODED IN THE PROGRAM.

Answers

Answer:

Explanation:

#include <iostream>

#include <string>

#include<vector>

using namespace std;  

vector<int> permute(vector<int>, vector<int>);

string encrypt(vector<int>s1 , vector<int> t1, string p);

string decrypt(vector<int>s1, vector<int> t1, string p);

int main() {

  string plaintext = "cryptology";

  string plaintext2 = "RC4";

  vector<int> S(256);

  vector<int> T(256);

  int key[] = { 1,2,3,6 };

  int key2[] = { 5,7,8,9 };

  int tmp = 0;

  for (int i = 0; i < 256;i++) {

      S[i] = i;

      T[i] = key[( i % (sizeof(key)/sizeof(*key)) )];

  }

  S = permute(S, T);

  for (int i = 0; i < 256 ;i++) {

      cout << S[i] << " ";

      if ((i + 1) % 16 == 0)

          cout << endl;

  }

  cout << endl;

  string p = encrypt(S, T, plaintext);

  cout << "Message: " << plaintext << endl;

  cout << "Encrypted Message: " << " " << p << endl;

  cout << "Decrypted Message: " << decrypt(S, T, p) << endl << endl;

  tmp = 0;

  for (int i = 0; i < 256;i++) {

      S[i] = i;

      T[i] = key2[(i % (sizeof(key) / sizeof(*key)))];

  }

  S = permute(S, T);

  for (int i = 0; i < 256;i++) {

      cout << S[i] << " ";

      if ((i + 1) % 16 == 0)

          cout << endl;

  }  

  cout << endl;

  p = encrypt(S, T, plaintext2);

  cout << "Message: " << plaintext2 << endl;

  cout << "Encrypted Msg: " << p << endl;

  cout << "Decrypted Msg: "<<decrypt(S, T, p) << endl << endl;

  return 0;

}

string decrypt(vector<int>s1, vector<int> t1, string p) {

  int i = 0;

  int j = 0;

  int tmp = 0;

  int k = 0;

  int b;

  int c;

  int * plain = new int[p.length()];

  string plainT;

  for (int r = 0; r < p.length(); r++) {

      i = (i + 1) % 256;

      j = (j + s1[i]) % 256;

      b = s1[i];

      s1[i] = s1[j];

      s1[j] = b;

      tmp = (s1[i] + s1[j]) % 256;

      k = s1[tmp];

      c = ((int)p[r] ^ k);

      plain[r] = c;

      plainT += (char)plain[r];

  }

  return plainT;

}  

string encrypt(vector<int>s1, vector<int> t1, string p) {

  int i = 0;

  int j = 0;

  int tmp = 0;

  int k = 0;

  int b;

  int c;

  int * cipher = new int [p.length()];

  string cipherT;

  cout << "Keys Generated for plaintext: ";

  for (int r = 0; r < p.length(); r++) {

      i = (i + 1) % 256;

      j = (j + s1[i]) % 256;

      b = s1[i];

      s1[i] = s1[j];

      s1[j] = b;

      tmp = (s1[i] + s1[j]) % 256;

      k = s1[tmp];

      cout << k << " ";

      c = ((int)p[r] ^ k);

      cipher[r] = c;  

      cipherT += (char)cipher[r];

  }

  cout << endl;

  return cipherT;

}

vector<int> permute(vector<int> s1, vector<int> t1) {

  int j = 0;

  int tmp;

  for (int i = 0; i< 256; i++) {

      j = (j + s1[i] + t1[i]) % 256;

      tmp = s1[i];

      s1[i] = s1[j];

      s1[j] = tmp;

  }

  return s1;

}

Provide your own examples of the following using Python lists. Create your own examples. Do not copy them from another source. Nested lists The “*” operator List slices The “+=” operator A list filter A list operation that is legal but does the "wrong" thing, not what the programmer expects Provide the Python code and output for your program and all your examples.

Answers

Lists are used in Python to hold multiple values in one variable

(a) Nested list

A nested list is simply a list of list; i.e. a list that contains another list.

It is also called a 2 dimensional list.

An example is:

nested_list = [[ 1, 2, 3, 4]  , [ 5, 6, 7]]

(b) The “*” operator

The "*" operator is used to calculate the product of numerical values.

An example is:

num1 = num2 * num3

List slices

This is used to get some parts of a list; it is done using the ":" sign

Take for instance, you want to get the elements from the 3rd to the 5th index of a list

An example is:

firstList = [1, 2 ,3, 4, 5, 6, 7]

secondList = firstList[2:5]

The “+=” operator

This is used to add and assign values to variables

An example is:

num1 = 5

num2 = 3

num2 += num1

A list filter

This is used to return some elements of a list based on certain condition called filter.

An example that prints the even elements of a list is:

firstList = [1, 2 ,3, 4, 5, 6, 7]

print(list(filter(lambda x: x % 2 == 0, firstList)))

A valid but wrong list operation

The following operation is to return a single list, but instead it returns as many lists as possible

def oneList(x, myList=[]):

   myList.append(x)

   print(myList)

oneList(3)

oneList(4)

Read more about Python listsat:

brainly.com/question/16397886

What information is required for a complete citation of a website source?A: the title, volume number, and page numbers
B: the responsible person or organization and the website URL
C: the responsible person or organization, date accessed, and URL
D: the responsible person or organization and the date accessed

Answers

Answer:

C: the responsible person or organization, date accessed, and URL

Explanation:

Jeff types a sentence She wore a new dress yesterday. He erroneously typed w instead of e in the word dress. What is the accuracy of the typed sentence?

Answers

96 i believe i'm not too certain on this one
96 
you take 24 and divide it