检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
作 者:黄绍龙[1] HUANG Shaolong(College of Mathematics and Science,Luoyang Normal University,Luoyang,Henan 471934,China)
机构地区:[1]洛阳师范学院数学科学学院,河南洛阳471934
出 处:《计算机应用文摘》2023年第24期87-89,共3页Chinese Journal of Computer Application
摘 要:文章主要利用Python语言讨论解决n-2型Josephus问题。首先,通过计算机模拟求解,其次分析问题的实质,得到递推关系并通过递归函数求解,再次,以n的取值为2的次幂为分界点进行分组,观察解的模式来猜测解的解析式。通过数学归纳法证明了猜测的正确性,最终得出解可以通过循环左移1位获取。通过深入浅出地对n-2型Josephus问题进行分析和求解,有助于提高在数学问题思考方面的能力和水平。The article mainly uses Python language to discuss and solve the n-2 type Josephus problem.Firstly,the solution is solved through computer simulation.Secondly,the essence of the problem is analyzed to obtain a recursive relationship and solved through a recursive function.Thirdly,the solution is grouped using the power of n to the power of 2 as the boundary point,and the pattern of the solution is observed to guess the analytical formula of the solution.The correctness of the conjecture was proven through mathematical induction,and the final solution can be obtained by cyclically shifting one position to the left.Analyzing and solving the n-2 type Josephus problem in a simple and easy manner can help improve one's ability and level of thinking in mathematical problems.
分 类 号:TP311[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:18.218.110.116