4.5.6 bài tập cho phần 4.5
tập thể dục 4.5.1: tính toán sự ngạc nhiên số (thời điểm thứ hai) cho dòng 3, 1, 4, 1, 3, 4, 2, 1, 2. Thời điểm thứ ba của dòng này là gì?
A chung Stream-mẫu vấn đề
thông báo rằng các kỹ thuật được mô tả trong phần 4.5.5 thực sự giải quyết một vấn đề tổng quát hơn. Nó mang lại cho chúng tôi một cách để duy trì một mẫu s stream yếu tố vì vậy mà tại mọi thời điểm, Tất cả các yếu tố stream được bình đẳng với khả năng để bạn lựa chọn cho mẫu. Như là một ví dụ về nơi kỹ thuật này có thể hữu ích, nhớ lại rằng trong phần phần 4.2, chúng tôi sắp xếp để chọn tất cả các tuples một luồng có giá trị quan trọng trong một tập hợp con lựa chọn ngẫu nhiên. Giả sử rằng, như thời gian đi, không có quá nhiều tuples liên kết với bất kỳ quan trọng. Chúng tôi có thể sắp xếp để giới hạn số lượng tuples đối với bất kỳ phím K cho một fixed hằng số s bằng cách sử dụng các kỹ thuật của phần 4.5.5 bất cứ khi nào một tuple mới cho khóa K đến.
! Tập thể dục 4.5.2: Nếu một dòng có n phần tử, trong đó m là khác biệt, số lượng tối thiểu và tối đa có thể bất ngờ, như một chức năng của m và n là gì?
tập thể dục 4.5.3: giả sử chúng tôi có được dòng tập thể dục 4.5.1, mà chúng tôi áp dụng các thuật toán Alon-Matias-Szegedy để ước tính số bất ngờ. Đối với mỗi giá trị có thể của tôi, nếu Xi là một bắt đầu thay đổi vị trí của tôi, những gì là giá trị của Xi.value?
Exercise 4.5.4: lặp lại tập thể dục 4.5.3 nếu mục đích của các biến là com-pute những khoảnh khắc thứ ba. Giá trị của mỗi biến vào giữa là gì? Ước tính của thời điểm này thứ ba nào bạn nhận được từ mỗi biến? Làm thế nào là ước tính những so sánh với giá trị thực sự của thời điểm thứ ba?
tập thể dục 4.5.5: chứng minh bằng quy nạp trên m đó 5 3 1 ··· (2m−1) = m2.
tập thể dục 4.5.6: nếu chúng tôi muốn tính toán thứ tư khoảnh khắc, làm thế nào chúng tôi chuyển đổi X.value để ước tính này thứ tư?
đang được dịch, vui lòng đợi..