R. Ben-Basat, Gil Einziger, R. Friedman, Yaron Kassner
{"title":"滑动窗口的高效求和","authors":"R. Ben-Basat, Gil Einziger, R. Friedman, Yaron Kassner","doi":"10.4230/LIPIcs.SWAT.2016","DOIUrl":null,"url":null,"abstract":"This paper considers the problem of maintaining statistic aggregates over the last W elements of a data stream. First, the problem of counting the number of 1's in the last W bits of a binary stream is considered. A lower bound of {\\Omega}(1/{\\epsilon} + log W) memory bits for W{\\epsilon}-additive approximations is derived. This is followed by an algorithm whose memory consumption is O(1/{\\epsilon} + log W) bits, indicating that the algorithm is optimal and that the bound is tight. Next, the more general problem of maintaining a sum of the last W integers, each in the range of {0,1,...,R}, is addressed. The paper shows that approximating the sum within an additive error of RW{\\epsilon} can also be done using {\\Theta}(1/{\\epsilon} + log W) bits for {\\epsilon}={\\Omega}(1/W). For {\\epsilon}=o(1/W), we present a succinct algorithm which uses B(1 + o(1)) bits, where B={\\Theta}(Wlog(1/W{\\epsilon})) is the derived lower bound. We show that all lower bounds generalize to randomized algorithms as well. All algorithms process new elements and answer queries in O(1) worst-case time.","PeriodicalId":447445,"journal":{"name":"Scandinavian Workshop on Algorithm Theory","volume":"38 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"14","resultStr":"{\"title\":\"Efficient Summing over Sliding Windows\",\"authors\":\"R. Ben-Basat, Gil Einziger, R. Friedman, Yaron Kassner\",\"doi\":\"10.4230/LIPIcs.SWAT.2016\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"This paper considers the problem of maintaining statistic aggregates over the last W elements of a data stream. First, the problem of counting the number of 1's in the last W bits of a binary stream is considered. A lower bound of {\\\\Omega}(1/{\\\\epsilon} + log W) memory bits for W{\\\\epsilon}-additive approximations is derived. This is followed by an algorithm whose memory consumption is O(1/{\\\\epsilon} + log W) bits, indicating that the algorithm is optimal and that the bound is tight. Next, the more general problem of maintaining a sum of the last W integers, each in the range of {0,1,...,R}, is addressed. The paper shows that approximating the sum within an additive error of RW{\\\\epsilon} can also be done using {\\\\Theta}(1/{\\\\epsilon} + log W) bits for {\\\\epsilon}={\\\\Omega}(1/W). For {\\\\epsilon}=o(1/W), we present a succinct algorithm which uses B(1 + o(1)) bits, where B={\\\\Theta}(Wlog(1/W{\\\\epsilon})) is the derived lower bound. We show that all lower bounds generalize to randomized algorithms as well. All algorithms process new elements and answer queries in O(1) worst-case time.\",\"PeriodicalId\":447445,\"journal\":{\"name\":\"Scandinavian Workshop on Algorithm Theory\",\"volume\":\"38 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2016-04-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"14\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Scandinavian Workshop on Algorithm Theory\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.4230/LIPIcs.SWAT.2016\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Scandinavian Workshop on Algorithm Theory","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.4230/LIPIcs.SWAT.2016","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
This paper considers the problem of maintaining statistic aggregates over the last W elements of a data stream. First, the problem of counting the number of 1's in the last W bits of a binary stream is considered. A lower bound of {\Omega}(1/{\epsilon} + log W) memory bits for W{\epsilon}-additive approximations is derived. This is followed by an algorithm whose memory consumption is O(1/{\epsilon} + log W) bits, indicating that the algorithm is optimal and that the bound is tight. Next, the more general problem of maintaining a sum of the last W integers, each in the range of {0,1,...,R}, is addressed. The paper shows that approximating the sum within an additive error of RW{\epsilon} can also be done using {\Theta}(1/{\epsilon} + log W) bits for {\epsilon}={\Omega}(1/W). For {\epsilon}=o(1/W), we present a succinct algorithm which uses B(1 + o(1)) bits, where B={\Theta}(Wlog(1/W{\epsilon})) is the derived lower bound. We show that all lower bounds generalize to randomized algorithms as well. All algorithms process new elements and answer queries in O(1) worst-case time.