Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Prove that if n is an integer, then[n/2]=n/2 if n is even and(n1)/2 if nis odd

Short Answer

Expert verified

The proof is

If n is even, then[n/2]=n/2

If n is odd, then[n/2]=(n1)/2

Step by step solution

Achieve better grades quicker with Premium

  • Unlimited AI interaction
  • Study offline
  • Say goodbye to ads
  • Export flashcards

Over 22 million students worldwide already upgrade their learning with Vaia!

01

Step 1:

Floor function [x] : largest integer that is less than or equal to x.

02

Step 2:To prove:

If n is even, then[n/2]=n/2

If n is odd, then[n/2]=(n1)/2

FIRST CASE

Let n be even. Then there exist an integer k such that n = 2k .

n2=2k2=k

The ceiling function of an integer is the integer itself.

n/2=k=k=n/2

03

Step 3:

SECOND CASE

Let n be odd. Then there exist an integer k such thatn=2k+1 .

n2=2k+12=k+12

since k is an integerk+12 is not an integer and thusn2 is not an integer.

k<k+12<k+1

Sincen2=k+12

k<n2<k+1

The floor function of x is then the smaller integer from the inequality

n2=k

Since or equivalentlyk=n12

n2∣=n12

Hence, the solution is

If n is even, then[n/2]=n/2

If n is odd, then[n/2]=(n1)/2

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Study anywhere. Anytime. Across all devices.

Sign-up for free