Summaries from the "Introduction to Programming in Java" textbook to assist in quick studying and revision for tests and exams. Be sure to look at the bundles to buy several chapters at a much lower price. Please note these notes only include summaries for Chapter 1.6 and further summaries will be ...
Chapter 1.6 (case study random web surfer)
June 23, 2021
3
2021/2022
Summary
Subjects
computer science
114
cs114
rw114
coding
software engineering
chapter
random web surfer
case study
pdf
stellenbosch
university
study
a2
exam
16
notes
summary
Connected book
Book Title:
Author(s):
Edition:
ISBN:
Edition:
More summaries for
Programming in Java
CS114 - 2.2 Libraries and Clients
CS114 - 2.1 Defining Functions
All for this textbook (4)
Written for
Stellenbosch University (SUN)
Computer Science 114 (CS114)
All documents for this subject (5)
Seller
Follow
notesfromaCSmajor
Reviews received
Content preview
Input format
• Needed to structure the info in input files
• Assume there are n web pages numbered from 0 to n-1 90-10 rule
• Assume 90% of the time the
o Represent links with ordered pairs of these numbers random surfer clicks a random
1. Page containing the link link on the current page (each
2. Page to which it refers with = probability)
• Input format = input stream of integer (n) + sequence of pairs of integers • 10% of the time the random
surfer goes directly to a
• StdIn → treats all sequences of whitespace characters as a single delimiter
random page (all pages on web
o Can put one link per line or several links in one line have = probability)
Transition matrix
• 2D matrix to specify behaviour of random
surfer
o n web pages
o n-by-n matrix
▪ Value in row i & column j =
probability that random surfer
moves to page j when on page i
• Write code that can create this matrix for any
given input
o Read n & create arrays counts[][] and
outDegrees[]
o Read links & build counts so counts[i][j]
counts the links from I to j &
outDegrees[i] counts the links from i to
anywhere
o Use 90-10 rule to compute the
probabilities
• Program 1.6.1: filter that reads a graph from
standard input & prints associated transition
matrix to standard output
• Significant because each row represents a
discrete probability distribution (elements fully
specify behaviour of surfing to each page)
• Output defines file format for matrices
(numbers of rows & cols + values of matrix
elements in row-major order)
1
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller notesfromaCSmajor. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $2.84. You're not tied to anything after your purchase.