2023.2.23 闲话

19:03 SoyTony

Hey Jude / Beatles

Hey Jude don't make it bad

Take a sad song and make it better

Remember to let her into your heart

Then you can start to make it better

Hey Jude don't be afraid

You were made to go out and get her

The minute you let her under your skin

Then you begin to make it better

And anytime you feel the pain hey Jude refrain

Don't carry the world upon your shoulders

For well you know that it's a fool who plays it cool

By making his world a little colder

Na na na na na na na na na

Hey Jude don't let me down

You have found her now go and get her

Remember to let her into your heart

Then you can start to make it better

So let it out and let it in hey Jude begin

You're waiting for someone to perform with

And don't you know that it's just you hey Jude you'll do

The movement you need is on your shoulder

Na na na na na na na na na

Hey Jude don't make it bad

Take a sad song and make it better

Remember to let her under your skin

Then you'll begin to make it

Better better better better better better oh

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude

Na na na na na na na na na na na hey Jude


现在我这闲话感觉是真的有「闲」的感觉了(

我的观点是这个风格有点 EI「营业日志」的味道了,不过难度肯定是远远比不上


定义 \(v_2(x)\)\(x\) 中因子 \(2\) 的数量,\(c_2(x)\)\(x\) 在 2 进制下非 \(0\) 位的数量 .

则有

睿智恒等式 II

\[v_2(x!)+c_2(x)=x \]

其实我不想叫这个睿智恒等式的,不过实在是太睿智了 .

\(h(x)=v_2(x!)+c_2(x)\),考虑证明 \(h(x+y)=h(x)+h(y)\),这和原命题等价 .

第一种思路:

\(a\circ b\) 为计算 \(a+b\) 时在 2 进制下的进位次数 .

那么根据定义可以导出 \(a\circ b=c_2(a)+c_2(b)-c_2(a+b)\) .

又根据 Kummer 定理,\(a\circ b=v_2\left(\dbinom{a+b}a\right)=v_2((a+b)!)-v_2(a!)-v_2(b!)\) .

于是有 \(c_2(a)+c_2(b)-c_2(a+b)=v_2((a+b)!)-v_2(a!)-v_2(b!)\),移项即得 \(h(x+y)=h(x)+h(y)\),证毕 .

第二种思路:

注意到 \(v_2(x)\) 的组合意义其实就是 2 进制下末尾 \(0\) 的个数(在 GNU C++ 表现为 __builtin_ctz),这样我们就把 \(v_2\)\(c_2\) 统一到了同一个模型(2 进制).

考察 \(c_2(x-1)\)\(x-1\) 其实就是把末尾的 \(0\) 全翻转了,于是可以得到 \(c_2(x-1)=c_2(x)+v_2(x)-1\) .

于是 \(v_2(x)+c_2(x)-c_2(x-1)=-1\) 为定值 .

自然可得 \(v_2(a+b)+c_2(a+b)-c_2(a+b-1)=v_2(a)+c_2(a)-c_2(a-1)\) .

\(v_2(x)\) 换成 \(v_2(x!)-v_2((x-1)!)\),即可得到 \(h(a+b)-h(a+b-1)=h(a)-h(a-1)\),即 \(h(a+b)-h(a+b-1)=h(a)+h(b)-h(a-1)-h(b)\) .

类似地,可以得到 \(h(a+b)-h(a+b-1)=h(a)+h(b)-h(a)-h(b-1)\) .

这相当于导出了 \((a,b)\to(a,b+1)\)\((a,b)\to(a+1,b)\) 的推导路线,\(a=b=0\) 显然成立然后归纳即可,证毕 .

不觉得这很酷吗?作为一名 OIer,我觉得这太酷了,很符合我对位运算的想象,科技并带着趣味

posted @ 2023-02-23 17:12  Jijidawang  阅读(98)  评论(5编辑  收藏  举报
😅​