In: Computer Science
Telephone is a classic kids game where the first person in line is told a message. That person whispers the word to the one next to them, and so on. The last person in line then announces the message as they understand it.
Describe this game as a networking protocol in terms of the OSI model. Be specific, and include whatever layers you see as important.
How could you change the protocol (and ruin the game) to ensure that the message reached the destination unaltered? Again, answer this in terms of the OSI layers.
In: Computer Science
Assume that the program counter (PC) is set to 0x00000000. Describe how each of the instructions below could be used to set the next value of PC to 0x0FFFFFF4
j, jr, bne, jal, beq
In: Computer Science
Python Please
Simulating a random walk in two dimensions.
For this part, you will use a two-dimensional grid where the x axis goes from -50 to +50 and the y axis also goes from -50 to +50. The particle will start at the middle of the left edge (x, y) = (−50,0), and we’ll put the outlet/absorber in the middle of the right edge (x, y) = (+50,0). Again, the particle will diffuse around randomly between these points and when the absorbing point at (x, y) = (+50,0) is reached, the simulation ends. At each time step, the particle can move one step on the grid and your simulation will update the particle’s x and y positions accordingly. Here are the rules for the random walk:
At each time step:
1. If the particle is not at an edge, it can take a step of one grid spacing in any of four directions: ±x, ±y; these should all be equally probable.
2. If the particle is at one of the edges, but not at the absorber, it cannot pass out of the box. It should have a 50% probability of taking a step perpendicularly away from the wall, and a 25% chance of stepping in either of the directions along the wall.
3. If the particle is at a corner, it has a 50% chance of going in either of the two directions along the walls.
4. If the particle touches the absorbing point at (x, y) = (+50,0), the random walk ends.
Part 2. Simulate a single 2d random walk until absorption.
D. (20 pts) Write a program that executes one ‘walk’ and calculates the number of steps the particle takes before being absorbed – the residence time of our two-dimensional lake for that tracer. You will be assessed on whether you have correctly implemented the walking rules above.
E. (10 pts) Make a plot of the trajectory taken by the particle (positions in x,y).
a. Label the x and y axes appropriately, and give the plot a title
b. Indicate the starting position with a black asterisk and the end position with a red asterisk.
F. (5 pts) Print the time (i.e. number of steps) it took for the particle to be absorbed.
In: Computer Science
Create a function called merge that takes two int vectors (x and y) as argument and returns an int vector (z) that is the result of merging the two vectors x and y. Here is an example to explain how the merge function works: If the vector x has the following values: 1 2 3 4 5, and the vector y has the following: 6 7 8 9 10 11 12, then the merging vector z will have: 1 6 2 7 3 8 4 9 5 10 11 12. This means: z[0] = x[0], z[1]=y[0], z[2]=x[1], z[3]=y[1], z[4]=x[2], z[5]=y[2],... If the size of the vector x is bigger than the size of the vector y, when x is entirely copied to z, the rest of x will be copied next. If y is bigger, the rest of y is copied when x is entirely copied to z.
Language: c++
In: Computer Science
Write a document comparing Android and iOS. In addition, feel free to research iOS design. In this document you will
In: Computer Science
Problem 44 Write a query to display the employee number, last name, first name, and sum of invoice totals for all employees who completed an invoice. Sort the output by employee last name and then by first name (Partial results shown in Figure P7.44).
In: Computer Science
How to create a divide function in (Dr Racket) programming language without using the built in function " / " ?
In: Computer Science
Write a pyhton program that reads a stream of bits, e.g. 11001, and calculates and prints the decimal value of the binary number represented by the entered bits, i.e. 25 in this case.
In: Computer Science
We know from Church's Theorem that L_1 is Turing-undecidable. And we now know from Olmsted's theorem that L_0 is Turing-decidable. AI of today, and specifically AI as it relates to the Web, particularly the Semantic Web, is often connected to formal logics "between" L_0 and L_1. Let us define the logic L_1^cdot as first-order logic but with no function symbols allowed, and having relation symbols that are all unary. Your question is: Is theoremhood for L_1^cdot Turing-decidable, or does Church's Theorem apply?
In: Computer Science
Question 2: consider the following library relational database schema Write a program segment to retrieves the list of books that became overdue yesterday and that prints the book title and borrower name for each.
1- Use JDBC with Java as the host language
In: Computer Science
Write a python program that asks the user to enter a string containing numbers separated by commas, e.g., s = '1.23,2.4,3.123', Your program should then calculate and print the sum of the numbers entered. Hint: you need to iterate over the string searching for the commas, i.e. their index. The first number is obtained by slicing between the start of the string and the index of the first comma. The second number is between the last comma and the next one, and so on. For this program do not use the standard string functions.
In: Computer Science
1. A hard disk drive has 16 platters, 8192 cylinders, and 256 4KB sectors per track. The storage capacity of this disk drive is at most
Select one:
a. 32 GB.
b. 128 GB.
c. 32 TB.
2. To further optimize I/O performance, some SSD schedulers
Select one:
a. merge adjacent write requests but not adjacent read requests.
b. do not merge requests at all.
c. merge adjacent read requests but not adjacent write requests.
3. What steps are necessary to create a file?
Select one:
a. allocating a space in the file system
b. all of the other answers
c. making an entry for the file in the directory
d. none of the other answers
4.When the shared lock is applied to a file then ____________
Select one:
a. only one process can use this file
b. many processes can write to this file concurrently
c. several processes can acquire the lock concurrently
d. many processes can read and write to this file concurrently
5. close() operation _____ an open count associated with a given file.
Select one:
a. decreases
b. increases
c. does not change
d. resets
In: Computer Science
Python Code for 8-queens using random restart algorithms
In: Computer Science
Choose one of the three following programs to do as your first program. You need to turn in a flowchart and program documentation with the .cpp program (this can be done within the program) and a copy of your output.
The Program I chose is :
#19. Monthly Payments
The monthly payment on a loan may be calculated by the following formula:
Payment= Rate × (1+Rate)N (1+Rate)N−1×L
Rate is the monthly interest rate, which is the annual interest rate divided by 12. (12 percent annual interest would be 1 percent monthly interest.) N is the number of payments, and L is the amount of the loan. Write a program that asks for these values then displays a report similar to:
Loan Amount:$10000.00
Monthly Interest Rate: 1%
Number of Payments: 36
Monthly Payment:$ 332.14
Amount Paid Back:$ 11957.15
Interest Paid:$ 1957.15
In: Computer Science