摘要: 母函数分为:普通型母函数,指数型母函数。普通型母函数主要是来求组合的方案数,而指数型母函数是求多重排列数。关于普通型母函数的讲解,以前写过:http://www.cnblogs.com/hsqdboke/archive/2012/04/17/2453677.html指数型母函数主要是关于排列组合方面的问题。分别看两个比较典型的问题对比:普通母函数问题:有红球两个,白球、黄球各一个,试求有多少种不同的组合方案。指数型母函数问题:假设有8个元素,其中a1重复3次,a2重复2次,a3重复3次。从中取r个组合,求其排列数。下面是指数型母函数的定义:对于上面的问题“假设有8个元素,其中a1重复3次,a2 阅读全文
posted @ 2012-04-17 20:58 龙杉老师 阅读(3112) 评论(0) 推荐(0)
摘要: Ignatius and the Princess IIIProblem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says."The second problem is, given an positive integer N, we define an equation like this:N=a[1]+a[2]+a[3]+...+a[m];a[i]>0,1<=m 阅读全文
posted @ 2012-04-17 20:08 龙杉老师 阅读(178) 评论(0) 推荐(0)
摘要: 母函数详解在数学中,某个序列的母函数(Generating function,又称生成函数)是一种形式幂级数,其每一项的系数可以提供关于这个序列的信息。使用母函数解决问题的方法称为母函数方法。母函数可分为很多种,包括普通母函数、指数母函数、L级数、贝尔级数和狄利克雷级数。对每个序列都可以写出以上每个类型的一个母函数。构造母函数的目的一般是为了解决某个特定的问题,因此选用何种母函数视乎序列本身的特性和问题的类型。这里先给出两句话,不懂的可以等看完这篇文章再回过头来看:1.“把组合问题的加法法则和幂级数的乘幂对应起来”2.“母函数的思想很简单 — 就... 阅读全文
posted @ 2012-04-17 15:04 龙杉老师 阅读(3471) 评论(0) 推荐(0)
摘要: ^^^转载请注明出处,谢谢合作O(∩_∩)O~Be the WinnerLet's consider m apples divided into n groups. Each group contains no more than 100 apples, arranged in a line. You can take any number of consecutive apples at one time.For example "@@@" can be turned into "@@" or "@" or "@ 阅读全文
posted @ 2012-04-17 08:53 龙杉老师 阅读(607) 评论(0) 推荐(0)
摘要: ^^^转载请注明出处,谢谢合作O(∩_∩)O~JohnProblem DescriptionLittle John is playing very funny game with his younger brother. There is one big box filled with M&Ms of different colors. At first John has to eat several M&Ms of the same color. Then his opponent has to make a turn. And so on. Please note that 阅读全文
posted @ 2012-04-17 00:13 龙杉老师 阅读(345) 评论(0) 推荐(0)