约瑟夫问题的一种描述为:编号为1,2,…,m的m个人按顺时针方向围坐一圈,每个人持有一个密码(正整数)。一开始任选一个正整数作为报数的上限值n。从第一个人开始按顺时针方向自1开始顺序报数,报到n时停止报数。报n的人出列,将他的密码作为新的n值,从他在顺序方向上的下一个人开始重新从1开始报数,如此下去,直到所有的人都出列。
标签:
上传时间: 2015-11-06
上传用户:sdq_123
脱机手写体识别Matlab源程序 包括特征提取、bayes分类器、K近邻分类及最近邻分类。 TestScriptRecognition.m:测试代码 ScriptFeaExtract.m :特征提取 KNearestEstimate.m :K近邻估计 NearestEstimate.m : 最近邻估计 BayesTrain.m :训练bayes分类器 Bayes.m :测试bayes分类器 CrossValidate.m :m交叉验证
标签: TestScriptRecognition ScriptFeaExtract Matlab bayes
上传时间: 2014-01-08
上传用户:王庆才
一:需求分析 1. 问题描述 魔王总是使用自己的一种非常精练而抽象的语言讲话,没人能听懂,但他的语言是可逐步解释成人能听懂的语言,因为他的语言是由以下两种形式的规则由人的语言逐步抽象上去的: ----------------------------------------------------------- (1) a---> (B1)(B2)....(Bm) (2)[(op1)(p2)...(pn)]---->[o(pn)][o(p(n-1))].....[o(p1)o] ----------------------------------------------------------- 在这两种形式中,从左到右均表示解释.试写一个魔王语言的解释系统,把 他的话解释成人能听得懂的话. 2. 基本要求: 用下述两条具体规则和上述规则形式(2)实现.设大写字母表示魔王语言的词汇 小写字母表示人的语言的词汇 希腊字母表示可以用大写字母或小写字母代换的变量.魔王语言可含人的词汇. (1) B --> tAdA (2) A --> sae 3. 测试数据: B(ehnxgz)B 解释成 tsaedsaeezegexenehetsaedsae若将小写字母与汉字建立下表所示的对应关系,则魔王说的话是:"天上一只鹅地上一只鹅鹅追鹅赶鹅下鹅蛋鹅恨鹅天上一只鹅地上一只鹅". | t | d | s | a | e | z | g | x | n | h | | 天 | 地 | 上 | 一只| 鹅 | 追 | 赶 | 下 | 蛋 | 恨 |
上传时间: 2014-12-02
上传用户:jkhjkh1982
这是一个ACM中的题请大家看以下哈 如果有问题请多多指教 n个猴子围坐一圈并按照顺时针方向从1到n编号,从第s个猴子开始进行1到m的报数,报数到第m的猴子 退出报数,从紧挨它的下一个猴子重新开始1到m的报数,如此进行下去知道所有的猴子都退出为止。 求给出这n个猴子的退出的顺序表。 Input 有做组测试数据.每一组数据有两行,第一行输入n(表示猴子的总数)第二行输入数据s(从第s 个猴子开 始报数)和数据m(第m个猴子退出报数).当输入0 0 0时表示程序结束. Output 输出中,每组数据的输出结果为一行,中间用逗号间隔。
上传时间: 2014-01-01
上传用户:脚趾头
文件多自由度.m为单独的文件,单独执行即可,可以得到一个3自由度的系统受到脉冲作用的结果。 文control.m,plotresult.m,duoziyoudu.mdl为一个完整的程序,先执行control.m,而后执行duoziyoudu.mdl文件,最后plotresult.m文件画出结果。使用的是kobe地震波.
标签: 自由度
上传时间: 2016-01-05
上传用户:thinode
We have a group of N items (represented by integers from 1 to N), and we know that there is some total order defined for these items. You may assume that no two elements will be equal (for all a, b: a<b or b<a). However, it is expensive to compare two items. Your task is to make a number of comparisons, and then output the sorted order. The cost of determining if a < b is given by the bth integer of element a of costs (space delimited), which is the same as the ath integer of element b. Naturally, you will be judged on the total cost of the comparisons you make before outputting the sorted order. If your order is incorrect, you will receive a 0. Otherwise, your score will be opt/cost, where opt is the best cost anyone has achieved and cost is the total cost of the comparisons you make (so your score for a test case will be between 0 and 1). Your score for the problem will simply be the sum of your scores for the individual test cases.
标签: represented integers group items
上传时间: 2016-01-17
上传用户:jeffery
1) Write a function reverse(A) which takes a matrix A of arbitrary dimensions as input and returns a matrix B consisting of the columns of A in reverse order. Thus for example, if A = 1 2 3 then B = 3 2 1 4 5 6 6 5 4 7 8 9 9 8 7 Write a main program to call reverse(A) for the matrix A = magic(5). Print to the screen both A and reverse(A). 2) Write a program which accepts an input k from the keyboard, and which prints out the smallest fibonacci number that is at least as large as k. The program should also print out its position in the fibonacci sequence. Here is a sample of input and output: Enter k>0: 100 144 is the smallest fibonacci number greater than or equal to 100. It is the 12th fibonacci number.
标签: dimensions arbitrary function reverse
上传时间: 2016-04-16
上传用户:waitingfy
1.用随机数方法产生页面走向,页面走向长度为L(15<=L<=20),L由控制台输入。 2.根据页面走向,分别采用Optinal、FIFO、LRU算法进行页面置换,统计缺页率。 3.假定可用内存块为m(3<=m<=5),m由控制台输入,初始时,作业页面都不在内存。
上传时间: 2017-01-21
上传用户:teddysha
模糊pid仿真,先运行模糊推理系统设计程序a.m,并调入内存,然后运行模糊控制程序b.m,对pid控制参数进行整定。
上传时间: 2013-12-23
上传用户:yzy6007
跳频通信中模式相加的原代码(配合Mmod.m,reMmod.m,U.m)一起使用。(附MATLAB库函数说明)
上传时间: 2017-07-16
上传用户:wlcaption