f********x 发帖数: 99 | 1 The world beyond batch: Streaming 101: A high-level tour of modern data-
processing concept
http://radar.oreilly.com/2015/08/the-world-beyond-batch-streami
by Tyler Akidau August 5, 2015
Editor’s note: This is the first post in a two-part series about the
evolution of data processing, with a focus on streaming systems, unbounded
data sets, and the future of big data.
Streaming data processing is a big deal in big data these days, and for good
reasons. Amongst them:
Businesses crave ever more tim... 阅读全帖 |
|
X*******t 发帖数: 149 | 2 1024 raised to power 202 modulo 2011
512 raised to power 225 modulo 2027
另外一个:
You are given a sequence of n numbers from {0,...,p-1}. Can you insert
operators + and * between the numbers that the expression evaluates to 0
modulo p? We use the usual convention for evaluating expressions: * has
precedence over + (thus for example 1+2*3 evaluates to 7). Describe an O(np2
) algorithm for the problem (assume, for simplicity, that arithmetic
operations on numbers from {0,...,p-1}take O(1) time).
多谢各位... 阅读全帖 |
|
p*****2 发帖数: 21240 | 3
Some engineers got tired of dealing with all the different ways of encoding
status messages, so they decided to invent their own. In their new scheme,
an encoded status message consists of a sequence of integers representing
the characters in the message, separated by spaces. Each integer is between
1 and M, inclusive. The integers do not have leading zeroes. Unfortunately
they decided to compress the encoded status messages by removing all the
spaces!
Your task is to figure out how many differ... 阅读全帖 |
|
p*****2 发帖数: 21240 | 4
Some engineers got tired of dealing with all the different ways of encoding
status messages, so they decided to invent their own. In their new scheme,
an encoded status message consists of a sequence of integers representing
the characters in the message, separated by spaces. Each integer is between
1 and M, inclusive. The integers do not have leading zeroes. Unfortunately
they decided to compress the encoded status messages by removing all the
spaces!
Your task is to figure out how many differ... 阅读全帖 |
|
w**z 发帖数: 8232 | 5 Master, 十年经验,竟然不知道啥是Modulo, 告诉我 7 % 2 = 5, 还要我解释给
他听什么是modulo, 数学还不如我儿子。 |
|
A*********t 发帖数: 64 | 6 先抛砖。求2^i3^j数列的前k项和(从小到大排序)对q取模的值。
k很大,可以到10^15,q可以到10^9。
O(k)都不行啊。请大虾指教。
Rocket Fuel
Challenges / Roulette Predictor The contest has ended. Rank: N/A Score: 0
.00
After defeating the guard in pinball using your program, you are released
and try to make your escape. You find a ship captain who is willing to sell
you passage home, but unfortunately you have only a little money with you
since your earnings from the irrigation project are stashed in hiding and
you don't have time to retrieve them... 阅读全帖 |
|
H******7 发帖数: 1728 | 7 Theoretical background
You need a Bijective Function f. This is necessary so that you can find a
inverse function g('abc') = 123 for your f(123) = 'abc' function. This means:
There must be no x1, x2 (with x1 ≠ x2) that will make f(x1) = f(x2),
and for every y you must be able to find an x so that f(x) = y.
How to convert the ID to a shortened URL
Think of an alphabet we want to use. In your case that's [a-zA-Z0-9]. It
contains 62 letters.
Take an auto-generated, unique numerical ... 阅读全帖 |
|
l**********r 发帖数: 4612 | 8 【 以下文字转载自 JobHunting 讨论区 】
发信人: wwzz (一辈子当码工), 信区: JobHunting
标 题: 刚面完一个三哥
发信站: BBS 未名空间站 (Wed Aug 28 18:57:46 2013, 美东)
Master, 十年经验,竟然不知道啥是Modulo, 告诉我 7 % 2 = 5, 还要我解释给
他听什么是modulo, 数学还不如我儿子。 |
|
d******s 发帖数: 180 | 9 http://aimath.org/news/primegaps70m/
第一段就很有料,四月后期投稿,五月中旬便接受,对于一篇55页的paper来说速度惊
人。
Zhang's Theorem on Bounded Gaps Between Primes
by Dan Goldston
In late April 2013 Yitang Zhang of the University of New Hampshire submitted
a paper to the Annals of Mathematics proving that there are infinitely many
pairs of primes that differ by less than 70 million. The proof of this
amazing result was verified with high confidence by several experts in the
field and accepted for publication. A public slightly re... 阅读全帖 |
|
D**o 发帖数: 2653 | 10 注意作者 \author{YHBKJ}
Atiyah-Bott Localization 1
2012-09-05 09:24:19
\documentclass[a4paper,12pt]{article}
\usepackage{amsfonts}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{CJK,graphicx}
\usepackage{amscd}
\usepackage{amssymb}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[section]
\newtheorem{definition}{Definition}[section]
\newtheorem{lemma}{Lemma}[section]
\begin{document}
\title{\textbf{\Huge{Atiyah-Bott Localization 1}}}\author{YHBKJ}\date{}\
maketitle
\begin{ab... 阅读全帖 |
|
x****6 发帖数: 4339 | 11 看题目,都是学术前沿的工作,屁挨着地水平的。
以马公和千老领域为主。
Picoscale Mechanics of Atomically Engineered Materials
Optical Control of Protein Assembly and Activity in Cell-Like-Compartments
Cell Membrane-Coated Nanodevice for Anti-Virulence Therapy Against
Antibiotic Resistant Bacteria
Artemisinin as a Potential Parkinson's Disease Treatment via Alleviation of
α-Synuclein Mediated Neuronal Damage and Inflammation
Exploring Posterior Growth in D. rerio Using a Live Cell Cycle Biosensor
Modeling the Spatio-Temporal Dynami... 阅读全帖 |
|
h**********c 发帖数: 4120 | 12 主要是用简化字研究历史,就象去modulos一样,
还是要在真正的原装典籍,文物中寻找答案。 |
|
b***e 发帖数: 1419 | 13 This is what I have so far.
Seems whoever goes first wins, and he needs to take 2. The pattern is
quite clear: it is just modulo 8 instead of 4, and repeats the pattern:
1 1 1 1 0 1 1 0
which means, the losing points are at 8k + 5 and 8k. So 15 = 8 + 7 is a
winning point.
E(2) = 1, O(2) = 1
E(3) = 1, O(3) = 1
E(4) = 0, O(4) = 1
E(5) = 1, O(5) = 0
E(6) = 1, O(6) = 1
E(7) = 1, O(7) = 1
E(8) = 1, O(8) = 0
E(9) = 0, O(9) = 1
E(10) = 1, O(10) = 1
E(11) = 1, O(11) = 1
E(12) = 0, O(12) = 1
E(13) = 1 |
|
m******9 发帖数: 968 | 14 hash function通常有:
modulo
folding
mid-square function
extraction
radix transformation
collision的解决办法:
line probing
quadratic search
double hashing
chaining
bucket addressing |
|
I*******l 发帖数: 203 | 15 How about using one hash table together with one array? The hash table can
be used to support O(1)-time insertions and deletions and use the array for
getRandom. Basically we maintain an array (or more precisely, a dynamic
array) of pointers for the integers in the set and a counter k for how many
integers the hash table currently contains. We will also store the index of
an element in the array in the hash table of that element. When an integer
is inserted, we add a new entry to the end of the ... 阅读全帖 |
|
I*******l 发帖数: 203 | 16 How about using one hash table together with one array? The hash table can
be used to support O(1)-time insertions and deletions and use the array for
getRandom. Basically we maintain an array (or more precisely, a dynamic
array) of pointers for the integers in the set and a counter k for how many
integers the hash table currently contains. We will also store the index of
an element in the array in the hash table of that element. When an integer
is inserted, we add a new entry to the end of the ... 阅读全帖 |
|
b*****e 发帖数: 474 | 17 A programmer probably will use a DP solution, but it really just
needs grade school math:
Let X*n mean X key appears n times in a row.
The form of the answer must be:
A*k + (CA+CC+CV*x_1) + (CA+CC+CV*x_2) + ... (CA+CC+CV*x_m)
while the total # of keys should be n. The order of (CA+CC+CV*x)
combos doesn't matter.
Note the following:
1) First notice that CV should not occur more than 5 times in a row:
CA+CC+CV*n < CA+CC+CV*(n-3)+CA+CC+CV
2) Second, since
CA+CC+CV*5 = CA+CC+CV+CA+CC+CV*2, which ... 阅读全帖 |
|
b***e 发帖数: 1419 | 18 来自主题: JobHunting版 - 矩阵变换题 Yes, there is a simple solution here, which is no more than to solve a
set of linear equations.
Taking the example in OP as an example:
1. computer the xor, we get:
1 1 0
0 0 1
0 1 1
2. linearize it, top to bottom, left to right, let R be:
1 1 0 0 0 1 0 1 1
3. List all the transformations you can do, let T be:
1 1 1 0 0 0 0 0 0
0 0 0 1 1 1 0 0 0
0 0 0 0 0 0 1 1 1
1 0 0 1 0 0 1 0 0
0 1 0 0 1 0 0 1 0
0 0 1 0 0 1 0 0 1
4. Let T' be the transit of T, and R' be the transit of R (so R's is a
column). ... 阅读全帖 |
|
n********y 发帖数: 66 | 19 这不可能。
如果真能做到,研究压缩算法的都能回家带孩子去了。。
such that in most cases, two .....
这个,利用加密解密常用的 modulo arithmetic 应该靠谱一些。。 |
|
c*******n 发帖数: 63 | 20 http://www.interviewstreet.com
Find the no of positive integral solutions for the equations (1/x) + (1/y) =
1/N! (read 1 by n factorial) Print a single integer which is the no of
positive integral solutions modulo 1000007.
1 <= N <= 10^6
我一开始以为这题单纯是大数运算的问题,后来发现似乎不是
觉得解题的突破点应该是:
let p = n! --> 1/p - 1/(p+k) = k/(p(p+k))
p(p+k)/k is an integer, 1<= k <= p and the total solution of k is the unique
number of products of all combination of [1, n],
that is 1Cn + 2Cn + .... + (n-1)Cn + nCn - redundant ... 阅读全帖 |
|
w****o 发帖数: 2260 | 21 对,看了wikipedia,最新的C/C++语言里,modulo(余数)的符号跟被除数一致。 |
|
c***p 发帖数: 221 | 22 一般来说,可以自己定义一个hash function.有的人会继续问下去,比如不同类型的
data(int, float, string等)有什么常用的hash 方法。当然,对于int,最简单的就
是modulo了. |
|
v*********3 发帖数: 40 | 23 1. 求A to the power of B,然后modulo C的结果。A, B, C都可能是很大的整数。要
求时间O(logB)
2. merge两个list的时间是两个list里的元素个数之和。给一个array of integers,
每一个integer表示一个list的元素数,求最小的时间把所有的list merge起来。比如
说 [300, 100, 200],可能的merge时间是先merge前两个300+100, 然后merge (
400+200)。
第二道应该是一个很经典的题目,由于刚开始找工作,准备不足,水平撮,结果挂在第
二道题上。求拍。。。 |
|
o******3 发帖数: 91 | 24 听了二爷的话,开始做hackerrank
今天被lego blocks绊住了
测试数据集可以过 但是提交数据集就超时了 虽然我用的确实是DP
下面是题目和我的代码,还望指点
You have 4 types of lego blocks, of sizes 1 * 1 * 1, 1 * 1 * 2, 1 * 1 * 3
and 1 * 1 * 4. Assume you have infinite number of blocks of each type.
You want to make a wall of height N and width M out of these blocks. The
wall should not have any holes in it. The wall you build should be one solid
structure. A solid structure means that it should not be possible to
separate the wall along any vertical line withou... 阅读全帖 |
|
r****s 发帖数: 1025 | 25 这个是经典的stream processing问题。
Server把url扔到后端,后端有数个server或者process,最简单的方法就是hash url然
后决定按hashcode把url扔到那个server或者process (modulo就可以了),这个
process就把url累计count一下,然后把url:count这个pair 扔到后一级的process或者
server,后一级的server把url:count存到一个concurrent hashmap里。一个thread 大
概每10秒钟把这个map扫一遍,给出前10名。
这是很粗略的方法,讲究一些的可以加各种花里胡哨的东西上去。
知道twitter storm吗?就是干这个的。http://storm-project.net/ 阿里巴巴和淘宝都在用,估计那个主要开发者Xu Mingming也是淘宝的。 竞争对手是Apache S4,但是S4明显不是对手。 |
|
z****e 发帖数: 54598 | 26 最早以前我不确定
最早有人问的时候,就有人说过circle,我就感觉应该是hashmap
还说过了比hashtable快十倍的说法,懒得继续找了
后来又有人问
我看了古德霸和这位牛人的说法,我确定了,应该是没有错
priorty queue等不是不行,但是并发时候效率堪忧,锁得太多
这个牛人做message的,举的大部分例子都是message
可能在twitter,我猜的
所以对于它给出的答案,我会认真阅读
发信人: rtscts (syslink), 信区: JobHunting
标 题: Re: most clicked urls in the last 5 mins, 1hr, 24 hrs?
发信站: BBS 未名空间站 (Fri Aug 9 18:44:21 2013, 美东)
这个是经典的stream processing问题。
Server把url扔到后端,后端有数个server或者process,最简单的方法就是hash url然
后决定按hashcode把url扔到那个server或者process (modulo就可以了),这个
process就把url累计co... 阅读全帖 |
|
s**x 发帖数: 7506 | 27 I believe leetcode provide a simple solution which may overflow, but
actually it is correct.
You can simply use unsigned int. I would think even an int would work as
well.
bool isPalindrome(int num) {
if(num < 0) return false;
unsigned int oldNum = num;
unsigned int rev = 0;
while (num != 0) {
rev = rev * 10 + num % 10;
num /= 10;
}
return rev == oldNum);
}
The following is from gnu comments.
13.2.1 Basics of Integer Overflow
In languages like C, unsigned integer overflow ... 阅读全帖 |
|
b***e 发帖数: 1419 | 28 根据抽屉法则,五张牌里至少有两张花色是相同的。假设这两张的点数为a和b, 同时b
是较大的一张。考虑a和b之间modulo 12的减法,则有b - a <= 6 mod 12, 或a - b <=
6 mod 12。若是前者第一张牌放a,藏b; 若是后者, 第一张牌放b,藏a。 剩下的三
张牌按排序encode c=|a-b|。由于c是小于等于6的,三张牌正好够用。
猜的人看到四张牌,知道花色和第一张是一样的。如果第一张点数为a, 后面三张
encoding的数为c, 则藏的牌点数是a + c mod 12. |
|
c******a 发帖数: 198 | 29 i like your modulo idea. but your solution may also have an overflow issue,
when rand() returns int.MaxValue and min is int.MinValue.
i think this modified one should work without overflow.
return min + rand() % (max - min + 1); |
|
z*****8 发帖数: 2546 | 30 beijingdaddy> high effiency and ultimate costsaving are two conflicting
goals
My point is that people have the believe "high effiency and ultimate
costsaving are two conflicting goals", I am just presenting my result
showing this is not true in this situation. In this situation, you shoot two
birds with one bullet.
It is possible those hired guns used some methods passed by other people, or
they just think this a inherent problem in the business without solution (
everyone wastes that 5% because... 阅读全帖 |
|
t******l 发帖数: 10908 | 31 另外对于你说的 “娃的这些解题思路是怎么来的?是逻辑思维的经验还是想象力?”。
我觉得这个要分各个娃不同的 band 讨论,对于大多数普通娃而言,最终是止步在
AMC 10 / 12 左右,去 AIME 也就是玩玩。(相当于 AoPS 的 introductory
level)。。。而在这种情况下,如果你看一下 AoPS链接里下面的例题,对于
AMC 10 / 12 题目,根本不需要真正去引用费马小定理的原文,切切实实把小学
四年级数学(同时也是建立费马小定理的基本元素)比如:combination wo/
repetition, UPF, combinatorics on ring structure,对 modulo arithmetic
的图景有小学四年级水准的直观认知,我觉得都足够 AMC 12 考到 110 分了,
根本不需要知道具体的费马小定理。
当然对于 AIME+ 的娃的 band 的就另说。。。但没有天资的情况下,我不会把娃往
火坑(相对于没有天资的情况而言)里推。。。当然这个各家自己看情况掌握就是了
。。。
明。 |
|
a*****g 发帖数: 19398 | 32 Number of legal Go positions
The 361 points on a 19x19 Go board can be colored empty, black, or white.
Only some of the 3^361 possible positions are legal, namely those where
every group of connected stones of the same color has an empty point
adjacent to it. In the position above, black stones at E18 and N9 lack such
``liberties'', making the position illegal. Due to its capture rule, the
positions that can arise in a game of Go are exactly the legal positions. On
Jan 20, 2016, the number of le... 阅读全帖 |
|
h*h 发帖数: 27852 | 33 【 以下文字转载自 Mathematics 讨论区 】
发信人: ananpig (●○ 围棋数学一把抓的安安猪), 信区: Mathematics
标 题: 19路围棋的所有合法图案终于出来了 Number of legal Go positi
发信站: BBS 未名空间站 (Wed Jan 27 18:50:19 2016, 美东)
发信人: ananpig (●○ 围棋数学一把抓的安安猪), 信区: Programming
标 题: 19路围棋的所有合法图案终于出来了 Number of legal Go positi
发信站: BBS 未名空间站 (Fri Jan 22 10:38:03 2016, 美东)
Number of legal Go positions
The 361 points on a 19x19 Go board can be colored empty, black, or white.
Only some of the 3^361 possible positions are legal, namely those where
every group... 阅读全帖 |
|
B******O 发帖数: 472 | 34 转贴:
The sequence {f(n)/f(n-1)} for positive integers n-s covers all the positive
rational numbers in reduced form.
If n is odd (=2m+1), from the definition of f(n) (modulo 2) we get that 1 (=
2^0) appears exactly once and hence
(1a) f(2m+1) = f(m).
If n is even (=2m), 1 either does not appear at all or appears twice. In the
first case, we get f(n) possibilities and in the second we get f(n-1).
Therefore,
(1b) f(2m)=f(m)+f(m-1).
Clearly f(n)>0 and therefore
(2) f(2n-1) = f(n-1) < f(n-1)+f(n) = f( |
|
s*****g 发帖数: 1055 | 35 I googled:
B'L : Legendre's Constant = 1
Sum(1/2i) : 1 + (1/2) + (1/4) + (1/8)... = 2
3 : HTML Character code for "3". is a prefix normally given for
these characters, the 'x33' means 33 base 16 (or 51 decimal). Note if you
type "3" into a Reddit comment you get "3" :)
2-1 (mod 7) : In normal modular arithmetic, subtract the "mod" from the
calculation until you get a number less than the "mod". So 15 mod 11 = 4. In
inverse modulo arithmetic, you're asking what number, when multiplied... 阅读全帖 |
|
b***p 发帖数: 700 | 36 就是modulo,求余数,一共是32片花瓣,一次拔三片,最后肯定剩下2或者5或者8片,
这种3x+2,答案里面只有一个符合条件
我家可爱的儿子,把一片纸全写满了,我说,要是题目里面是3100,5000,6000,
10000,你是不是要写到楼下去啊。。。不就是以前,学会写一二三,马上写万字的笑
话吗 |
|
z*********e 发帖数: 10149 | 37 你可以直接假设是primitive Pythagorean triple,就是3个数没有公因子,
然后这个奇偶性部分用modulo 算数是很明显的结果
a = 1 mod 4
b = 1 mod 4
then a^2 + b^2 = 2 mod 4,c一定不会是整数
另外wikipedia上有一些很有趣的结果
https://en.wikipedia.org/wiki/Pythagorean_triple#Elementary_properties_of_
primitive_Pythagorean_triples
Exactly one of a, b is odd; c is odd.
Exactly one of a, b is divisible by 3.
Exactly one of a, b is divisible by 4.
Exactly one of a, b, c is divisible by 5. |
|
c**********t 发帖数: 80 | 38 G1^* is the multiplicative group consisting of all elements of G1 except 0.
The
binary operation of G1^* is multiplication modulo q; the identity element is
1. |
|
g*********s 发帖数: 1782 | 39 (gdb) p 16/-10
$10 = -1
(gdb) p -16/10
$11 = -1
(gdb) p 16%-10
$12 = 6
(gdb) p -16%10
$13 = -6
the last 2 are not symmetric as the following is not symmetric?
(a/b)*b + a%b == a |
|
N***m 发帖数: 4460 | 40 are you asking questions? |
|
c**b 发帖数: 2999 | 41 先用abs把负数变成正数,再在结果上加一个负号. |
|
l**********n 发帖数: 8443 | 42 面试的时候我也写不出来。离不开IDE了。 我发现烙印面试官最喜欢问这种问题,以显
示自己的博学,知道茴香豆的茴字还有几种写法。这种问题没有任何意义。那天我碰到
一个烙印问我怎么求一个数是偶数还是奇数,我开始还以为问题很高深,原来最后是考
我Modulo operation. 这个问题烙印会这么问,Java里string怎么求得每个char。有几
种方法。那种方法最有效率等等 |
|
a*****g 发帖数: 19398 | 43 Number of legal Go positions
The 361 points on a 19x19 Go board can be colored empty, black, or white.
Only some of the 3^361 possible positions are legal, namely those where
every group of connected stones of the same color has an empty point
adjacent to it. In the position above, black stones at E18 and N9 lack such
``liberties'', making the position illegal. Due to its capture rule, the
positions that can arise in a game of Go are exactly the legal positions. On
Jan 20, 2016, the number of le... 阅读全帖 |
|
N***l 发帖数: 52 | 44 怎么定义矛盾?
这个group 就是free group modulo relation sets.mGladiator (Roman) 的大作中提到: 】
6= |
|
s**********n 发帖数: 1485 | 45 So you are asking for a distribution whose Fourier transform is 0 for x<0
and 1 for x>0?
The answer should be (modulo a constant factor)
(i/2)H + (1/2)delta
where H is the Hilbert transform. |
|
b****d 发帖数: 1311 | 46 mod n 就是 modulo n,用来算每个数除以 n 后的余数。
比如 A = [1,3]
[5,7]
则 A mod 3 = [1, 0]
[2, 1]
要不要 mod n 和取什么 n 取决于你的需要。
a |
|
D*****r 发帖数: 6791 | 47 http://golem.ph.utexas.edu/category/2013/05/bounded_gaps_betwee
Guest post by Emily Riehl
Whether we grow up to become category theorists or applied mathematicians,
one thing that I suspect unites us all is that we were once enchanted by
prime numbers. It comes as no surprise then that a seminar given yesterday
afternoon at Harvard by Yitang Zhang of the University of New Hampshire
reporting on his new paper “Bounded gaps between primes” attracted a
diverse audience. I don’t believe the paper is... 阅读全帖 |
|
B********e 发帖数: 10014 | 48
I might say, Zhang could call his paper "A new bound for an
incomplete Kloosterman sum to composite moduli, and bounded prime gaps".
Kowalski noted (and was kinda surprised) the "higher" Kloostermania such as
Kuznetsov trace formula and sums of Kloosterman sums did not appear (as in
BFI). To state the "philosophy" of Zhang's new element in one (long)
sentence: When you Weyl shift a suitable incomplete Kloosterman sum to a
composite modulus by multiples of a (small) factor of said... 阅读全帖 |
|
a**********s 发帖数: 1075 | 49 modular multiplicative inverse是什么意思,如何计算
for example, how to find d ≡ e−1 (mod φ(n)), where d is the
multiplicative inverse of e (modulo φ(n))?
matlab里该如何计算? |
|