Loading [MathJax]/jax/element/mml/optable/BasicLatin.js

Boostable

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
  116 随笔 :: 0 文章 :: 28 评论 :: 92165 阅读

02 2014 档案

摘要:1021. Deepest Root (25)A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a root is called the deepest root. Input Specification: Each input file contains one 阅读全文
posted @ 2014-02-28 21:55 Boostable 阅读(399) 评论(0) 推荐(0) 编辑

摘要:Kernel Principal Components Analysis PCA实际上就是对原坐标进行正交变换,使得变换后的坐标之间相互无关,并且尽可能保留多的信息。但PCA所做的是线性变换,对于某些数据可能需要通过非线性变换,比如在二维空间下对如下数据进行处理。如果还是采用最初的PCA,则得到的主成分是z1,z2,而这里的z1,z2都包含了大量的信息,故无法去掉任何一个坐标,也就达不到降维的目的。而此时如果采用极坐标变换(属于非线性变换),我们就可以尽用一条坐标包含大量的信息(每一数据点都可以用不同的角度来表示)。 故而我们引入Kernel PCA,将原空间通过映射,投影到特 阅读全文
posted @ 2014-02-25 20:34 Boostable 阅读(879) 评论(0) 推荐(1) 编辑

摘要:1020. Tree Traversals (25)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order traversal sequence of the corresponding binary tree. Input Specification: Each input file contains one 阅读全文
posted @ 2014-02-24 21:45 Boostable 阅读(270) 评论(0) 推荐(0) 编辑

摘要:1019. General Palindromic Number (20)A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All single digit numbers are palindromic numbers.Although palindromic numbers are most often considered in the 阅读全文
posted @ 2014-02-24 20:21 Boostable 阅读(215) 评论(0) 推荐(0) 编辑

摘要:1018. Public Bike Management (30)There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and return it to any other stations in the city.The Public Bike Management Center (PBMC) keeps monitoring the 阅读全文
posted @ 2014-02-24 19:54 Boostable 阅读(481) 评论(0) 推荐(0) 编辑

摘要:Principal Components Analysis (一)引入PCA 当我们对某个系统或指标进行研究时往往会发现,影响这些系统和指标的因素或变量的数量非常的多。多变量无疑会为科学研究带来丰富的信息,但也会在一定程度上增加工作的难度,而通常变量之间又具有一定的相关性,这又增加了问题分析的复杂度。如果分别分析每个变量,那么分析又不够综合,而盲目的减少变量又会损失很多有用的信息。因而我们自然而然想到能否用较少的新变量去代替原来较多的旧变量(即降维),同时使这些新变量又能够尽可能保留原来旧变量所反映的信息,另外又能保证这些新变量之间是相互无关的。 而PCA就是在这样的一个背景下用于解决上述问题 阅读全文
posted @ 2014-02-23 18:23 Boostable 阅读(820) 评论(0) 推荐(0) 编辑

摘要:1017. Queueing at Bank (25)Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow line, until it is his/her turn to be served and there is a window available 阅读全文
posted @ 2014-02-22 22:09 Boostable 阅读(367) 评论(0) 推荐(0) 编辑

摘要:1016. Phone Bills (25) A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amount per minute, depending on the time of day when the call is made. When a customer starts connecting a long-distance call, the tim... 阅读全文
posted @ 2014-02-21 21:49 Boostable 阅读(401) 评论(0) 推荐(0) 编辑

摘要:1015. Reversible Primes (20) A reversible prime in any number system is a prime whose "reverse" in that number system is also a prime. For example in the decimal system 73 is a reversible prime because its reverse 37 is also a prime. Now given any two positive integers N (#include... 阅读全文
posted @ 2014-02-20 22:15 Boostable 阅读(331) 评论(0) 推荐(0) 编辑

摘要:The Sequential Minimal Optimization Algorithm (SMO)本文主要介绍用于解决SVM对偶模型的算法,它于1998年由John Platt在论文“Sequential Minimal Optimization:A Fast Algorithm for Training Support Vector Machines”中提出的。这篇笔记还参考了某篇博客,但由于是一年前的事了,暂时没找到这篇博客,所以没有引用出来,希望该篇博客的主人见谅。(1)解决的问题。 SMO 算法解决的是 soft SVM 对偶问题。其模型为:\begin{align}\matho. 阅读全文
posted @ 2014-02-20 21:04 Boostable 阅读(983) 评论(0) 推荐(0) 编辑

摘要:Soft Margin SVM(1)Recall 之前分析到SVM的模型为:min 利用Lagrange乘子法转化为对偶问题:\begin{align}\mathop{\max}&\quad \theta(\alpha)=\sum_{i}\alpha_i-\frac{1}{2 阅读全文
posted @ 2014-02-19 21:21 Boostable 阅读(1389) 评论(0) 推荐(0) 编辑

摘要:1014. Waiting in Line (30) Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to wait in line are: The space inside the yellow line in front of each window is eno... 阅读全文
posted @ 2014-02-19 17:00 Boostable 阅读(364) 评论(0) 推荐(0) 编辑

摘要:The Solutions of Nonlinear Equation 本文主要介绍几种用于解非线性方程f(x)=0的一些方法。(1) Bisection Method. 算法:step 1: 初始化a,b(b>a),使f(a),f(b)异号。step 2: while (停止条件不满足) p=a+\frac{b-a}{2}; 若 f(p)f(a)a,g(b)0,\lambda, \lim_{n\to\infty}\frac{\tilde{p_{n+1}}-p}{(\tilde{p_n}-p)^\alpha}=\lambda由于Aitken's \De.. 阅读全文
posted @ 2014-02-19 13:43 Boostable 阅读(656) 评论(0) 推荐(0) 编辑

摘要:1013. Battle Over Cities (25) It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other highways to keep the rest of ... 阅读全文
posted @ 2014-02-14 18:47 Boostable 阅读(242) 评论(0) 推荐(0) 编辑

摘要:Kernels 我们首先来回顾kernel函数的定义:一个函数K(x,y)为kernel函数当且仅当对\forall g, \int K(x,y)g(x)g(y)dxdy\geq 0成立。另外,根据Mercer's theorem,存在一个映射\Phi使K(x,y)=\langle \Phi(x),\Phi(y)\rangle,并且对任意有限的点,kernel矩阵是半正定的。一、核函数的封闭性 Hadamard product:$$\mathbf{A}\circ\mathbf{B}=\left[\begin{array}&a_{11}b_{11}&a_{ 阅读全文
posted @ 2014-02-14 15:39 Boostable 阅读(356) 评论(0) 推荐(0) 编辑

摘要:Linear & Ridge Regression 对于n个数据\{(x_1,y_1),(x_2,y_2),\cdots,(x_n,y_n)\},x_i\in\mathbb{R}^d,y_i\in\mathbb{R}。我们采用以下矩阵来记上述数据:\begin{equation}\math... 阅读全文
posted @ 2014-02-14 12:11 Boostable 阅读(754) 评论(0) 推荐(0) 编辑

摘要:1012. The Best Rank (25) To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculus or Linear Algrbra), and E - English. At the mean time, we encourage students by emphasiz... 阅读全文
posted @ 2014-02-13 22:02 Boostable 阅读(204) 评论(0) 推荐(0) 编辑

摘要:1011. World Cup Betting (20) With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World Cup trophy in South Africa. Similarly, football betting fans were putting their mon... 阅读全文
posted @ 2014-02-13 20:10 Boostable 阅读(241) 评论(0) 推荐(0) 编辑

摘要:1010. Radix (25) Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is "yes", if 6 is a decimal number and 110 is a binary number. Now for any pair of positive integers N1 and N2, your task is to find the radix of one number wh... 阅读全文
posted @ 2014-02-13 12:43 Boostable 阅读(244) 评论(0) 推荐(0) 编辑

摘要:Jordan Lecture Note-3:梯度投影法 在这一节,我们介绍如何用梯度投影法来解如下的优化问题: \begin{align} \mathop{\min}&\quad f(x)\nonumber\\\mathop{s.t.}&\quad \mathbf{A}_1 x\leq b_1\no 阅读全文
posted @ 2014-02-12 16:28 Boostable 阅读(7141) 评论(0) 推荐(0) 编辑

摘要:1009. Product of Polynomials (25) This time, you are supposed to find A*B where A and B are two polynomials. Input Specification: Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N1 aN1 N2 aN2 ... NK aNK, ... 阅读全文
posted @ 2014-02-11 21:20 Boostable 阅读(309) 评论(0) 推荐(0) 编辑

摘要:1008. Elevator (20) The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 seconds to move the elevator up one floor, and 4 seconds to move d... 阅读全文
posted @ 2014-02-11 18:24 Boostable 阅读(177) 评论(0) 推荐(0) 编辑

摘要:Maximal Margin Classifier Logistic Regression 与 SVM 思路的不同点:logistic regression强调所有点尽可能远离中间的那条分割线,而SVM则强调最靠近分割线的点于分割线的距离仅可能的远。定义间隔函数:\hat{r}^{(i)}=y^{(i)}(w^\prime x^{(i)}+b)。当y^{(i)}=1时,w^\prime x^{(i)}+b>0;当y^{(i)}=-1时,w^\prime x^{(i)}+b0。 注意,同时扩大w,b,那么所有点的间隔都会扩大相同倍数,这并不影响问题的求解。定义样本的 阅读全文
posted @ 2014-02-11 17:11 Boostable 阅读(804) 评论(0) 推荐(0) 编辑

摘要:1007. Maximum Subsequence Sum (25) Given a sequence of K integers { N1, N2, ..., NK }. A continuous subsequence is defined to be { Ni, Ni+1, ..., Nj } where 1 23intmain()4{5intK;6intdata[10000];7inti;8intflag;9while(scanf("%d",&K)!=EOF){10flag=0;11for(i=0;i=0)14flag=1;15}16if(flag==0). 阅读全文
posted @ 2014-02-10 22:07 Boostable 阅读(220) 评论(0) 推荐(0) 编辑

摘要:1006. Sign In and Sign Out (25) At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the records of signing in's and out's, you are supposed to find the ones who have unlocked a... 阅读全文
posted @ 2014-02-10 21:17 Boostable 阅读(337) 评论(0) 推荐(0) 编辑

摘要:1005. Spell It Right (20) Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English. Input Specification: Each input file contains one test case. Each case occupies one line which contains an N (2#include3... 阅读全文
posted @ 2014-02-10 15:33 Boostable 阅读(154) 评论(0) 推荐(0) 编辑

摘要:1004. Counting Leaves (30) A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Each input file contains one test case. Each case starts with a line containing 0 2#include34intmain()5{6intN,M;7intTree[100][10... 阅读全文
posted @ 2014-02-10 15:07 Boostable 阅读(186) 评论(0) 推荐(0) 编辑

摘要:Jordan Lecture Note-1: Introduction 第一部分要整理的是Jordan的讲义,这份讲义是我刚进实验室时我们老师给我的第一个任务,要求我把讲义上的知识扩充出去,然后每周都要讲给他听。如果有需要这份讲义的话,请留言,我会用邮件发给你。 首先,我来说说机器学习这个东西。刚进实验室,我根本连什么是机器学习都不知道,听到这个名词后的第一反应是机器人,心想估计是搞硬件的。后来才发现其实机器学习更偏向于后面两个字,也就是“学习”。打个不恰当的比方吧,人类在婴儿时期,还无法对世上的东西进行识别,比如小汽车跟货车有什么区别?这时,婴儿的父母就会指着小汽车对他说,这是个小汽车... 阅读全文
posted @ 2014-02-09 21:36 Boostable 阅读(654) 评论(5) 推荐(0) 编辑

摘要:1003. Emergency (25) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams in each city and the length of each road between any pair of cities are marked on ... 阅读全文
posted @ 2014-02-09 20:23 Boostable 阅读(234) 评论(0) 推荐(0) 编辑

摘要:1002. A+B for Polynomials (25) This time, you are supposed to find A+B where A and B are two polynomials. Input Each input file contains one test case. Each case occupies 2 lines, and each line contains the information of a polynomial: K N1 aN1 N2 aN2 ... NK aNK, where K is the numbe... 阅读全文
posted @ 2014-02-07 23:15 Boostable 阅读(190) 评论(0) 推荐(0) 编辑

摘要:Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits). Input Each input file contains one test case. Each case contains a pair of integers a and b where -1000000 2intmain()3{4inta,b... 阅读全文
posted @ 2014-02-07 23:12 Boostable 阅读(238) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示