My Math Forum (http://mymathforum.com/math-forums.php)
-   Elementary Math (http://mymathforum.com/elementary-math/)
-   -   application of even and odd number (http://mymathforum.com/elementary-math/343670-application-even-odd-number.html)

 integration March 19th, 2018 02:22 AM

application of even and odd number

Hello
I am learning programming; what is application of even and odd number?

 studiot March 19th, 2018 03:22 AM

Although you have posted this in elementary maths I assume you know what even and an odd numbers are.

So you know some properties of each that are different?

You also mention that you are studying programming so I assume you are looking for applications in programming?

Programming is about the development of the logic of the situation. It follows precise rules.

So answering this question should help exercise your logical thinking processes.

Now every even number can be divided by 2 so every even number has at least one factor.

But only some odd numbers have factors.

This means that only even numbers can be guaranteed to be able to be divided into equal parts.
In particular in programming this is important in searching - one of the most important process in programming.

Because programmed systems spend a lot of time searching for stuff, it is important to make these searches as efficient as possible.

One efficient search method is called the binary search (hah did you spot binary means 2?)
Here we split the search into two halves and find which half contains the target.
Then we repeat.
And repeat
and repeat
Narrowing down the search until we find the target.

Does this help?

 integration March 19th, 2018 04:03 AM

hi
this help me a lot sir.
and does it work with even odd signal

 Denis March 19th, 2018 09:36 AM

Quote:
 Originally Posted by integration (Post 590243) ...and does it work with even odd signal
You're not "clear" :ninja:

Do you mean an even number in an odd position?

 integration March 19th, 2018 11:25 PM

i want to know where we use even number and odd number

 AngleWyrm2 March 20th, 2018 10:16 AM

Quote:
 Originally Posted by integration (Post 590239) hello i am learning programming what is application of even and odd number
• Flipping a coin
• Sorting pages into front and back for a print operation
• Categorizing results as match/mismatch with some expected value

 Denis March 20th, 2018 10:24 AM

If you owe me \$10 and pay me back, then we're "even"!
If you don't agree with me, then you're "at odds" with me :)

 integration March 21st, 2018 01:53 AM

Quote:
 Flipping a coin Sorting pages into front and back for a print operation

 weirddave March 21st, 2018 06:55 AM

Quote:
 Originally Posted by integration (Post 590453) please explain more
All of the odd pages are printed on the first side of the sheet, all the even pages are printed on the other side.

 AngleWyrm2 March 21st, 2018 07:52 AM

Quote:
 Originally Posted by integration (Post 590453) please explain more
Code:

```PageCollection[2] sortedPages; // two sets of pages for( int thisPage = 0; thisPage < GetPageCount(); thisPage++){   sortedPages[ Mod(thisPage, 2) ].Add( GetPage(thisPage) ); }```

All times are GMT -8. The time now is 01:19 PM.