mersenneforum.org  

Go Back   mersenneforum.org > Fun Stuff > Lounge

Reply
 
Thread Tools
Old 2016-12-03, 01:56   #1
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

111100010112 Posts
Default Binary Multitasking

Hi,
Most of my life I have been struggling with coming up with a scheduling system to be a balanced approach to concentrating on high priority tasks as well as providing time allocation to lower priority tasks. One of the best methods I have come up with is binary multitasking.
Essentially you go through a list of tasks as if they were binary digits, incrementing by 1.
This way one would spend about 1/2 the total time on the 1st task, 1/4 on 2nd and so on.
The problem with this method is that for lists longer than say 10 or so tasks virtually no time ends up being allocated to the tasks at the bottom.
* Is there a way to increment a binary register with a constant value greater than one such that all binary digits are set at least once?
If not, is there any formulaic simple parameter?
Thanks in advance.

ETA I assume any prime number greater than the number of the elements in the list would serve the purpose, but would such a solution end up being equivalent to incrementing 1 or would allocate more time to the items lower in the list?

Last fiddled with by a1call on 2016-12-03 at 02:28
a1call is offline   Reply With Quote
Old 2016-12-03, 03:25   #2
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

1,931 Posts
Default

I think it would be more accurate to phrase it am as:
ETA I assume any prime number equal to the number of the items in the list would serve the purpose, but would such a solution end up being equivalent to incrementing 1 or would allocate more time to the items lower in the list?
a1call is offline   Reply With Quote
Old 2016-12-03, 16:16   #3
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

1,931 Posts
Default

Here is a pseudocode for clarification:

My array tasks[26]
forstep (j=0, 2197, step =13)
. {
. Print j in binary
. Flag=0
. Exp=0
. While(flag=0)
. {
. Exp= exp +1
. If(j/(2^ exp)==j\(2^ exp))
. {
. Tasks[Exp]=+
. Flag=1
. }
. }
. }

For (k=1,26)
. {
. Print tasks[k]
. }


I would expect only tasks 1 to 13 to be nonzero and equal to the value if the step was equal to 1

Last fiddled with by a1call on 2016-12-03 at 16:18
a1call is offline   Reply With Quote
Old 2016-12-03, 17:44   #4
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

78B16 Posts
Default

Too late to edit so posing with corrections:


Here is a pseudocode for clarification:

My array tasks[26]
forstep (j=0, 2197, step =13)
. {
. Print j in binary
. Flag=0
. Exp=0
. While(flag=0)
. {
. Exp= exp +1
. If(j/(2^ exp)!=j\(2^ exp))
. {
. Tasks[Exp]=+
. Flag=1
. }
. }
. }

For (k=1,26)
. {
. Print tasks[k]
. }


I would expect only tasks 1 to 13 to be nonzero and equal in proportion to total, to the value if the step was equal to 1
a1call is offline   Reply With Quote
Old 2016-12-03, 18:30   #5
science_man_88
 
science_man_88's Avatar
 
"Forget I exist"
Jul 2009
Dumbassville

836910 Posts
Default

Quote:
Originally Posted by a1call View Post
Too late to edit so posing with corrections:


Here is a pseudocode for clarification:

My array tasks[26]
forstep (j=0, 2197, step =13)
. {
. Print j in binary
. Flag=0
. Exp=0
. While(flag=0)
. {
. Exp= exp +1
. If(j/(2^ exp)!=j\(2^ exp))
. {
. Tasks[Exp]=+
. Flag=1
. }
. }
. }

For (k=1,26)
. {
. Print tasks[k]
. }


I would expect only tasks 1 to 13 to be nonzero and equal in proportion to total, to the value if the step was equal to 1
tried to make an equivalent PARI/gp code:

Code:
my(task=vector(26));forstep (j=0, 2197,13,print(binary(j));Flag=0;Exp=0;while(Flag==0,Exp+=1;if(j/(2^Exp)!=j\(2^Exp),task[Exp]+=1;Flag=1)));for(k=1,26,print(task[k]","k))
once I got it all equivalent without changing case it basically only printed once before I lost patience.edit:of course only j that aren't divisible by powers of two will happen to be increased in task okay something still doesn't allow it to compute any being worked ot 1

Last fiddled with by science_man_88 on 2016-12-03 at 18:52
science_man_88 is offline   Reply With Quote
Old 2016-12-03, 19:09   #6
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

1,931 Posts
Default

Quote:
Originally Posted by science_man_88 View Post
tried to make an equivalent PARI/gp code:

Code:
my(task=vector(26));forstep (j=0, 2197,13,print(binary(j));Flag=0;Exp=0;while(Flag==0,Exp+=1;if(j/(2^Exp)!=j\(2^Exp),task[Exp]+=1;Flag=1)));for(k=1,26,print(task[k]","k))
once I got it all equivalent without changing case it basically only printed once before I lost patience.edit:of course only j that aren't divisible by powers of two will happen to be increased in task okay something still doesn't allow it to compute any being worked ot 1
Please consider the code case insensitive.
The uppercase is inevitably substituted by my swipes keyboard.
a1call is offline   Reply With Quote
Old 2016-12-03, 19:30   #7
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

593310 Posts
Default

More generally, choose any 0 < p < 1 and put 1 - p, p(1 - p), p^2(1 - p), ... effort into each task. For example, with p = 2/3, you put a third of your effort into the first task, 22% into your second, 15% into your third, 9.9% into your fourth, 6.6% into your fifth, etc.

Last fiddled with by CRGreathouse on 2016-12-03 at 19:34
CRGreathouse is offline   Reply With Quote
Old 2016-12-03, 19:34   #8
xilman
Bamboozled!
 
xilman's Avatar
 
"π’‰Ίπ’ŒŒπ’‡·π’†·π’€­"
May 2003
Down not across

3×11×307 Posts
Default

Quote:
Originally Posted by a1call View Post
Hi,
Most of my life I have been struggling with coming up with a scheduling system to be a balanced approach to concentrating on high priority tasks as well as providing time allocation to lower priority tasks.
My approach is to use structured procrastination.

If you find there is something you are not doing which ought to be done, find something else that needs to be done and don't do that instead.

Works for me.

Last fiddled with by xilman on 2016-12-03 at 21:03
xilman is offline   Reply With Quote
Old 2016-12-03, 21:20   #9
a1call
 
a1call's Avatar
 
"Rashid Naimi"
Oct 2015
Remote to Here/There

36138 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
More generally, choose any 0 < p < 1 and put 1 - p, p(1 - p), p^2(1 - p), ... effort into each task. For example, with p = 2/3, you put a third of your effort into the first task, 22% into your second, 15% into your third, 9.9% into your fourth, 6.6% into your fifth, etc.
That is the sort of thing I am looking for, to distribute more of the total time to lower priority items. I also think what you are proposing is equivalent to adding 1 and multitasking in bases less than 2 such as average/floor of the counter in base 1.5.
I will need more time to wrap my head around that.
a1call is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
CUDALucas: which binary to use? Karl M Johnson GPU Computing 15 2015-10-13 04:44
Would you use a 'fat binary' of GMP-ECM? jasonp GMP-ECM 8 2012-02-12 22:25
How to build a binary of SVN183? Andi47 Msieve 12 2010-02-01 19:30
2-d binary representation only_human Miscellaneous Math 9 2009-02-23 00:11
Convert Binary to BCD code tinhnho Miscellaneous Math 8 2005-09-18 15:14

All times are UTC. The time now is 10:48.

Sat Oct 31 10:48:29 UTC 2020 up 51 days, 7:59, 2 users, load averages: 2.52, 2.31, 2.09

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.