Link to home
Start Free TrialLog in
Avatar of hidrau
hidrauFlag for Brazil

asked on

I need a help with math and code

Hello guys,

I have a table in access with 1200 words,

In a stringGrid I need to have column with 16 words. Each Column will be a group with
16 words.

but the problem is, From 3 group created, each group created must have 60 % of words
in previous groups created.

With my math 1200 words with + 60 % of repeated words I will have a total of 1920 split in
120 column

this example can be made with number

thanks

Avatar of LordWolfy
LordWolfy
Flag of United Kingdom of Great Britain and Northern Ireland image


Your question really could be a lot clearer.

60% of 16 is 9.6 - so if you if you need at least 60% (I'm assuming at least rather than exactly), then at least 10 of youre previous group of 16 will have to be duplicated (is there a rule for this or do you just take any 10??)

By this logic, the minimum number of words you will have is 1200 + (((1200 / 16) - 1) * 10)
= 1200 + 740
= 1940

Minimum number of columns = 1940 / 16 = 121.25
rounded up = 122 with the free space filled by virtue of it being at least 60% instead of exactly.

You also said  'From 3 group created'.  What does that mean?  If that has a bearing on the process and calculations then these figures will probably be completely off.
Avatar of hidrau

ASKER

Hello LordWolfy,

I am gonna try to clear my question better. Sorry my mistakes in english, ok :))

Imagine something like this:

I have a edit that you enter the percent of repeated word for each group.

The repeated words will be repeated from my 3 group, that is,
after creating 3 goups with this sequence:

Group A [ 1..16]
Group B [ 17..32 ]
Group C [ 33..49 ]

Now, other groups will be created with a percent from previous groups, that is:

Group D will have a little of my group A - B - C

Group E will have a little of my group A - B - C - D

Group F will have a little of my group A - B - C - D - E

and so on


Well, if I will have an increase of 740 repeated words or number on my 1200 words, then I will need
split all the 1940 words into 122 groups. If I have a percent less than 60, obvisouly I will have a less
group of words.

Did you get it?
The example easily gets out of hand...

If group A has 16 words, group B has 16 words, and group C has 16 words to start...

  You want to go to group D (and later) and take at least 60 % of it's values from the previous groups without going over 16 in each...

  You would rapidly get into a situation where you cannot take a value from each group because you are only allowed 16.

  If We are only filling in "at least 60%" from the previous columns, where do we get the rest of the words to fill in?  Generate them from a simple number counter?

  If you are ok with only getting 10 from previous columns, how are they chosen?  could you take 3 from A, 3 from B, none from C, and 4 from D to get the 10 for group E?   A simple random routine could randomly grab words from columns if there is no issue with getting more than one from the same column while filling another column.

  For that matter, do you want to make sure that - as we pull out words - one word is pulled out only once for the entire run?

Sorry, but we need more info!
Avatar of hidrau

ASKER

Sorry for the delay of my reply.

Well, i think it is missing information about what I am trying to do. I am gonna describe what I need to do and you will be able to give a better solution to accomplish it.

I have a database of picture with 1064 pictures inside.

I need assemble groups of 16 pictures, I could split those images into the groups. But I need something different.

So, imagine this situation:

I start my first lesson (first group of 16 images), after studying them I can start another lesson and so on.

When I am at 6 lesson, I would like to have some pictures in my new groups from past groups studied, maybe 40 % of my 16 pictures will be from those images that I already studied. I also thought in having groups formed from images that I already studied, then I will have a group with 100% of studied images.

So it could be

For each 6 groups studied I will have one or two groups with only images studied.
I need to informa the system that after X studied groups I want some pictures from repeated
studied groups.

All those can be made with number that will represent the ID of each image

Did you get it?
From what you explained this is the general idea for each set of 6 lessons...
Lesson1 new images
Lesson2 new images
Lesson3 new images
Lesson4 new images
Lesson5 new images
Lesson6 40% from lessons 1-5 the rest new.

Is this correct?  and, if it is correct, would you want lesson 7 to contain only images not in lessons 1-6?

Let me know
Avatar of hidrau

ASKER

Yeah it is correct,

Lesson6 must have some repeated images from those lessons studied as a random reinforce.

After lesson6, each lesson is gonna get 40 % from past lessons and so on. But it is interresting another
way, see below.

 if I could have for each 5 lesson created two lesson with only repeated images from my past lessons, so, an example:

Lesson1 new images
Lesson2 new images
Lesson3 new images
Lesson4 new images
Lesson5 new images

Lesson6 100 % of images from all past lesson [1..5]
Lesson7 100 % of images from all past lesson [1..5]

Lesson8 new images
Lesson9 new images
Lesson10 new images
Lesson11 new images
Lesson12 new images

Lesson13 100 % of images from all past lesson [1..12]
Lesson14 100 % of images from all past lesson [1..12]

What I told you above, it is another example different from the first one that I asked.
So, let's see now the original order


Lesson1 new images
Lesson2 new images
Lesson3 new images
Lesson4 new images
Lesson5 new images

Lesson6 40 % from lessons[1.5] and more new images
Lesson7 40 % from lessons[1.6] and more new images
Lesson7 40 % from lessons[1.7] and more new images

developmentguru, it is my ideia about, but you can give me your opinion on this. So fee free
ASKER CERTIFIED SOLUTION
Avatar of developmentguru
developmentguru
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The math ;-)
n - number of pictures each lesson
x - lessons before the start repeating images
p - the fraction of images that should be repeats in stead of new ones
t - the total number of images

before repeats: x * n new images
with repeats: (1 - p) * n per lesson

lessons needed:
lessons needed for whole course = x + (t - (x * n)) / ((1 - p) * n)

So for 1200 images start after 3 lessons with 0.6 repeats and 16 images per lesson:
3 + (1200 - 16*3) / (0.4*16) = 183 lessons

Its discreet math though :S
Avatar of hidrau

ASKER

thanks