The Student Room Group

D1 Flow Diagram Question


What does INT(0.5(I + J)) given the largest integer is less than/equal to 0.5(I + J) mean?
(edited 8 years ago)
Original post by TSRforum

What does INT(0.5(I + J)) given the largest integer is less than/equal to 0.5(I + J) mean?


INT(x) means the smallest integer less than or equal to x. ie. INT(1.5) = 1, INT (2) = 2, INT(Pi) = 3.
Original post by TSRforum

What does INT(0.5(I + J)) given the largest integer is less than/equal to 0.5(I + J) mean?


INT takes the whole number part of a decimal value. It truncates rather than rounds. So INT (6.5) would give 6 and not 7.
Reply 3
Original post by maggiehodgson
INT takes the whole number part of a decimal value. It truncates rather than rounds. So INT (6.5) would give 6 and not 7.


What does J := N mean? And how would I go about illustrating the Steps in a table?
Original post by TSRforum

What does INT(0.5(I + J)) gives the largest integer is less than/equal to 0.5(I + J) mean?


well if I + J = an even number then INT(0.5(I + J)) would return(0.5(I + J)).

If I + J is not an even number then INT(0.5(I + J)) would return the whole number part of(0.5(I + J))

For instance if I was 5 and J was 6 then INT(0.5(I + J)) would return the whole number part of 5.5, which is 5 ?
Reply 5
Original post by the bear
well if I + J = an even number then INT(0.5(I + J)) would return(0.5(I + J)).

If I + J is not an even number then INT(0.5(I + J)) would return the whole number part of(0.5(I + J))

For instance if I was 5 and J was 6 then INT(0.5(I + J)) would return the whole number part of 5.5, which is 5 ?


What does J := N mean? And how would I go about illustrating the Steps in a table?


Sent from my iPhone using Tapatalk
Original post by TSRforum
What does J := N mean? And how would I go about illustrating the Steps in a table?


if there are 11 items to be searched then J would be set to 11 ?
Original post by TSRforum
What does J := N mean? And how would I go about illustrating the Steps in a table?


From my understanding of a binary search you find the number of element is the list you are going to search and find the middle number in that list.

If the number is less that that, then you know you have to search in the top half of the list and you then make that top half your new list. Otherwise you make the bottom half your new list.

The I and J and N are probably the first element, the last element and the middle element of your current list.

eg. if your ordered list was 1,3,5,7,9,10,12,18,73 and you were searching for number 9

You have 7 elements in the list so you find the middle number INT(9/2) = 4. You find element 4 and it's 7 so it's too small. So you know you have to look in the second half of the list. ie 9,10,12,18,73. This has got 5 element so INT(5/2) = 2 and you look at element 2 in this list. It's 10 which is too big. So you have to look in the top half of that list. That list is 9,10 and so on and so on.

I hope this helps you to decipher the code.
Reply 8
Original post by maggiehodgson
From my understanding of a binary search you find the number of element is the list you are going to search and find the middle number in that list.

If the number is less that that, then you know you have to search in the top half of the list and you then make that top half your new list. Otherwise you make the bottom half your new list.

The I and J and N are probably the first element, the last element and the middle element of your current list.

eg. if your ordered list was 1,3,5,7,9,10,12,18,73 and you were searching for number 9

You have 7 elements in the list so you find the middle number INT(9/2) = 4. You find element 4 and it's 7 so it's too small. So you know you have to look in the second half of the list. ie 9,10,12,18,73. This has got 5 element so INT(5/2) = 2 and you look at element 2 in this list. It's 10 which is too big. So you have to look in the top half of that list. That list is 9,10 and so on and so on.

I hope this helps you to decipher the code.


I know how to carry out the steps but how do I demonstrate it (organise it) when writing it out...?


Sent from my iPhone using Tapatalk
Original post by TSRforum
I know how to carry out the steps but how do I demonstrate it (organise it) when writing it out...?


Sent from my iPhone using Tapatalk

I would make a table with the variables I J M and X as column headers and STEP1 STEP 2 etc as needed (ie. only those steps that change the variables). Filling variable as they change

eg -----------I-----J-----------M---------X
step1-------1---- 8
step3---------------------------4
step5-------5

etc,

However, I suspect the method required is different from exam board to exam board and looking a past paper mark schemes might give you a better idea.
(edited 8 years ago)
Reply 10
Original post by maggiehodgson
I would make a table with the variables I J M and X as column headers and STEP1 STEP 2 etc as needed (ie. only those steps that change the variables). Filling variable as they change

eg -----------I-----J-----------M---------X
step1-------1---- 8
step3---------------------------4
step5-------5

etc,

However, I suspect the method required is different from exam board to exam board and looking a past paper mark schemes might give you a better idea.


Thanks I am guessing in the exam they already give me a table which I have to fill in


Sent from my iPhone using Tapatalk
Original post by TSRforum
Thanks I am guessing in the exam they already give me a table which I have to fill in


Sent from my iPhone using Tapatalk


AQA didn't
Reply 12
Original post by maggiehodgson
AQA didn't


I am with OCR (:


Sent from my iPhone using Tapatalk

Quick Reply

Latest