Likeliness

dannyflint's icon

Hi, This is a simple patch that I made to test that I have got the probability function (not yet included) working correctly.

At the moment, once you click the toggle, 100 bangs trigger the random creation of numbers from 1-4 and the number of each is displayed.

I really need to know what to do in order to make it more likely that say the number 1 is triggered.......... so the results may look like;

1. 56 2. 14 3. 19 4. 11

I have tried using the PROB object and lists & i tables etc. but i don't really get it and its mangling my mind.

Cheers

Danny

4369.Dannysprobabilitytrial1.maxpat
Max Patch
KrisW's icon

you need a list the get from each ? so it carry two numbers ?

edit:
you might want to check [funnel] , [spray] help file . it helps to index carried data !

dannyflint's icon

Ultimately I just want to generate a flow of random numbers (between a specified amount) and be able to control the probability of a chosen number being omitted more often than the rest.

dannyflint's icon

Just seen the edit, cheers for the heads up, i'll have a look at those objects

KrisW's icon

my edit doesnt do what u need . i just did not get the idea at first

KrisW's icon

i might know how to exclude repetitions at all ,but how to control them i would need some time to work it out

Christopher Dobrian's icon

You can use the table object as a probability table (read about the 'bang, 'quantile', and 'fquantile' messages to the table object).

You can also read about it here: Probability distribution

Max Patch
Copy patch and select New From Clipboard in Max.

Here's an example using the numbers you provided

dannyflint's icon

Yes, That's the sorta thing.

I gotta try n figure out how to incorporate it in to the patch.

Will that way allow me to still use the random object as my source, but just incude a 'weighting' that favours 1 over 2,3 & 4 say (preferably with a variable degree; perhaps 100 would represent 100 1s every hundred bangs and 0 no 1s, just 2s 3s & 4s)

I hope you get what i mean

Thanks so much. all of your efforts are massively appreciated. Hopefully 1 day i'll be able to help someone figure something out :)

ak's icon

@OP: Max Basic Tutorial 17 can answer many your questions... :)

dannyflint's icon

I've worked it out I think, thanks :)

dannyflint's icon

here's the patch now

4370.Dannysprobabilitytesteranswered.png
png