由买买提看人间百态

topics

全部话题 - 话题: random
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
g*******y
发帖数: 1930
1
来自主题: JobHunting版 - random(5) generate random(7)
如果你定义的randN是指产生0...N一共N+1个数的话,这个方法还行。
不过我印象中RandN就是只产生N个不同的数。。。

random
r****o
发帖数: 1950
2
ranNum=a;
for (int i=0; i ranNum+=random(0,1);
c***2
发帖数: 838
3
来自主题: JobHunting版 - random numbers
where are the basics/algorithms to solve random number problems?
for example,
you have a dice to generate random numbers 1-6
how to generate 1-5 or 1-8?
Thanks,
K*****k
发帖数: 430
4
来自主题: JobHunting版 - 这个copy random link真不容易写对
可以上网考古,好像是小尾羊Google加试的那轮就被问到。
就是说一个普通链表,每个节点还有一个random link指向别的节点或者自己。
让你In place(除了每个节点new出的copy)的复制这个链表,包括random link的拓扑
结构,也就是一个完全一样的镜像。
s******n
发帖数: 3946
5
来说说我的思路,reverse list不难,但是这个问题是有环怎么办:比如a -> b -> c
->a,假设一开始从a开始reverse整个环,然后访问link list的next又遇到了b,这时
候就不能再reverse一次了。
思路:先reverse有环的,再reverse没环的
round 1,找出所有环,把环中最后一个指向special "NodeEnd",所以a -> b -> c ->
a变成 a->b->c->nodeEnd。
round 2,从LL头开始遍历所有Node,假设Node开始的random pointer路径包含nodeEnd
,则重新构成一个逆向的环。
round 3,从LL头开始遍历所有Node,假设Node开始的random pointer路径包含NULL,
则reverse这个list
P********l
发帖数: 452
6
If we know the direction of the link, that is, pointing to a visited
node or a coming node, this problem is trivial.
To know the direction, we can follow the 'next' field of the nodes from
the node pointed by the 'random' pointer. If the current node was found,
it is pointing backward. Otherwise, forward.
You can use the 'random' pointer field to improve the performance.

some
simplify
more
than
m*********e
发帖数: 13
7
来自主题: JobHunting版 - 问个题 weighted random sampling
如果数组大到让sum溢出,那么scale down也会underflow。
我想可以用Metropolis–Hastings,也就是选random pick一个数x1,再random pick一
个数x2,如果weight of x2大于weight of x1,改变状态到x1,否则以一定概率到x2。
After burning in like 10000 iterations, 后面产生的就是要的sample.
这不像是面试SDE的问题,楼主面的是什么职位可以告知么?
m*********e
发帖数: 13
8
来自主题: JobHunting版 - 问个题 weighted random sampling
如果数组大到让sum溢出,那么scale down也会underflow。
我想可以用Metropolis–Hastings,也就是选random pick一个数x1,再random pick一
个数x2,如果weight of x2大于weight of x1,改变状态到x1,否则以一定概率到x2。
After burning in like 10000 iterations, 后面产生的就是要的sample.
这不像是面试SDE的问题,楼主面的是什么职位可以告知么?
t*****e
发帖数: 53
9
I know the solution:
read the first k lines from the file,
then repeat the following steps:
- read one line from the file
- with probability X, keep the new line, and randomly drop a line from the
previous selected k lines.
- with probability (1-X), drop the new line.
till all the lines of the lines are read
My questions is:
- What should be the value of X?
- How to give a strict math proof that this method gives a randomly
uniformly distributed k lines.
thanks alot for your help.
j******2
发帖数: 362
10
原题如下
Given a set, and functions insert(i), delete(i), count(i), size(), random.
Design a data structure and implement PopRandom() to pop a random element
from the set and return it.
m****r
发帖数: 141
11
【 以下文字转载自 Quant 讨论区 】
发信人: mitcar (mitcar), 信区: Quant
标 题: 绿皮书 random ants 为什莫 结果是 499/500 ?
发信站: BBS 未名空间站 (Sun Jun 30 20:00:05 2013, 美东)
关于绿皮书 random ants (p 102),
为什莫, 500 个 IID 随机变量 (with uniform distribution [0.1])的期望值 是
499/500 ?
谢谢
s*w
发帖数: 729
12
来自主题: JobHunting版 - leetcode Copy List with Random Pointer
map addr2ind; // 原表
vector ind2addr; // 新表
vector ind2ind; // 原表里的 random 链接
新表不用每个node都遍历搜索当前的 random 指针,直接取; 都对应存好了
s*w
发帖数: 729
13
来自主题: JobHunting版 - leetcode Copy List with Random Pointer
这个想法真别致;我看过的,几天没温习就全忘记了;你一讲,我又想明白了大部分,
多谢
1. 每个 node 完整(我的只有value)copy construct
2. interleave 复制的 node
3. 把所有复制 node 的 random 改成原node random指针指向 node 的 next
4. 改每个 node 的  next 到下一个
5.  返回第二个 node
太考脑筋了,怕过几天又忘记了
c*******2
发帖数: 60
14
貌似前半段是list, 后半段是random指针,
所以 list是 -1 8 7 -3 4
然后各节点的random指向 4 -3 # # -1
#表示空指针
a**********0
发帖数: 422
15
来自主题: JobHunting版 - copy list with random pointer 老出错
我的思路是
复制每个节点 插在每个节点的后边
然后每个都copy random pointer
然后分开两个链表
我为什么第一次没有通过呢 因为第一次只是构建了一个新链表 但是把原来的破坏了

random
o****e
发帖数: 4946
16
来自主题: Stock版 - Random walk theory
金融学里有一个random walk theory说一个stock或overall market的
price movement是一个random walk, 无法用过去的price来预测未来
price的movement. 这个理论的提出者还认为TA和FA都基本是浪费时间,
并不能outperform the markets. 他还认为buy-and-hold其实是the
best strategy, 试图time the markets最终都是徒劳。不过这个理论
一直都有争议,许多学院派不断为这个理论提供support, 但wall street
多倾向于不相信这个理论。
j***b
发帖数: 5901
17
来自主题: Stock版 - Random walk theory
股票价格肯定不是random walk。你看一看random walk的path再对比一下股票价格曲线
就知道了。
g*********0
发帖数: 672
18
来自主题: Stock版 - Random walk theory
random walk是预测理论,严格来说根本不是股票理论
显然不会是random的,它的意思是不能预测,呵呵
l**h
发帖数: 893
19
Random Audit本身就不太合理,真正应该被Audit的,是那些批量作假的阿三公司,但
是很多中国申请者也受拖累, PERM本身没有问题, 却被Random Audit。
所以不管PERM批了没批的,都请帮忙sign一下,帮助中国人。
http://www.change.org/petitions/dr-william-l-carlson-dol-please
It will be sent to:
Dr. William L. Carlson
Administrator, Office of Foreign Labor Certification
Department of Labor
Mr. Thomas Perez
The United States Secretary of Labor
Senator Tom Harkin,
Chairman of the Senate Health, Education, Labor, and Pensions (HELP)
Committee
l**h
发帖数: 893
20
Random Audit本身就不太合理,真正应该被Audit的,是那些批量作假的阿三公司,但
是很多中国申请者也受拖累, PERM本身没有问题, 却被Random Audit。
所以不管PERM批了没批的,都请帮忙sign一下,帮助中国人。
http://www.change.org/petitions/dr-william-l-carlson-dol-please
It will be sent to:
Dr. William L. Carlson
Administrator, Office of Foreign Labor Certification
Department of Labor
Mr. Thomas Perez
The United States Secretary of Labor
Senator Tom Harkin,
Chairman of the Senate Health, Education, Labor, and Pensions (HELP)
Committee
a*****e
发帖数: 4577
21
【 以下文字转载自 Chicago 讨论区 】
发信人: xlyytchy (农夫), 信区: Chicago
标 题: 大家出门小心点, chicago全城黑帮在搞 random kill
发信站: BBS 未名空间站 (Thu Jun 2 12:02:21 2011, 美东)
之前警方最新派驻近400人的特别分队,准备治理chicago黑帮问题。 黑帮立马做出反
应。
现在枪击不是原来的黑帮内部仇杀, 现在是random kill!
也不像原来只是englewood 之类的 jungle里面打杀, 而是到处杀
阿米驼佛!
阿米驼佛!
v******f
发帖数: 4509
22
【 以下文字转载自 Chicago 讨论区 】
发信人: xlyytchy (农夫), 信区: Chicago
标 题: 大家出门小心点, chicago全城黑帮在搞 random kill
发信站: BBS 未名空间站 (Thu Jun 2 12:02:21 2011, 美东)
之前警方最新派驻近400人的特别分队,准备治理chicago黑帮问题。 黑帮立马做出反
应。
现在枪击不是原来的黑帮内部仇杀, 现在是random kill!
也不像原来只是englewood 之类的 jungle里面打杀, 而是到处杀
阿米驼佛!
阿米驼佛!
l**h
发帖数: 893
23
Random Audit本身就不太合理,真正应该被Audit的,是那些批量作假的阿三公司,但
是很多中国申请者也受拖累, PERM本身没有问题, 却被Random Audit。
所以不管PERM批了没批的,都请帮忙sign一下,帮助中国人。
http://www.change.org/petitions/dr-william-l-carlson-dol-please
It will be sent to:
Dr. William L. Carlson
Administrator, Office of Foreign Labor Certification
Department of Labor
Mr. Thomas Perez
The United States Secretary of Labor
Senator Tom Harkin,
Chairman of the Senate Health, Education, Labor, and Pensions (HELP)
Committee
z*******2
发帖数: 2643
24
【 以下文字转载自 Chicago 讨论区 】
发信人: xlyytchy (农夫), 信区: Chicago
标 题: 大家出门小心点, chicago全城黑帮在搞 random kill
发信站: BBS 未名空间站 (Thu Jun 2 12:02:21 2011, 美东)
之前警方最新派驻近400人的特别分队,准备治理chicago黑帮问题。 黑帮立马做出反
应。
现在枪击不是原来的黑帮内部仇杀, 现在是random kill!
也不像原来只是englewood 之类的 jungle里面打杀, 而是到处杀
阿米驼佛!
阿米驼佛!
a****s
发帖数: 524
25
来自主题: Bridge版 - random thoughts
IMO,
The difference between poker and bridge is not much in
term of randomness.
In fact, I would say Poker, from some perspective, is
more random a game than
bridge. For one thing, unlike playing bridge,
you don't have cards, you can't win in Poker.
The difficulty to promote bridge to the degree of
popularity and thus profitability that poker currently
enjoy, is the asymmetric information problem.
One always know better about one's partner than one's
opponents do. this is the main barrier toward
h******1
发帖数: 1930
26
如题,小弟遇到些问题,诚心求帮助!
关于design & analysis of experiment.
randomized block design, completely Randomized Design, Latin Square Design.
如果哪位刚好懂这方面的知识,还望赐教!
f*****g
发帖数: 15860
27
来自主题: TexasHoldem版 - tell of random raise amount
online tournaments, noticed some players like to raise to a random/funny
number, like 888, 222, 2314, etc. i do this sometimes too.
pre-flop, i give it less value, just a common way to disguise/randomize your
"normal" bet ranges, or textbook-like 3.5xBB with XX hand.
post-flop towards the end, i give it more value or take it as an alert. my
immature (lol) theory behind this is:
1) the player is playing his hand in a relatively relaxed mood, and has the
"extra" attention to "make some fun" with t
d*****d
发帖数: 10658
28
来自主题: Collectibles版 - 请问在APMEX上买金币Random Year好吗?
买Random Year的通常比2013的金币便宜几块到几十块,我不是很理解,因为一些金
币前面年份的价格大于2013年的很多,是不是Random Year买的品相有问题呢?谢谢指
点!
j*****e
发帖数: 11116
29
说到random 三蛋笑了 貌似war3 random难度比sc大啊
a***a
发帖数: 40617
30
三蛋除了以前战队联赛用random之外,其他正式solo比赛几乎从来没用过random
没错,他可以用ne,但是也仅仅限于ne vs hum
完全没可比性
G*******s
发帖数: 10605
31
【 以下文字转载自 SmartShopper 俱乐部 】
发信人: GoRockets (火箭加油), 信区: SmartShopper
标 题: Old Navy random secret code 20%-30% discount thru 6/28
发信站: BBS 未名空间站 (Sun Jun 26 08:08:35 2011, 美东)
The codes randomly generate when you visit old navy site (clear cookies and refresh if your discount is less than 30%):
http://oldnavy.gap.com/
onsecret20 for 20% off
onsecret25 for 25% off
onsecret30 for 30% off
deal source and details (there is no referral link in the post, you may use ebates to get some cashback, visit ... 阅读全帖
N****f
发帖数: 25759
32
【 以下文字转载自 mitOCEF 讨论区 】
发信人: NWWolf (西北の狼), 信区: mitOCEF
标 题: 【MITOCEF超级秀场】Random Chats with an (Almost) Four-Year-Old
发信站: BBS 未名空间站 (Mon Mar 12 02:41:40 2012, 美东)
Random Chats with an (Almost) Four-Year-Old
"Early" this morning, I dreamed of a pair of cold little feet on my
shoulder.
Except that it really was not part of a dream. Those cold little
feet felt very real, and I knew exactly whom they belonged to as
soon as I bid good-bye to Caesar and Cleopatra.
I opened my eyes, and saw that my ... 阅读全帖
s***n
发帖数: 821
33
来自主题: Poetry版 - Randome Words
oh Well 若Randome, 非Random, 非常非不常,亦非无常
大音希声
离苦无欲
其色无明
其梦无踪
吾常若丧
失之中途
或于卧榻
或于万物
往不可赎
尝于崖际
有佳人来
其声希微
吾适于彼
此后无失
吾于蝶乡
尝寻此声
其声希微
其暖如红
忽闻低诉
吾常左右
你我常群
灰飞烟灭
于吾旧游
涸辙鱼惊
愿坦言之
所始非生
所终非死

大音希声
离苦无欲
其色无明
其梦无踪
吾常若丧
失之中途
或于卧榻
或于万物
往不可赎
尝于崖际
有佳人来
其声希微
吾适于彼
此后无失
吾于蝶乡
尝寻此声
其声希微
其暖如红
忽闻低速
吾常左右
你我常群
会飞烟灭
于吾旧游
涸辙鱼惊
愿坦言之
所始非生
所终非死
名空间站 http://mitbbs.com·[FROM: 128.211.]
d*l
发帖数: 400
34
I don't think random process can explain intelligence. let monkeys write
random letters on a tape, how many years would it take for them to write a
master piece, like Hong Lou Meng?

is
(or
existed
"force
think
will
s***e
发帖数: 284
35
【 以下文字转载自 Joke 讨论区 】
发信人: KennyD (-keNNyd-), 信区: Joke
标 题: MIT牛人编写的Randomly Generated Talk
发信站: BBS 未名空间站 (Wed Jul 20 20:09:46 2005)
上次那几个写randomly generated paper的MIT牛人7月份开会时候的录像已经
公布出来了,偶正在看,巨牛阿
http://pdos.csail.mit.edu/scigen/#talks
需要下载DivX插件。
D***r
发帖数: 7511
36
来自主题: CS版 - 怎么randomize网络问卷
【 以下文字转载自 Programming 讨论区 】
发信人: Dower (Historian), 信区: Programming
标 题: 怎么randomize网络问卷
发信站: BBS 未名空间站 (Sat Nov 28 15:15:38 2009, 美东)
应该是菜鸟问题哈
我想做一个网络调查问卷,
但是希望每次打开的时候问题出现的顺序不同
应该怎么实现呢?
特别要注意randomize问题以后不能把答案弄乱了
r*u
发帖数: 436
37
来自主题: Java版 - random seed generator
Does anybody know an opensource random seed generator package in Java? Such as
this one: http://tinyurl.com/65fsc (which is not free unfortunately)
The random seed generation in JCE is kinda bogus and I am looking for
something more cryptographically strong.
Thanks!
b******y
发帖数: 9224
38
来自主题: Java版 - Random split of a file
Init a random number generator;
Parse the file once;
For each line, run the random number generator and get a number between 0.0
~ 1.0;
If the number is below 0.3, put the line into file A, else put the line into
file B;
done.
你只需要一个pass就成了。
c*******e
发帖数: 290
39
来自主题: Java版 - Random split of a file
cool. 这么简单。但是有个问题,这样能保证每一行得到的概率相等吗? 比如说,产
生 0-9 之间的随机整数,
Random r = new Random();
for(int i=0; i<10; i++){
System.out.println(r.nextInt(10) + " ");
}
结果,有些重复几次,4,6,3;有些根本没出现,2,7,9,0。假如按照这次随机数来分割
文件,有两行(0,1)分到一个文件,而另一个文件包含 8 行;
4
8
4
6
1
5
3
6
3
3

0
into
h********l
发帖数: 67
40
来自主题: Programming版 - random number generator in C++
the problem is in the following statement:
"srand(time(NULL))"
The program resets the random seed for each random number.
But the seed (time(NULL)) doesn't change for 100 numbers as the program runs
so quickly. So the program prints out 100 same numbers.
Moving "srand(time(NULL))" to the main function will solve the problem.
J*y
发帖数: 271
41
来自主题: Programming版 - java random set seed question
thanks
yes. have to use random. math.random cannot set seed.
s*********x
发帖数: 1923
42
Hi, guys,
I need your expert opinions on this problem. I need to do a random sampling
of a input file. Suppose this
file is consisted of 1000 lines (1000 data). I want to randomly choose 60%,
70% and 85% of them and do
some analysis. Does anyone have any suggestions? Thanks!
s*********x
发帖数: 1923
43
Sorry I have to type in English. My question is that if you generate (60% of
1000) random numbers, some
of them will definitely be the same. Then you are not covering 60% of the
population, maybe only 55%.
What I need is 600 different random numbers between 1 to 1000.
Is my understanding correct?
t****t
发帖数: 6806
44
STL random_shuffle calls system std::rand() if you don't supply a rand
object yourself.
so the caller is actually responsible for guaranteeing the randomness.

random
not
d**s
发帖数: 920
45
来自主题: Programming版 - 如何 randomize 一个sorted的文件 ?
如何 randomize 一个sorted的文件 ?
有没有现成的 Unix command or utility ?
For example, I have a sorted file, it has entry:
abc
abd
zzy
zzz
(It is a result of unix sorting output).
Is there a unix command or utility to randomize lines in the file ?
Thanks.
M*****8
发帖数: 17722
46
来自主题: Programming版 - Random Switch Between Two Different URLs
I want to be able to switch randomly between two different URLs when
people visit my domain name.
What would the PHP code be like to do this. Or is there a better solution
than PHP?
It is like URL forwarding, except the target is randomly chosen from a list
of two [or more].
Thanks
w*s
发帖数: 7227
47
our product is OS, so provide these IPC calls,
can i generate random tests for them ?
say i generate random number of threads,
thread 1 creates and gets a mutex,
thread 2 has to wait for it.
The above case is simple, how about nested case,
thread 1 creates and gets a mutex, then i has to wait for an event from
another thread...
Q1: what are the constrains ? the only one i know is thread 2 has to wait
for
the mutex, only after mutex gets created.
Q2: How complicate can this go ? inside mutex blo... 阅读全帖
w******n
发帖数: 767
48
你想复杂了,lz这个是已知基因,而且他有序列。one-step qRT-PCR是用下游引物起始
合成CDNA第一链,但是他的引物不work,想加入random合成第一链,这个做realtime可
能有问题,random会产生非特异带,影响定量,建议楼主试别的引物,或者两步RT-PCR。

的引物

发帖数: 1
49
请问有人在human ESC中做reporter时用TK去避免random integration吗?一般
Ganciclovir的浓度用多少呢?多久能杀死random integration发生并且TK基因完整的
细胞呢?非常感谢!
O******e
发帖数: 734
50
来自主题: Computation版 - Random number generation in FORTRAN
In Fortran 77, there is no standard way to call a random number generator.
Depending on the application, it may call its own generator, or a generator
provided by some library, and these could have any name.
Fortran 9x specifies how a random number generator for uniform distribution
between 0 and 1 is to be called, but does not specify the algorithm that is
used for the generator:
call random_number(...)
call random_seed(...)
"Unresolved external symbol" means that the linker (which links
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)