English 中文(简体)
使用C#系统。 概率算法
原标题:Using C# System.Random for a probabilistic algorithm

请允许我首先指出,我不是C#开发商。 I m a C developer by trade and Options. 但是,我不得不使用视觉C#进行一米的计算。

我正在阅读加密安全假肢机和系统之间的差别。 Random. 每个人都似乎非常清楚的是,RNGCryptoserviceProvider的随机性要大得多,但也比较缓慢。

就我们的集体项目算法而言,我们使用的是特定(固定的)清单中的3个随机点,就像我们25秒一样,在它们之间的道路上用得分。

为了使我们的算法成为“完整”,我们必须确保每一节点都能像所有其他节点那样紧接。 为了使我们的算法成为“最佳”(或尽可能接近,因为我们用近似值重新计算),我们需要在25个第二(或任何其他任意)期限内尽量多地进行校正。

Given that we ll be using a single instance of Random, but that we ll be running a loop that will call Random.Next() 3 times in rapid succession, and which will repeat as many times as possible, will Random produce a reasonably uniform distribution? Or will we need to incur the extra cost of RNGCryptoServiceProvider to ensure we don t have any nodes that get skipped over completely?

最佳回答

兰芒将产生统一分布。 兰多姆的问题是,它具有某种可预测性,从少数随机数字来看,你可以推断出其余随机流。 由于这对你来说是一个问题,而且你只担心统一分配,兰芒应该足够。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签