Redian新闻
>
I-693 medical exam for paretns applying greencard
avatar
I-693 medical exam for paretns applying greencard# Immigration - 落地生根
b*d
1
今天刚遇到的。
写一个函数(getMatrix),给一个数N,生成一个随机的valid的NxN矩阵。valid是指
,矩阵上的每个cell也是一个数,但必须是从1到N的一个数。行列皆不能有重复的数。
每次call这个函数,返回的matrix都是独立随机。
完成这个函数后,follow up:反过来,如果得到这样一个matrix后,中间挖掉几个
cell,让其成空,剩下的是个sudoko puzzle,让人来猜。你能否定义一个difficulty
,来衡量你生成的puzzle有多难。难度需要与人们平均做出来的时间正相关。
avatar
w*6
2
Hi: any one has experience of what vaccinations they need to get to pass the
medical exam? particularly MMR 麻风腮and Polio 小儿麻痹症, they should have
immunity (免疫力) (born in 1948 and 1847), but don't know if they still
need to get the shots, kind of expensive. Thanks
avatar
f*e
3
(N-1) regular bipartite matching,node i连接另一半里除i之外的nodes,随机
产生一个matching(i,j);然后去掉(j,i)形成(N-2)regular bipartite matching,再随
机产生一个matching,以此类推,这样可以产生随机矩阵。
然后挖掉方块后,剩余行和列元素的重合程度,(行-方块)交(列-方块)和方块大小决定
difficulty。

difficulty

【在 b*******d 的大作中提到】
: 今天刚遇到的。
: 写一个函数(getMatrix),给一个数N,生成一个随机的valid的NxN矩阵。valid是指
: ,矩阵上的每个cell也是一个数,但必须是从1到N的一个数。行列皆不能有重复的数。
: 每次call这个函数,返回的matrix都是独立随机。
: 完成这个函数后,follow up:反过来,如果得到这样一个matrix后,中间挖掉几个
: cell,让其成空,剩下的是个sudoko puzzle,让人来猜。你能否定义一个difficulty
: ,来衡量你生成的puzzle有多难。难度需要与人们平均做出来的时间正相关。

avatar
b*r
4
应该是到医生那验血吧

the
have

【在 w********6 的大作中提到】
: Hi: any one has experience of what vaccinations they need to get to pass the
: medical exam? particularly MMR 麻风腮and Polio 小儿麻痹症, they should have
: immunity (免疫力) (born in 1948 and 1847), but don't know if they still
: need to get the shots, kind of expensive. Thanks

avatar
b*d
5

what if when you get (N-k) matching done, for the rest of the problem there
is actually no solution given your previous (N-k) matching? it is very
possible, how do you continue trying?

【在 f*****e 的大作中提到】
: (N-1) regular bipartite matching,node i连接另一半里除i之外的nodes,随机
: 产生一个matching(i,j);然后去掉(j,i)形成(N-2)regular bipartite matching,再随
: 机产生一个matching,以此类推,这样可以产生随机矩阵。
: 然后挖掉方块后,剩余行和列元素的重合程度,(行-方块)交(列-方块)和方块大小决定
: difficulty。
:
: difficulty

avatar
w*6
6
Hi: any one has experience of what vaccinations they need to get to pass the
medical exam? particularly MMR 麻风腮and Polio 小儿麻痹症, they should have
immunity (免疫力) (born in 1948 and 1847), but don't know if they still
need to get the shots, kind of expensive. Thanks
avatar
p*2
7
这是哪家的题呀?
avatar
b*r
8
应该是到医生那验血吧

the
have

【在 w********6 的大作中提到】
: Hi: any one has experience of what vaccinations they need to get to pass the
: medical exam? particularly MMR 麻风腮and Polio 小儿麻痹症, they should have
: immunity (免疫力) (born in 1948 and 1847), but don't know if they still
: need to get the shots, kind of expensive. Thanks

avatar
a*y
9
你这个一共才1-N的数,矩阵有N^2个数, 为什么不重复?
avatar
w*6
10
I would like to share my experience to save money. For elderly people, they
don't need Polio and MMR. For other vaccinations, if you can get records in
China, it will save money for you. The doctor's office will take whatever
you have, such as Hep A, Hep B, Tdap, flu shot which are not cheap if you
get done in U. S. I gave the list of vaccinations for my parents to get shot
at home. They tried and were rejected by local office, they were told to go
to big city such as Hongzhou or Shanghai. After all the troubles, I decided
to write down what they need. No problems with my records.

the
have

【在 w********6 的大作中提到】
: Hi: any one has experience of what vaccinations they need to get to pass the
: medical exam? particularly MMR 麻风腮and Polio 小儿麻痹症, they should have
: immunity (免疫力) (born in 1948 and 1847), but don't know if they still
: need to get the shots, kind of expensive. Thanks

avatar
p*2
11

行列不重复。

【在 a*******y 的大作中提到】
: 你这个一共才1-N的数,矩阵有N^2个数, 为什么不重复?
avatar
f*e
12
表述有点bug,sorry。
只要是k-regular的就会有perfect matching,一开始是(n-1)regular的,记为图1,后
来是(n-2),(n-3),...,1 regular的。只要保持图是k-regular的就有perfect matching

以4个点为例:
1 (2,3,4)
2 (1,3,4)
3 (1,2,4)
4 (1,2,3)
找到一个matching (i,j)=(1,2) (2,1) (3,4) (4,3),然后在图1中删掉(j,i)得到
(j不能再和前面path里的点相连,也不能和自身相连,所以要删掉前面path里的点)
1 (3,4)
2 (3,4)
3 (1,2)
4 (1,2)
再找到一个matching (i,j)=(1,3) (2,4) (3,1) (4,2),然后在图1中删掉前面path中
出现的点得到
matching:
1 2
2 1
3 4
4 3
然后把三个matching串在一起得到:
1-2-4-3
2-1-3-4
3-4-2-1
4-3-1-2
每行都是一个path。每一列到下一列的matching都是随机产生的。
也可以不用随机生成matching,直接在源头生成1-N的random shuffle就行了。
当然可能有的configuration的概率就为0。
avatar
f*e
13
可能我想的太复杂了,还有一个简单办法,先生成一个矩阵
1 2 ...N-1 N
2 3 ... N 1
3 4 ... 1 2
. .
. .
N 1 ... N-2 N-1
然后对行和列做random permutation。

matching

【在 f*****e 的大作中提到】
: 表述有点bug,sorry。
: 只要是k-regular的就会有perfect matching,一开始是(n-1)regular的,记为图1,后
: 来是(n-2),(n-3),...,1 regular的。只要保持图是k-regular的就有perfect matching
: 。
: 以4个点为例:
: 1 (2,3,4)
: 2 (1,3,4)
: 3 (1,2,4)
: 4 (1,2,3)
: 找到一个matching (i,j)=(1,2) (2,1) (3,4) (4,3),然后在图1中删掉(j,i)得到

avatar
m*k
14
NB!

【在 f*****e 的大作中提到】
: 可能我想的太复杂了,还有一个简单办法,先生成一个矩阵
: 1 2 ...N-1 N
: 2 3 ... N 1
: 3 4 ... 1 2
: . .
: . .
: N 1 ... N-2 N-1
: 然后对行和列做random permutation。
:
: matching

avatar
b*d
15

~~~~~~
虽然不知道能否cover所有的解,还是觉得很不错。赞一个。

【在 f*****e 的大作中提到】
: 可能我想的太复杂了,还有一个简单办法,先生成一个矩阵
: 1 2 ...N-1 N
: 2 3 ... N 1
: 3 4 ... 1 2
: . .
: . .
: N 1 ... N-2 N-1
: 然后对行和列做random permutation。
:
: matching

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。