<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239635</link>
    <title>MATLAB Central Newsreader - making non integer values sum to n</title>
    <description>Feed for thread: making non integer values sum to n</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 20 Nov 2008 23:00:13 -0500</pubDate>
      <title>making non integer values sum to n</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239635#612254</link>
      <author>Tim Smith</author>
      <description>Sorry for previous post it was slightly incorrect:&lt;br&gt;
Can anyone help me with this problem&lt;br&gt;
&lt;br&gt;
where n is divisible by 4 and n,a,b are any real integers such that a+b&amp;lt;(n/2)&lt;br&gt;
&lt;br&gt;
i need to create a statement such that:&lt;br&gt;
&lt;br&gt;
integer((n-a-b)/4) + a + integer((n-a-b)/2) + b + integer((n-a-b)/2) = n&lt;br&gt;
&lt;br&gt;
can anyone help?</description>
    </item>
    <item>
      <pubDate>Fri, 21 Nov 2008 00:19:02 -0500</pubDate>
      <title>Re: making non integer values sum to n</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239635#612276</link>
      <author>John D'Errico</author>
      <description>Tim Smith &amp;lt;imaccormick@gmail.com&amp;gt; wrote in message &amp;lt;17829314.1227222052740.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; Sorry for previous post it was slightly incorrect:&lt;br&gt;
&amp;gt; Can anyone help me with this problem&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; where n is divisible by 4 and n,a,b are any real integers such that a+b&amp;lt;(n/2)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; i need to create a statement such that:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; integer((n-a-b)/4) + a + integer((n-a-b)/2) + b + integer((n-a-b)/2) = n&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; can anyone help?&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
What do you mean by &quot;create a statement&quot;?&lt;br&gt;
&lt;br&gt;
What are you asking for? Do you need to find&lt;br&gt;
values of a and b such that this expression&lt;br&gt;
essentially evaluates as true? If so, then why&lt;br&gt;
not say that?&lt;br&gt;
&lt;br&gt;
Do you need to find a single such set of numbers?&lt;br&gt;
All sets of numbers? Something else? Explain your&lt;br&gt;
problem.&lt;br&gt;
&lt;br&gt;
John</description>
    </item>
    <item>
      <pubDate>Fri, 21 Nov 2008 01:28:19 -0500</pubDate>
      <title>Re: making non integer values sum to n</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239635#612283</link>
      <author>ImageAnalyst</author>
      <description>On Nov 20, 6:00=A0pm, Tim Smith &amp;lt;imaccorm...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Sorry for previous post it was slightly incorrect:&lt;br&gt;
&amp;gt; Can anyone help me with this problem&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; where n is divisible by 4 and n,a,b are any real integers such that a+b&amp;lt;(=&lt;br&gt;
n/2)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; i need to create a statement such that:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; integer((n-a-b)/4) + a + integer((n-a-b)/2) + b + integer((n-a-b)/2) =3D =&lt;br&gt;
n&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; can anyone help?&lt;br&gt;
&lt;br&gt;
------------------------------------------------------------&lt;br&gt;
Why not just do a brute force iteration over all possible combinations&lt;br&gt;
of integers n, a,and b?  I'm sure you'll get a whole boat load of&lt;br&gt;
numbers - more than you could possibly want.  You could probably get&lt;br&gt;
millions of sets in a few seconds.  Have at it.</description>
    </item>
    <item>
      <pubDate>Fri, 21 Nov 2008 04:53:02 -0500</pubDate>
      <title>Re: making non integer values sum to n</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239635#612317</link>
      <author>Roger Stafford</author>
      <description>Tim Smith &amp;lt;imaccormick@gmail.com&amp;gt; wrote in message &amp;lt;17829314.1227222052740.JavaMail.jakarta@nitrogen.mathforum.org&amp;gt;...&lt;br&gt;
&amp;gt; Sorry for previous post it was slightly incorrect:&lt;br&gt;
&amp;gt; Can anyone help me with this problem&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; where n is divisible by 4 and n,a,b are any real integers such that a+b&amp;lt;(n/2)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; i need to create a statement such that:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; integer((n-a-b)/4) + a + integer((n-a-b)/2) + b + integer((n-a-b)/2) = n&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; can anyone help?&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Your query is marred by a lack of clarity, Tim.  Besides the unclear phrase &quot;create a statement&quot; which John has pointed out, you don't make it clear what you mean by &quot;integer&quot; in &quot;integer((n-a-b)/4)&quot;.  You also speak of &quot;real integers&quot;.  What else can an integer be but real?&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;Let's assume that by &quot;integer(x)&quot; you mean the &quot;integer part of&quot; as in Matlab's 'fix' function.  Substituting p for n-a-b in your equation gives the equivalent equation&lt;br&gt;
&lt;br&gt;
&amp;nbsp;fix(p/4) + 2*fix(p/2) = p&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;It is easy to show that there can be only seven possible integer solutions for p here: p = -7, -5, -2, 0, 2, 5, and 7.  However, for each of these there will be infinitely many possible combinations of n, a, and b that would satisfy all your conditions.  For example, n = 12 and any pair of integers, a and b whose sum is 5, of which there are infinitely many, would be solutions.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;In my mind this raises the question as to whether you have stated your problem correctly.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
  </channel>
</rss>

