{"title":"硬币称重算法的恢复时间复杂度","authors":"Hanxuan Wang","doi":"10.54254/2753-8818/30/20241106","DOIUrl":null,"url":null,"abstract":"Given n identical-looking coins each with possible weight in {0, 1}, and a scale that can measure the weight of any arbitrary set of coins, the coin weighing problem studies how to find out the weight of every coin with as few weighing as possible. The algorithm in Lindstrm takes O(n/logn) non-adaptive weighings to determine the coins, which gives an O(logn) factor improvement compared with the nave algorithm that measures each coin on its own. However, it is unclear that with the O(n/logn) queries, how long it takes to retrieve x. This paper is about establishing and further optimizing the nave recovery time complexity of Lindstrm s algorithm. The recovery time complexity here is defined as the time complexity to recover x given Dx under the RAM model, where D{0,1}^(mn),, each row being a weighing query, is the Lindstrm query matrix. The brute force recovery algorithm has running time O(m2n), whereas our algorithm only takes O(mn). Finally, we run experiments to verify our results with the actual running time of the algorithm on various size of inputs","PeriodicalId":489336,"journal":{"name":"Theoretical and Natural Science","volume":" 15","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-01-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"The recovery time complexity of a coin weighing algorithm\",\"authors\":\"Hanxuan Wang\",\"doi\":\"10.54254/2753-8818/30/20241106\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Given n identical-looking coins each with possible weight in {0, 1}, and a scale that can measure the weight of any arbitrary set of coins, the coin weighing problem studies how to find out the weight of every coin with as few weighing as possible. The algorithm in Lindstrm takes O(n/logn) non-adaptive weighings to determine the coins, which gives an O(logn) factor improvement compared with the nave algorithm that measures each coin on its own. However, it is unclear that with the O(n/logn) queries, how long it takes to retrieve x. This paper is about establishing and further optimizing the nave recovery time complexity of Lindstrm s algorithm. The recovery time complexity here is defined as the time complexity to recover x given Dx under the RAM model, where D{0,1}^(mn),, each row being a weighing query, is the Lindstrm query matrix. The brute force recovery algorithm has running time O(m2n), whereas our algorithm only takes O(mn). Finally, we run experiments to verify our results with the actual running time of the algorithm on various size of inputs\",\"PeriodicalId\":489336,\"journal\":{\"name\":\"Theoretical and Natural Science\",\"volume\":\" 15\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2024-01-15\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Theoretical and Natural Science\",\"FirstCategoryId\":\"0\",\"ListUrlMain\":\"https://doi.org/10.54254/2753-8818/30/20241106\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Theoretical and Natural Science","FirstCategoryId":"0","ListUrlMain":"https://doi.org/10.54254/2753-8818/30/20241106","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
The recovery time complexity of a coin weighing algorithm
Given n identical-looking coins each with possible weight in {0, 1}, and a scale that can measure the weight of any arbitrary set of coins, the coin weighing problem studies how to find out the weight of every coin with as few weighing as possible. The algorithm in Lindstrm takes O(n/logn) non-adaptive weighings to determine the coins, which gives an O(logn) factor improvement compared with the nave algorithm that measures each coin on its own. However, it is unclear that with the O(n/logn) queries, how long it takes to retrieve x. This paper is about establishing and further optimizing the nave recovery time complexity of Lindstrm s algorithm. The recovery time complexity here is defined as the time complexity to recover x given Dx under the RAM model, where D{0,1}^(mn),, each row being a weighing query, is the Lindstrm query matrix. The brute force recovery algorithm has running time O(m2n), whereas our algorithm only takes O(mn). Finally, we run experiments to verify our results with the actual running time of the algorithm on various size of inputs