[Solved]1 Find Integers S T 172s 151t 1 Full Credit Find Smallest Magnitude Integers Hint First F Q37298493

1. Find integers s, t such that 172s + 151t == 1. For fullcredit, find the smallest magnitude integers you can. Hint: Firstfind gcd(151, 172) = 1.

2. (a) In lecture, we saw Euler’s Totient Function Φ(n), whichis defined as the number of positive integers less than or equal ton that are relatively prime to n. Suppose I want to compute Φ(84),as per lecture. I know that 84 = 14 × 6, so I compute Φ(14) andmultiply it by Φ(6). Do I get the right result? Briefly, why doesthis work or not work? Your answer should be brief, but not assimple as “because the numbers do/don’t multiply to form that.” (b)Compute Φ(84). Show your work.

3. Calculate 9200 mod 77. Show your work. For purposes ofshowing your work, do not assume you have access to a programmable(e.g., graphing) calculator or internet for purposes of solvingthis problem. To make this fair to all, we will tell you thecorrect number at the end is 67.

Expert Answer


Answer to 1. Find integers s, t such that 172s + 151t == 1. For full credit, find the smallest magnitude integers you can. Hint: F… . . .

[Solved]1 Find Output Pass Reference Ans 3 3 11 Plz Explain Throughly Procedure F X Y Z X X 1 Y Z Q37297411

1. Find output for pass by reference.

Ans. 3, 3, 11

PLZ EXPLAIN THROUGHLY

procedure f(x, y, z)

x := x + 1

y := z + 1

z := z + 1

i := 1; a[1] := 10; a[2] := 11

f(i, a[i], i)

print(i, a[1], a[2]

Expert Answer


Answer to 1. Find output for pass by reference. Ans. 3, 3, 11 PLZ EXPLAIN THROUGHLY procedure f(x, y, z) x := x + 1 y := z + 1 z :… . . .

[Solved]1 First Let Us Look Timing 10pts Give Reasonable Explanation Selection Sort Algorithm O N2 Q37220507

1. First, let us look at some timing (10pts) Give a reasonable explanation as to why the Selection Sort algorithm is an O (N2

1. First, let us look at some timing (10pts) Give a reasonable explanation as to why the Selection Sort algorithm is an O (N2) algorithm. [O(fx) implies that the algorithm carries out f(x) operations.] (5pts) Even though Selection Sort and Bubble Sort are both considered O(N2) algorithms, their timing can vary, suggest a reason why. (10pts) You have two algorithms that both operate on 600,000 data elements. The first algorithm is an O(N2) algorithm and takes 10 hours to run. The second algorithm is an O (Nlog2N)algorithm. How long does the second algorithm take to process the same 600,000 data elements. Show your work and give the result in seconds. [Assume the operations are the same.] a. b. c. Show transcribed image text 1. First, let us look at some timing (10pts) Give a reasonable explanation as to why the Selection Sort algorithm is an O (N2) algorithm. [O(fx) implies that the algorithm carries out f(x) operations.] (5pts) Even though Selection Sort and Bubble Sort are both considered O(N2) algorithms, their timing can vary, suggest a reason why. (10pts) You have two algorithms that both operate on 600,000 data elements. The first algorithm is an O(N2) algorithm and takes 10 hours to run. The second algorithm is an O (Nlog2N)algorithm. How long does the second algorithm take to process the same 600,000 data elements. Show your work and give the result in seconds. [Assume the operations are the same.] a. b. c.

Expert Answer


Answer to 1. First, let us look at some timing (10pts) Give a reasonable explanation as to why the Selection Sort algorithm is an … . . .

[Solved]1 First Screenshot Right Initial Rendering Prob1html Textbox First Number Name Num1 Second Q37285273

1. The first screenshot at right is theinitial rendering of prob1.html. The textboxfor the first number has name=”num1″, andthat for the second number has name=”num2″.All the radio buttons have name=”op”. Thevalues of the radio buttons are, respectively,”add”, “sub”, “mul”, and “div”. A radiobutton can be selected not only by clickingdirectly on it but also by clicking its label. Notethat the radio buttons are all inside a fieldsetwith a legend.It is expected that the user will enter numbersinto the two textboxes then clickSubmit, which sends a GET request toprob1.php.The second screenshot shows theform with numbers 2 and 3 entered. The thirdscreenshot shows the rendering of the HTMLreturned by the server when this form issubmitted. We provide two digits after thedecimal place since floating-point values maybe entered, and, in any case, division may resultin non-integer values even with integeroperands. The fourth screenshot down showsthe result when the Divide radio button isclicked and the form (with the same numbers)is submitted. To get a string representation of anumber $x with two digits after the decimalpoint, use number_format($x, 2).
Write and submit both prob1.html andprob1.php.1(6 pts.). The first screenshot at right is the initial rendering of probl.html. The textbox First number for the first numbe1(6 pts.). The first screenshot at right is the initial rendering of probl.html. The textbox First number for the first number has name “numl”, and that for the second number has name-“num2”. Second number All the radio buttons have name “op”. The values of the radio buttons are, respectively, “add”, “sub”, “mul”, and “div”. A radio button can be selected not only by clicking directly on it but also by clicking its label Note that the radio buttons are all inside a fieldset with a legend Select an operation o Add i Multiply Divide It is expected that the user wl enter numbers into the two textboxes then click Submit, which sends a GET request to probl.php. The second screenshot shows the form with numbers 2 and 3 entered. The third screenshot shows the rendering of the HTML First number: returned by the server when this fo is submitted. We provide two digits after te Second number: 3 decimal place since floating-point values may be entered, and, in any case, division may res Select an operation in non-integer values even with integer operands. The fourth screenshot down shows the result when the Divide radio button is clicked and the form (with the same numbers) is submitted. To get a string representation of a number $x with two digits after the decimal point, use number_format($x, 2) Submit Subtract Multiply O Divide Write and submit both probl.html and probi. php +3-5.00 2/3-0.67 Show transcribed image text 1(6 pts.). The first screenshot at right is the initial rendering of probl.html. The textbox First number for the first number has name “numl”, and that for the second number has name-“num2”. Second number All the radio buttons have name “op”. The values of the radio buttons are, respectively, “add”, “sub”, “mul”, and “div”. A radio button can be selected not only by clicking directly on it but also by clicking its label Note that the radio buttons are all inside a fieldset with a legend Select an operation o Add i Multiply Divide It is expected that the user wl enter numbers into the two textboxes then click Submit, which sends a GET request to probl.php. The second screenshot shows the form with numbers 2 and 3 entered. The third screenshot shows the rendering of the HTML First number: returned by the server when this fo is submitted. We provide two digits after te Second number: 3 decimal place since floating-point values may be entered, and, in any case, division may res Select an operation in non-integer values even with integer operands. The fourth screenshot down shows the result when the Divide radio button is clicked and the form (with the same numbers) is submitted. To get a string representation of a number $x with two digits after the decimal point, use number_format($x, 2) Submit Subtract Multiply O Divide Write and submit both probl.html and probi. php +3-5.00 2/3-0.67

Expert Answer


Answer to 1. The first screenshot at right is theinitial rendering of prob1.html. The textboxfor the first number has name=”num1″,… . . .

[Solved]1 Following Algorithm Convert Decimal Number Int Binary Number Ex Convert 13 1101 First Di Q37254434

1.) The following is the algorithm to convert a decimal number (int) to a binary number Ex: Convert 13 to 1101 a) First dividHowever, the output statement is after a recursive function call within If the number is greater than zero, the function is r1.) The following is the algorithm to convert a decimal number (int) to a binary number Ex: Convert 13 to 1101 a) First divide the integer number by 2, (binary is base 2). Ex: int num 5; int base 2; 5 2 2 with a remainder of 1 b) Write down the remainder c) Then divide the new number by two and write down the number Each time the new number is the quotient from the previous expression. – -2 = 1 with a remainder of 0 2 Write the remainders moving from right to left. d) Repeat steps a and b until the new number (quotient) is o 1-0 with a remainder of 1 2 Answer 1 01 2.) Write a program that converts integer values to binary. 3.) Your program should first prompt the user to enter a non-negative integer. 4.) The program should have a recursive function named: dec ToBinary. The int values should be O or greater. – With the first function call in main0, an integer value, initially representing the value – The function is void-returning. – The function divides the number that is passed as an argument by2 – The remainder is output to the screen. entered by the user is passed to the function. However, the output statement is after a recursive function call within If the number is greater than zero, the function is recursively called, with the The base case for the function is when the number equals zero, at which time, the function body. quotient of the previous division being passed as an argument zero is output to the screen, and recursive function calls stop. – – 5.) Compile and run the program. 6.) Turn in your source code and output demonstrating the function works successfully. * OUTPUT: Enter a non-negative integer value: 0 Decimal o 0 binary Press any key to continue..*/ OUTPUT: Enter a non-negative integer value: 37 Decimal 37 0100101 binary. Press any key to continue.* OUTPUT Enter a non-negative integer value:1 Decimal -1 = Invalid entry binary. Press any key to continue./ Show transcribed image text 1.) The following is the algorithm to convert a decimal number (int) to a binary number Ex: Convert 13 to 1101 a) First divide the integer number by 2, (binary is base 2). Ex: int num 5; int base 2; 5 2 2 with a remainder of 1 b) Write down the remainder c) Then divide the new number by two and write down the number Each time the new number is the quotient from the previous expression. – -2 = 1 with a remainder of 0 2 Write the remainders moving from right to left. d) Repeat steps a and b until the new number (quotient) is o 1-0 with a remainder of 1 2 Answer 1 01 2.) Write a program that converts integer values to binary. 3.) Your program should first prompt the user to enter a non-negative integer. 4.) The program should have a recursive function named: dec ToBinary. The int values should be O or greater. – With the first function call in main0, an integer value, initially representing the value – The function is void-returning. – The function divides the number that is passed as an argument by2 – The remainder is output to the screen. entered by the user is passed to the function.
However, the output statement is after a recursive function call within If the number is greater than zero, the function is recursively called, with the The base case for the function is when the number equals zero, at which time, the function body. quotient of the previous division being passed as an argument zero is output to the screen, and recursive function calls stop. – – 5.) Compile and run the program. 6.) Turn in your source code and output demonstrating the function works successfully. * OUTPUT: Enter a non-negative integer value: 0 Decimal o 0 binary Press any key to continue..*/ OUTPUT: Enter a non-negative integer value: 37 Decimal 37 0100101 binary. Press any key to continue.* OUTPUT Enter a non-negative integer value:1 Decimal -1 = Invalid entry binary. Press any key to continue./

Expert Answer


Answer to 1.) The following is the algorithm to convert a decimal number (int) to a binary number Ex: Convert 13 to 1101 a) First … . . .

[Solved]1 Following Characteristics Considered Motivations Digitally Encoding Binary Data Using On Q37248818

1. Of the following characteristics, which are considered motivations for digitally encoding binary data using one of the met

1. Of the following characteristics, which are considered motivations for digitally encoding binary data using one of the methods discussed in class? The encoding methods discussed in class were Manchester Encoding, Frequency Modulation, Modified FM, and Run Length Limited. (3 points a.) The encoding methods are used to address individual devices on a single network. b.) A form of data compression may be achieved with some of the encoding methods discussed c.) Both the data and a synchronizing clock are included on a single digital signal d.) Bit rates (measured in bits/second) can vary within a single encoded signal e.) Long sequences of the same bit level do not run the risk of losing clock synchronization. f.) Data is represented by the timing of changes in signal level and not the signal level itself. Show transcribed image text 1. Of the following characteristics, which are considered motivations for digitally encoding binary data using one of the methods discussed in class? The encoding methods discussed in class were Manchester Encoding, Frequency Modulation, Modified FM, and Run Length Limited. (3 points a.) The encoding methods are used to address individual devices on a single network. b.) A form of data compression may be achieved with some of the encoding methods discussed c.) Both the data and a synchronizing clock are included on a single digital signal d.) Bit rates (measured in bits/second) can vary within a single encoded signal e.) Long sequences of the same bit level do not run the risk of losing clock synchronization. f.) Data is represented by the timing of changes in signal level and not the signal level itself.

Expert Answer


Answer to 1. Of the following characteristics, which are considered motivations for digitally encoding binary data using one of th… . . .

[Solved]1 Following Code Radius Private Cirle Class Mycircle Object Circle Class Following Highlig Q37263437

1) In the following code, radius is private in the Circle class, and my Circle is an object of Circle class. Does the following highlighted code cause any problems Explain why.

public class Circle {

private double radius = 1.0;

// find the area of this circle

double getArea (){

return radius * radius * Math.PI;

}

public static void main(String[] a) {

Circle myCircle = new Circle();

System.out.println(“Radius is” + myCircle.radius);

}

}

Expert Answer


Answer to 1) In the following code, radius is private in the Circle class, and myCircle is an object of Circle class. Does the foll… . . .

[Solved]1 Following Commands Remove Lsmith S Home Space User Account Usermod Del Lsmith B Userdel Q37250621

1. Which of the following commands will remove lsmith’shome space and user account?

a) usermod –del lsmith

b) userdel lsmith

c) deleteuser lsmith

d) userdel -r lsmith

2. User lsmith is currently logged in. In order tochange her login name to ljones, which of the following commandwould you use?

a) usermod -l ljones lsmith

b) moduser -l ljones lsmith

c) usermod –login ljones lsmith

d) none of the above

3. Which of the following commands will unlock a user’saccount?

a) moduser -u lsmith

b) usermod -U lsmith

c) usermod -unlock lsmith

d) none of the above

4. Which of the following commands will add a useraccount called lsmith and include her in a supplementary groupcalled AP?

a) useradd -g AP_users lsmith

b) useradd -G AP_users lsmith

c) adduser lsmith AP_users

d) usermod -G AP_users lsmith

5. Which command can be used to change the password ofthe user lsmith to papa and set the maximum password lifetime to 90days?

a) changepwd -n 90 lsmith papa

b) usermod –changepwd -x 90 papa lsmith

c) passwd -x 90 lsmith

d) userdel -n 90 lsmith

6.Which of the following statements best describes thedifferences between the /etc/passwd and /etc/shadowfiles?

a. All users can read the /etc/passwd file; only the root useris allowed to read the /etc/shadow file.

b. All users can read the /etc/shadow file; only the root useris allowed to read the /etc/passwd file.

c. All users can read both the /etc/shadow and /etc/passwdfiles.

d. The immutable flag is set by default on /etc/shadow; untilyou remove this flag, no user can read this file.

Expert Answer


Answer to 1. Which of the following commands will remove lsmith’s home space and user account? a) usermod –del lsmith b) userdel … . . .

[Solved]1 Following Compile Public Abstract Class Class2 Public Abstract Void Action Int X Public Q37295269

1. Which of the following will compile? 「 public abstract class Class2 { public abstract void action (int x); public class Cl

1. Which of the following will compile? 「 public abstract class Class2 { public abstract void action (int x); public class Class3 extends Class2 public void action (int x) i System.out printin (x) Γ public abstract class Class2 { public abstract void action (int x); public abstract class Class3 extends Class2 「 public abstract class Class2 { public abstract void action (int x); public class Class3 extends Class2 QUESTION 2 Why did you choose the answer you did in Question 7? Explain your thinking as clearly as possible. (Remember,you are being graded on your explanation, and I will use your explanations to help determine where we need to work more on concepts.) Do not refer to your answer by letter or order, as the answers appear in random order each time the quiz is taken. 1. Show transcribed image text 1. Which of the following will compile? 「 public abstract class Class2 { public abstract void action (int x); public class Class3 extends Class2 public void action (int x) i System.out printin (x) Γ public abstract class Class2 { public abstract void action (int x); public abstract class Class3 extends Class2 「 public abstract class Class2 { public abstract void action (int x); public class Class3 extends Class2 QUESTION 2 Why did you choose the answer you did in Question 7? Explain your thinking as clearly as possible. (Remember,you are being graded on your explanation, and I will use your explanations to help determine where we need to work more on concepts.) Do not refer to your answer by letter or order, as the answers appear in random order each time the quiz is taken. 1.

Expert Answer


Answer to 1. Which of the following will compile? 「 public abstract class Class2 { public abstract void action (int x); public c… . . .

[Solved]1 Following Correct Code Snippet Throwing Pair 12 Sided Dice Get Sum Numbers Two Dice 2 24 Q37206280

1.Which of the following is the correct code snippet forthrowing a pair of 12-sided dice to get a sum of the numbers on twodice between 2 and 24 with different probabilities

2 * (rand() % 11 + 2)

rand() % 23 + 2

(rand() % 12) + (rand() % 12)

(rand() % 12 + 1) + (rand() % 12 + 1)

2.What would be the correct replacement for the following if ()statement ?

if (0 > temperature > 212)

It is correct, no need to replace the statement.

if (0 > temperature && temperature > 212)

if (0 > temperature || temperature > 212)

if (0 > temperature and temperature > 212)

3.What, if anything, is syntactically wrong with the followingfunction definition?

int sign(int x) { if (x < 0) return -1; else if (x > 0) return 1; }

It should have a double argument, not an int.

If x == 0, neither return statement is executed.

The if() statement needs braces {}.

The code has no syntax errors.

4.What is calculated by the code snippet?

int n = 0;int x;while (cin >> x){ if (x > n) { n = x; }}

The average of the input values

The number of input values

The minimum value of all input values

The maximum value of all input values

Expert Answer


Answer to 1.Which of the following is the correct code snippet for throwing a pair of 12-sided dice to get a sum of the numbers on… . . .