[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 393 KB, 1200x1024, 助けてください.png [View same] [iqdb] [saucenao] [google]
15750877 No.15750877 [Reply] [Original]

/g/ is too retarded to solve this

>> No.15750886

35%

>> No.15750890

50%

>> No.15750895

>>15750886
Actually. 33.75%

You have to consider, you might get 2 chests, but then again you might not, so the odds aren't incremtative.

>> No.15750898

>>15750895
33.9%

Final answer

>> No.15750902

>>15750898
No 42.5%

Final answer. Promise.

>> No.15750926

32%

>> No.15750954

>>15750877
43.6%

>> No.15750959

this is very similar to slot machine with free spins logic, redoing my old formulas for that

>> No.15750967

>>15750954
This. I was wrong.

>> No.15750976

>>15750954
[math]\frac{\sqrt{15}-3}{2}[/math]

>> No.15750987

>>15750877
While you say the two chests are identically distributed as the former, you do not say that they are independently distributed.
It is therefore unclear how to solve exercise.

>> No.15750989

0.5 * loss
0.3 * win
0.2 * 2 free spins

loss probability is x
x = 0.5 + 0.2x2
squared because you have to lose both for it to be a loss
5x = 2.5 + x2
x2 - 5x + 2.5 = 0
x = 4.436, 0.563
x = 0.563
win is 1 - loss
win = 1 - x
win = 1 - 0.563
win = 0.427

>> No.15751002
File: 33 KB, 1131x777, s.png [View same] [iqdb] [saucenao] [google]
15751002

>>15750976
confirm

>> No.15751015

>>15750987
>>15750989
[math]p = 0.3 + 0.2\left(1 - (1-p)^2\right) \implies 2p^2 + 6p -3 = 0\\
p = \dfrac{\sqrt{15} - 3}{2} = 0.4365[/math]

>> No.15751021

>>15751015
You forgot no negate your working out

>> No.15751179
File: 270 KB, 1920x1917, en yärrä HD.jpg [View same] [iqdb] [saucenao] [google]
15751179

>>15751002
How do you get the equation on second row? Wouldn't the problem imply a sort of infinite recursion of opening pairs of boxes inside pairs of boxes?

Picrel is me trying to think this problem

>> No.15751212

2.5-sqrt(3.75)

>> No.15751220

>>15751179
The answer for any box is p, just use that for the bonus chests in the equation.

>> No.15751747

50 %
it either does or does not

>> No.15752287

>>15751747
kek
always gets me

>> No.15753397

>>15751179

The probability 1 box has metal is P(M), the probability it does not is therefore 1-P(M)
The probability 2 boxes do not is therefore (1-P(M))^2

The probability 2 boxes have at least 1 is therefore 1 - (1-P(M))^2

>> No.15753407

>>15750877
Quite easy if you have ever studied probabilities.

>> No.15753434

>>15750877
>>15751179
Unless you wrongly assume the gold bars get smaller (which the problem does not state) there exists one box in the population where the recursion does not converge, and many boxes where it converges at different numbers of bars, negating there ever forming a conserved population from which to even define the original percentages that define the possible different contents of the boxes. Therefore, the question cannot be answered.

The reason this was originally a /g problem was to get morons to create infinite loop programs that would crash, or would not compile, driving them nuts.

>> No.15753463

>>15750877
35,71%

It's not harder than +30% which leaves 2/7 and 5/7
so 20% for two which is 2/7 x 2 which is 0,571 and then just adjust it to correct decimal position

>> No.15753474

>>15753463
or actually you have to account for it to every decimal so
35,71 + 0,571 + 0,0571 + 0,00571...
So 36,343 %

>> No.15753989
File: 100 KB, 480x320, sharp bird.jpg [View same] [iqdb] [saucenao] [google]
15753989

>>15751015
This is the correct answer, verified with a simulation of 100 million runs.

>> No.15753994

A better question would be, how many bars of metal do we expect to obtain on average from a single chest?

>> No.15754010

>>15753994
actually it's not interesting at all, it's 3/8 = 0.375

>> No.15754013

>>15754010
im retarded, its 0.5

>> No.15754340

>>15750877
P(M) = P(Ag) + P(Au) + (P(Chests) * P(M in at least one))

P(M) = 0.2 + 0.1 + 0.2 * (1 - (1 - P(M))^2)

It then follows that

P(M)^2 - P(M) = 0.30
P(M) * (P(M) - 1) = 0.3

P(M) = 0.30 because P(M) cannot be 1.

>> No.15754902
File: 58 KB, 293x256, cumcatcher.jpg [View same] [iqdb] [saucenao] [google]
15754902

>>15750877
>open chest
>see no gold
ok but what if grug
>open chest
>open chest
>open chest
>open chest etc
then what. grug get bored and angry. touch lady by force. grug now happy but lady mad. use chest 3 to kill lady. hide lady in chest 5. grug hungry. no gold for food. grug now use chest 2 to threaten rich grug. rich grug give grug silver. grug now have silver and chest. grug happy. grug now has silver, chests, and lady.

>> No.15754909

>>15751747
this is the correct answer though that's the wrong reason.

>> No.15755000

>>15750877
It's a simple GP so it's 3/10(1/(1-2/10)) = 3/10 * 10/8 = 3/8 = 0.375. How is this even an inconvinience is beyond me. /g/ is also just a forum for posers though so makes sense. Anyone actually good at computer science or maths browses /sci/

>> No.15755003

>>15755000
wait okay i messed up, it's two chests. Ill do it again

>> No.15755028

>>15755003
It's 0.43 approx. More specifically it's (-6 + sqrt(60))/4

My points about /g/ tards still stands

>> No.15755030

>>15755028
0.4364916731 on a calculator

>> No.15755031

>>15755000
>Anyone actually good at computer science or maths browses /sci/
No one on /sci/ is good at anything STEM-related. You're the proof.

>> No.15755034

>>15754902
tfw no gold

>> No.15755035

>>15755031
Im haven't slept and it's 4 am, everyone makes mistakes tard. I realized and rectified it immediately

>> No.15755038

>>15755035
Congratulations on finding the answer only 16 hours after it was already posted in the thread.

>> No.15755039

>>15755038
Congrats to me finding the answer only 20 minutes after i saw it while struggling to keep my eyes open and jerking off to your faggot dad's ass

>> No.15755043

>>15755039
Congrats to you being a brainlet who took 20 minutes to solve a kindergarten-level problem and got it wrong.

>> No.15755045

>>15755039
Oh, you're an engineer. Now it all makes sense.

>> No.15755047

>>15755043
>brainlet
Actually agreed on that one

>took 20 minutes to solve a kindergarten-level problem and got it wrong.
typed the first answer instantantly upon seeing the question. Missed the two chests part because sleep deprived and realized that 3 minutes later, posted reply acknowledging mistake and corrected in 10 minutes.

>> No.15755050

>>15755047
You will never be intelligent is the bottom line. How hilariously defensive you're getting and how hell-bent you are to prove yourself with a kindergarten problem proves this. You were obviously so elated over being able to figure out this triviality. It must've been crushing to realize you got it wrong and no one is impressed. lol

>> No.15755055

>>15755050
Lmao, i know i am not intelligent, i am fucking retarded. But i love how you, being a midwit, are so much enjoying shitting on some random retard on the internet because he got a simple question wrong once. So affirming to your 'intelligence'.

My point is that i am absolutely autistic but /g/ even more than me

>> No.15755061

>>15755055
>i know i am not intelligent, i am fucking retarded.
Ok.

>> No.15755063

>>15755061
Ok.

>> No.15755138

>>15750877
What was diificult about this?

#include<stdio.h>
#include<time.h>
#include<stdlib.h>

int trial()
{
int total=0,success,conclude;
while(1)
{
int roll = rand()%10;
conclude = (roll<8)?1:0;
if(roll<3)return 1;
if(conclude)return 0;
if(trial())return 1;
if(trial())return 1;
return 0;
}

}

void main()
{
int total,success;time_t t;
srand((unsigned)time(&t));
while(total<2000000)
{
success += trial();
total+=1;
}
printf("Probability of getting a metal is %f, with %d successes on %d total",(float)success/total,success,total);
}

In C
Results:
>Probability of getting a metal is 0.436291, with 872583 successes on 2000000 total
>Probability of getting a metal is 0.437417, with 874834 successes on 2000000 total
>Probability of getting a metal is 0.436357, with 872714 successes on 2000000 total
>Probability of getting a metal is 0.436322, with 872644 successes on 2000000 total

>> No.15755220

>>15755028
>>15755030
>>15755000
Nope

>> No.15755247

>>15755220
42.9

>> No.15755249
File: 263 KB, 753x753, 1693930538771172.png [View same] [iqdb] [saucenao] [google]
15755249

42.93

>> No.15755271

>>15755138
Do this:
int roll = rand() * 10ull / (RAND_MAX + 1ull);
instead of this:
int roll = rand()%10;
The later is slower and favors lower bits of rand() that are usually low quality.

>> No.15755286

>>15755271
Huh thanks. Could you explain what it's doing to me? It just looks odd and confusing with a lot of alien terms

Also, Is my solution correct otherwise?

>> No.15755328

>>15755286
If you the undefined behavior that brainlet's code invokes through signed integer overflow, it's the equivalent of scaling the output of rand down down to a range of 0-1, multiplying by 10 and truncating after the floating point.

>> No.15755331

>>15755328
If you ignore*

>> No.15755393

>>15755328
How does running a modulus on Rnd invoke a signed integer overflow? i don't know much about it, but doesn't it generate a value between 0 and RAND_MAX which is 2^31-1 (highest positive value) by default? so how can a signed integer overflow be evoked here?

>> No.15755400

>>15755393
>How does running a modulus on Rnd invoke a signed integer overflow?
It doesn't. I meant the code from the other poster who was trying to "enlighten" you. Multiplying the output of rand() by 10 can easily overflow a signed int.

>> No.15755405

>>15750877
>anime girl
Im tired of yuo people

>> No.15755410

>>15755393
>>15755400
Actually I was wrong. It's not undefined behavior. Arithmetic involving signed and unsigned values promotes the signed values into unsigned, so the result is just implementation-defined and not UB.

>> No.15755412

>>15755400
Oh i see. Yeah i guess that's true, but that's why he multiplied with a ull i think. Multiplying an int and an ull int will give a ull int which can go upto ~19 digits, so multiplying by 10 will not actually cause an overflow.

I assume the gist of what the poster was trying to say is that multiplying and dividing like that is faster than using a modulus on a large integer? Also i think this is the same method to generate random numbers that was used in BASIC programs on old computers right?

>> No.15755422

>>15755410
Happens to the best of us ig. Thanks for explaining though.

>> No.15755474

>>15755220
Enlighten me

>> No.15755606

ITT: low IQ retards who are programmed to apply some formula to every problem instead of using their own low IQ brain to solve this low IQ problem
the answer is 50%

>> No.15755806

>>15755286
The result of rand() is an integer in the range [0 .. RAND_MAX] and RAND_MAX + 1ull is a power of two, the integer gets promoted to unsigned long long that is at least 64 bits. In rand() * 10ull the result of rand() is also promoted to unsigned long long. The result is an unsigned between 0 and 9 inclusive. The division by an unsigned power of two is equivalent of displacement to the right, a simple and fast operation.

>> No.15756046

>>15755474
Not my job.

>> No.15757806

>>15754013
Can confirm, it is 1/2.

Let R be reward:

E[R] = 1/2*0 + 3/10*1 + 1/5 * 2*E[R]

E[R] = 3/10 + 2/5*E[R]

E[R] = 1/2

>> No.15757989
File: 50 KB, 1024x576, spaniards spotted.jpg [View same] [iqdb] [saucenao] [google]
15757989

>>15750877
100% with enough privateers

>> No.15759499

37.5 tho

>> No.15759686

>>15750877
x = 0
x = 0.3 + (x*0.2)

>> No.15759788

>>15759686
hold on I got the second part wrong
x = 0.3 + (x*0.4)

>> No.15759836

/g/ is gaymers who gloat about their gpu and coomers who think diffusion "ai" is skynet.

>> No.15759845

>>15759836
Well yeah, it wasn't too long about that it was getting called "tech support for /v/"

>> No.15759951

The answer is 1.2-3 in secret language. Don't ask why. Just trust me. In your language it's 42.93

>> No.15760243
File: 2.98 MB, 2350x3216, 1695305026162.jpg [View same] [iqdb] [saucenao] [google]
15760243

>>15759836
generally higher quality than /sci/, it's a /pol/ infested shithole here

>> No.15760445

>>15759788
>>15755138
>>15755000
>>15753463
>>15751015
>>15751002
>>15750989
jfc why is everyone retarded? 10% chance of gold and 20% chance of silver is NOT the same as 30% chance of metal.
The base odds of NOT getting silver AND NOT getting gold is 0.8*0.9 = 0.72, so the base odds of getting silver OR gold is only 28%, not 30%

>>15750877
OP is retarded too. if the odds of silver, gold, and two more chests are 20%, 10%, and 20% respectively, the odds of there being nothing in the chest is 0.8*0.9*0.8=0.576 = 57.6%, not 50%.

the answer is 36.6% from 10M simulated runs

>> No.15760468

>>15760445
I figured out why everyone is retarded. They think a chest gets only one roll that determines its contents (i.e., roll between 1-10; 1-2=silver, 3=gold, 4-5=two more chests, 6-10=nothing). In that case there actually is a 50% chance of nothing. but the post also says “odds of AT LEAST one bar” which is retarded because in this scenario it’s not possible to get more than 1 bar

if each item is rolled for independently, you have a higher chance to get nothing and thus lower odds of finding metal, but you do have odds to get multiple bars per chest AND additional chests

>> No.15760790

>>15760445
semantics
the retards are right because logically we expect one item (or two bonus chests) on each roll - it's meant to represent a video game mechanic.

>> No.15760798

>>15760468
It is possible if you get two chests on the first roll with a bar in each