100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Summary

Summary CS114 - 1.6 Case Study Random Web Surfer

Rating
-
Sold
-
Pages
3
Uploaded on
23-06-2021
Written in
2021/2022

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 uploaded soon.

Show more Read less








Whoops! We can’t load your doc right now. Try again or contact support.

Document information

Summarized whole book?
No
Which chapters are summarized?
Chapter 1.6 (case study random web surfer)
Uploaded on
June 23, 2021
Number of pages
3
Written in
2021/2022
Type
Summary

Subjects

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

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
notesfromaCSmajor Stellenbosch University
View profile
Follow You need to be logged in order to follow users or courses
Sold
351
Member since
6 year
Number of followers
278
Documents
0
Last sold
1 month ago
Summaries for Grades 10 - 12 (various subjects)

I am an A-aggregate student, and making summaries is one of my favourite studying techniques. Stuvia gives me the opportunity to share my notes with other learners who may need them!

4,3

68 reviews

5
34
4
25
3
6
2
2
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can immediately select a different document that better matches what you need.

Pay how you prefer, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card or EFT and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions