<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.3" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Creating Random Numbers in FileMaker</title>
	<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/</link>
	<description>smart business solutions</description>
	<pubDate>Thu, 04 Dec 2008 21:35:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<item>
		<title>By: Thomas Seidler</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-1330</link>
		<dc:creator>Thomas Seidler</dc:creator>
		<pubDate>Sat, 08 Nov 2008 16:14:05 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-1330</guid>
		<description>Let(
    Num = Int ( Random * ( Maximum - Minimum + 1 ) ) + Minimum;
    Min(result; stop);
  )

would be your tight solution, but i like it clear to my head...</description>
		<content:encoded><![CDATA[<p>Let(<br />
    Num = Int ( Random * ( Maximum - Minimum + 1 ) ) + Minimum;<br />
    Min(result; stop);<br />
  )</p>
<p>would be your tight solution, but i like it clear to my head&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Seidler</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-1329</link>
		<dc:creator>Thomas Seidler</dc:creator>
		<pubDate>Sat, 08 Nov 2008 16:11:10 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-1329</guid>
		<description>@AB you're a funny guy! ;)

How about this (no recursion):

// works for -10 to -1, 1 to 10, -5 to 4 etc
Let(
[
range = stop-start+1;
range_result = Int(Random*range);
result = range_result + start
];

// necessary in event of Random=1
Min(result; stop)
)


The maths works fine. Blessings, t</description>
		<content:encoded><![CDATA[<p>@AB you&#8217;re a funny guy! <img src='http://sixfriedrice.com/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>How about this (no recursion):</p>
<p>// works for -10 to -1, 1 to 10, -5 to 4 etc<br />
Let(<br />
[<br />
range = stop-start+1;<br />
range_result = Int(Random*range);<br />
result = range_result + start<br />
];</p>
<p>// necessary in event of Random=1<br />
Min(result; stop)<br />
)</p>
<p>The maths works fine. Blessings, t</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AB</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-1291</link>
		<dc:creator>AB</dc:creator>
		<pubDate>Tue, 09 Sep 2008 13:30:44 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-1291</guid>
		<description>I am trying to creat a phone service for a village where I was born, about 7000 people live in the village I know that, simple devices like ring generetor and cheap phones can creat an intercom and by adding more devices I can expand the band and quantity of phone lines but I don't know how to give a number to my phones.
 
   First I want to try it on few sets of phones then expand it, Please help me creat numbers for my custom intercoms then I will try to use that example to create 4-6 digit numbers for my planed local phone service.

Thanks</description>
		<content:encoded><![CDATA[<p>I am trying to creat a phone service for a village where I was born, about 7000 people live in the village I know that, simple devices like ring generetor and cheap phones can creat an intercom and by adding more devices I can expand the band and quantity of phone lines but I don&#8217;t know how to give a number to my phones.</p>
<p>   First I want to try it on few sets of phones then expand it, Please help me creat numbers for my custom intercoms then I will try to use that example to create 4-6 digit numbers for my planed local phone service.</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: O Homan</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-1184</link>
		<dc:creator>O Homan</dc:creator>
		<pubDate>Thu, 05 Jun 2008 10:32:00 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-1184</guid>
		<description>How about some more complicated problem then: how do I generate (let's say) 10 or 20 random numbers between Minimum and (again, say) Maximum, with the restriction that each random number occurs only once? Or in other words, create 5 random numbers between 1 and 10 and number 3 or 6 or whatever may *not* occur more than once?</description>
		<content:encoded><![CDATA[<p>How about some more complicated problem then: how do I generate (let&#8217;s say) 10 or 20 random numbers between Minimum and (again, say) Maximum, with the restriction that each random number occurs only once? Or in other words, create 5 random numbers between 1 and 10 and number 3 or 6 or whatever may *not* occur more than once?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J Wenmeekers</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-182</link>
		<dc:creator>J Wenmeekers</dc:creator>
		<pubDate>Tue, 17 Jul 2007 00:42:57 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-182</guid>
		<description>&lt;p&gt;Well...you have to thank my 80+ year old father.
As engineer he's constantly checking my coding (and still hit me on the head when there's something wrong :-), according to him.&lt;/p&gt;

&lt;p&gt;It was his question (...and what if the random is zero (slap), and don't tell me it will never happen, code around it or your (* 10) will be zero too !(hit/slap)) that made me check every possible source.
(I still not always believe the old man...I better should....)&lt;/p&gt;

&lt;p&gt;It seems that some RNG's include 0 but exclude 1, while others include or exclude both.
And Filemaker includes both....&lt;/p&gt;

&lt;p&gt;Meanwhile we keep on FileMaking.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well&#8230;you have to thank my 80+ year old father.<br />
As engineer he&#8217;s constantly checking my coding (and still hit me on the head when there&#8217;s something wrong :-), according to him.</p>
<p>It was his question (&#8230;and what if the random is zero (slap), and don&#8217;t tell me it will never happen, code around it or your (* 10) will be zero too !(hit/slap)) that made me check every possible source.<br />
(I still not always believe the old man&#8230;I better should&#8230;.)</p>
<p>It seems that some RNG&#8217;s include 0 but exclude 1, while others include or exclude both.<br />
And Filemaker includes both&#8230;.</p>
<p>Meanwhile we keep on FileMaking.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Head</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-178</link>
		<dc:creator>David Head</dc:creator>
		<pubDate>Mon, 16 Jul 2007 22:13:31 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-178</guid>
		<description>&lt;p&gt;Well that makes the Random function in FileMaker different to every other random function! That's a bit strange. Oh well thanks for the clarification and information straight from the horse's mouth.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well that makes the Random function in FileMaker different to every other random function! That&#8217;s a bit strange. Oh well thanks for the clarification and information straight from the horse&#8217;s mouth.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Coffey</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-175</link>
		<dc:creator>Geoff Coffey</dc:creator>
		<pubDate>Mon, 16 Jul 2007 20:34:33 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-175</guid>
		<description>&lt;p&gt;A few clarifications: The rarity of zero is pretty irrelevant since this technique uses the &lt;code&gt;Int&lt;/code&gt; function. If your range is 10, for example, then &lt;em&gt;any&lt;/em&gt; result from &lt;code&gt;Random&lt;/code&gt; between 0.0 and 0.09999999999999999999 will produce the same final output. It is just as likely as any other number.&lt;/p&gt;

&lt;p&gt;It is the rarity of one that causes a problem (again because of the use of &lt;code&gt;Int&lt;/code&gt; -- if we used &lt;code&gt;Ceil&lt;/code&gt; instead, we'd have exactly the opposite problem). If you let a &lt;code&gt;1&lt;/code&gt; result from &lt;code&gt;Random&lt;/code&gt; yield your top value, you will almost never get that value. It will be much more unlikely than all the other values, making for a lousy random number generator. So we had to let &lt;code&gt;1&lt;/code&gt; produce a bogus (ie: out of range) result, check for it, and redo as needed.&lt;/p&gt;

&lt;p&gt;You could argue this is overkill since the likelihood of a 1 is so small (it really is absurdly small). But since this is a custom function you write once and tuck away for easy use later, it may as well be as perfect as possible. And it sure was fun to figure out :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>A few clarifications: The rarity of zero is pretty irrelevant since this technique uses the <code>Int</code> function. If your range is 10, for example, then <em>any</em> result from <code>Random</code> between 0.0 and 0.09999999999999999999 will produce the same final output. It is just as likely as any other number.</p>
<p>It is the rarity of one that causes a problem (again because of the use of <code>Int</code> &#8212; if we used <code>Ceil</code> instead, we&#8217;d have exactly the opposite problem). If you let a <code>1</code> result from <code>Random</code> yield your top value, you will almost never get that value. It will be much more unlikely than all the other values, making for a lousy random number generator. So we had to let <code>1</code> produce a bogus (ie: out of range) result, check for it, and redo as needed.</p>
<p>You could argue this is overkill since the likelihood of a 1 is so small (it really is absurdly small). But since this is a custom function you write once and tuck away for easy use later, it may as well be as perfect as possible. And it sure was fun to figure out <img src='http://sixfriedrice.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Antunes</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-173</link>
		<dc:creator>Jesse Antunes</dc:creator>
		<pubDate>Mon, 16 Jul 2007 19:23:49 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-173</guid>
		<description>&lt;p&gt;@David - I thought the exact same thing as you... and I originally built my function accordingly, but then I emailed the guys who wrote the &lt;code&gt;Random&lt;/code&gt; function for FileMaker and was told exactly what Wenmeekers confirmed.  Random does indeed include zero and 1.  It's REALLY annoying because it adds an extra step to our calculation.  If your are ok with your random number being wrong 1 in 100,000,000,000,000,000,000.... then don't worry about it ;-).  Quite frankly that margin of error seems acceptable.&lt;/p&gt;

&lt;p&gt;@Wenmeekers - Thanks for clarifying that...  I always forget about the Knowledge Base!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>@David - I thought the exact same thing as you&#8230; and I originally built my function accordingly, but then I emailed the guys who wrote the <code>Random</code> function for FileMaker and was told exactly what Wenmeekers confirmed.  Random does indeed include zero and 1.  It&#8217;s REALLY annoying because it adds an extra step to our calculation.  If your are ok with your random number being wrong 1 in 100,000,000,000,000,000,000&#8230;. then don&#8217;t worry about it ;-).  Quite frankly that margin of error seems acceptable.</p>
<p>@Wenmeekers - Thanks for clarifying that&#8230;  I always forget about the Knowledge Base!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Wenmeekers</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-172</link>
		<dc:creator>Wenmeekers</dc:creator>
		<pubDate>Mon, 16 Jul 2007 17:15:59 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-172</guid>
		<description>&lt;p&gt;...and the FileMaker Knowledge Base says:&lt;/p&gt;

&lt;p&gt;The "Random" function returns "a random number between zero and one" including "zero and one".&lt;/p&gt;

&lt;p&gt;Answer ID : 5464&lt;/p&gt;

&lt;p&gt;So it could be that sooner or later there will be a zero or one.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>&#8230;and the FileMaker Knowledge Base says:</p>
<p>The &#8220;Random&#8221; function returns &#8220;a random number between zero and one&#8221; including &#8220;zero and one&#8221;.</p>
<p>Answer ID : 5464</p>
<p>So it could be that sooner or later there will be a zero or one.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Head</title>
		<link>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-169</link>
		<dc:creator>David Head</dc:creator>
		<pubDate>Mon, 16 Jul 2007 15:46:43 +0000</pubDate>
		<guid>http://sixfriedrice.com/wp/creating-random-numbers-in-filemaker-pro/#comment-169</guid>
		<description>&lt;p&gt;I don't believe that the Random function will ever return zero or one. This is common for all random number generators which, by the way, are not really random at all.&lt;/p&gt;

&lt;p&gt;The FileMaker Help says the Random function 'Returns a random number between zero and one' which is confusing but means 'not including zero or one'.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I don&#8217;t believe that the Random function will ever return zero or one. This is common for all random number generators which, by the way, are not really random at all.</p>
<p>The FileMaker Help says the Random function &#8216;Returns a random number between zero and one&#8217; which is confusing but means &#8216;not including zero or one&#8217;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
