All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Just Math
Sums of floors and fractionals (Posted on 2022-09-18) Difficulty: 3 of 5
Solve the system:

 x  + ⌊y⌋  + {z} = 3.141
⌊x⌋ + {y} + z = 2.718
{x} + y + ⌊z⌋ = 1.618

Where ⌊p⌋ is the floor function and {p} is the fractional part function.

No Solution Yet Submitted by Jer    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 2 of 6 |
syms xf yf zf
for x=0:3
  xi=sym(x);
  for y=0:3
    yi=sym(y);
    for z=0:3
      zi=sym(z);
      eq1=xi+xf+yi+zf==3.141;
      eq2=xi+yf+zi+zf==2.718;
      eq3=xf+yi+yf+zi==1.618;
      a=solve([eq1,eq2,eq3],xf,yf,zf);
      if abs(eval(a.xf))<1 && abs(eval(a.yf))<1 && abs(eval(a.zf))<1
        disp( [eval(xi+a.xf),eval(yi+a.yf),eval(zi+a.zf)] )
   %   fprintf('\n')
      end
    end
  end
end

tries all integer parts of x, y and z from zero through 3, and treats the fractional parts xf, yf and zf as the three unknowns in the three equations.

Found are these sets:

    x              y               z

 2.0205         1.5975          0.1205
 2.0205         0.5975          1.1205  ?? fails second eq
 1.0205         2.5975          0.1205  ?? fails second eq
 1.0205         1.5975          1.1205  ?? fails first eq
 3.0205         1.5975         -0.8795  *
 3.0205         0.5975          0.1205  ?? fails second eq
 2.0205         2.5975         -0.8795  *
 2.0205         1.5975          0.1205  same as first row
 
Those with an asterisk are incorrect for the last equation, as the floor of z is actually -1 in those sets, but was treated as zero in the calculation. 

The questionable ones probably result from negative fractianal parts added to the wrong integral parts.

Indeed, adding the appropriate check:

      if abs(eval(a.xf))<1 && abs(eval(a.yf))<1 && abs(eval(a.zf))<1 ...
          && eval(a.xf)>0  && eval(a.yf)>0  && eval(a.zf)>0 
        disp( [eval(xi+a.xf),eval(yi+a.yf),eval(zi+a.zf)] )

does indeed result in the program showing only that one line.

That's

x = 2.0205; y = 1.5975; z= 0.1205

  Posted by Charlie on 2022-09-18 08:57:01
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information