Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 2 0 points ) Let A [ 1 . . n ] be an array that stores a random permutation of 1 , 2

(20 points) Let A[1..n] be an array that stores a random permutation of
1,2,dots,n, where n=m2 for some positive integer m. Let M[1..m,1..m]
be a 2D array such that M[i,j]=A[(i-1)m+j] for i,jin[1,m].
The neighbors of an entry A[i] are defined as follows. If i=1, then A[2]
is the neighbor of A[1]. If i=n, then A[n-1] is the neighbor of A[n].
Otherwise, the neighbors of A[i] are A[i-1] and A[i+1].
Similarly, for i,jin[1,m], the neighbors of M[i,j] consist of M[a,b] such
that (a,b)in{(i-1,j),(i+1,j),(i,j-1),(i,j+1)}{(i,j):i,jin[1,m]}.
(a)(10 points) For any iin[1,n],A[i] is a local minimum if it is smaller
than all of its neighbors. For any i,jin[1,m],M[i,j] is a local
minimum if it is smaller than all of its neighbors. Derive the expected
number of local minima in A and M. Give the exact formulas; do not
use asymptotic notation. Show your steps.
Hint: Introduce indicator random variables for each A[i] and M[i,j].
(b)(10 points) For any iin[2,n-1], if A[i] is smaller than one neighbour
and greater than the other neighbor, then A[i] is a saddle point. For
any i,jin[2,m-1],M[i,j] is a saddle point if is smaller than both
of its neighbors in the same row and larger than both of its neighbors
in the same column. Derive the expected number of saddle points in
A and M. Give the exact formulas; do not use asymptotic notation.
Show your steps.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago