Find mean of random numbers

How can I get the mean for line 7 without manually pressing the randomize button a bunch of times and adding up the outputs manually

Sorry for all the questions lately thanks for everyone helping me out

This might do what you want … but please check carefully 'cause I’m not sure:
https://www.desmos.com/calculator/5b5rt52aic

it looks like the mean converges to 0.57 more or less …

do you know how the “Definitions are nested too deeply.” error code on line 20 could be dealt with? Im trying to replicate what you did but for this

my solution was to simplify it by combining lines but it didn’t work

Things are getting really involved … here’s what Desmos says about getting such an error: “Thanks for pushing the limits of the calculator. Some of those warnings are set up so that it won’t crash the browser”.
So you probably need to simplify the structure of what you’re doing if that is possible.

Line 19 may have some problems … you are joning 3 numbers into a list an than you’re asking to take the number in position CanaditeAmount-1 which is actually 2 … is that what you want? You are actually always choosing the second number …

If you simplify line 19 the errore goes away … I think there’s something wrong there. In any case it is that line that makes the dependencies of the definitions too involved.

There are a number of places where you’re using .length on a list of calculations where you could reduce calculator computations. The calculator will calculate that list of integrals and then take the length of that list, so it’s helpful to skip the calculations.

Playing a little, I’ve done so here using @Guzman_Tierno 's graph.

1 Like

how did you simplify line 19 to make the error go away.

Looking back at this again, I think your use of list comprehension (i.e. all the lines using “for i = …”) where you’re essentially taking the list and selecting an element, but similar to what I noted before with your use on .length, I believe for each element of i it’s looking at the whole list, finding that element, and joining into the output list. I think using indexing alone may be more efficient, though I’m not certain.

Here’s one example of C_m defined using list comprehension vs. C_mNew using indexing:

Similarly, random() has additional arguments that negate the need for list comprehension. random(list, number of elements, seed value):

you are always choosing the second element in line 19:
if you simply write

| min( C1(L) ) |

the error goes away.

To be clear:
join( | min( C(L) ) |, | min( C1(L) ) |, | min( C2(L) ) | )
is a list with 3 numbers and you are always choosing the second one. So there’s something strange there.

update: I bought chatgpt plus which is apparently powerful enough to run this equation nestley | Desmos

but do you get a number in line 6? (cause I dont)

chatgpt said it was 0.182