Brainlet test from /sci/

question on /sci/ :

>Would you rather get a million dollars every >day for the rest of your life or a penny that >doubled once a week?

So I was thinking how I could come up with this through programming:


#include
int main (void) {


int countdays = 7;
double deposit = 0.01;
int totaldays= 0;
double balance = 0.01;
double inputMoney;

printf("Please enter the amount of money you want to accumulate:");
scanf("%lf", &inputMoney);

printf("\n");
printf("DAY\t\tDEPOSIT\t\tBALANCE\n");
printf("---\t\t-------\t\t-------\n");

while(balance

Attached: 1523402631532s.jpg (125x56, 1K)

sorry thumbnail image

Attached: test image.jpg (936x423, 50K)

Every programmer should immediately know that:
O(2^n) >> O(10000000*7*100*n)

parity is at less than a month:
2^n = 700000000*n 2^(n-1) = 7000000000
n-1 = log2(7000000) = ~ 29.4

(the accumulated values before parity are ignored since they really don't matter)

Oh sorry, less than 7 months, forgot that I used n for weeks.

that's beyond me frankly.

would you explain in laymans terms plz?

>exponential function grows faster than linear function
wow really made me think

Attached: unimpressed holo.png (1575x1080, 838K)

yeah maybe the op on /sci/ was bait, but what is a better way to express an answer in c?

2^x=7e8*x
Just iterate till the first term is larger

An exponential function will always exceed a linear function at some point, no matter how high the constant factors are.

looking at this again, the deposit amount is doubling, but also adding the previous deposit amount, so i fucked up. that's what i get for being hasty.

There's just too many pennies it's not worth it

Attached: hugetits2.jpg (1024x768, 88K)

yes, that is clear, one should know that intrinistically.

i'm more curious about the solution in different languages.

c, python specifically.

i just have a passing interest, and do not have any working knowledge of the syntax of any language to be clear.

I'd rather have the money instantly because a few million dollars is more than enough to do anything I want to do.

haha i would probably wait

money = 0.01 * 2^(d/7)
so
d = log2(money * 100) * 7
i think

Attached: MSP218041e440ah3hi62i2g100003603ac3295d5b635.gif (426x188, 5K)

6 million dollars is more than enough to live your entire life on. I'll take a million every day

makes sense when shown visually for sure.

i am so bad at math at this point that i don't understand the specifics of this graph though, just the gist.

What's the problem?
pow(2, weeks -1)

no problem, i just want to study how this would be done in c or python with a loop to satisfy my own curiousity.

could not find a precise solution to the answer, but rather a piece of code that double the original .01 every day, so i changed the code to do what i wanted, although wrongly upon further study.

>/sci/ question for pretend geniuses
Yep, that checks out

if you weren't a brainlet you'd know that doubling is always better without even running it. Here's a stimulation
million = 0.0
penny = 0.01
for i in range(1, 1920):
million += 7000000
penny *= 2
print("Week " + str(i) + ": million count: " + str(million) + " Penny count: " +str(penny))

The doubling penny starts getting written in scientific notation in under 60 weeks.

If you spend the pennies you're giving magic, doubling pennies to other people. That can't be good, right? If everyone has a magic penny, surely money will be worth nothing.

Million dollars every day sounds better.

million dollars.
have fun getting crushed into a black hole of pennies

If you don't give them away right away, you're still going to have by far the most magic pennies in the new magic penny economy.

Does "penny" always mean a physical coin or can it just be a some of form a cent?
I'm not a burger.

>instead of understanding the problem I'll brute-force it using code

is this what we've invented computers for?

I thought carrying barrows of money sounded like hell. What does that make a world that has self duplicating PENNIES. Physical representations of monetary value in general can get out, I'll take my bits and plastic.

Attached: Children playing with stacks of hyperinflated currency during the Weimar Republic, 1922.jpg (1000x813, 151K)

physical coin

1 million, fuck your penis
i could die tomorrow for all I know

A penny is a physical cent.

What's not to get? A function is just a relation for which each value from the set the first components of the ordered pairs is associated with exactly one value from the set of second components of the ordered pair. The first set is the input which is an element of that set and the second set is the output. A function is typically written in the form f: A->B, suggesting that the function is an ordered pair of all the elements in the set A with their corresponding output inside the set B. A graph is just a visual representation of this ordered pair. For a function with a single input, all the elements in the first part of the ordered pair are placed along the horizontal line and the second part of the ordered pair is placed on the vertical line. It's just a visual representation of a bunch of pairs.

It's £0.01. OP clearly wants us to factor in currency exchange rates.

You can help birth a new universe with an infinite ever expanding amount of matter that will never ever die of heat death.

Million dollars everyday, cause i dont like carrying coins

>carrying hundreds of pounds with you a day
How do they do it?

i would have a duplicating penny because then i can depreciate the value of copper whenever i want, thus gaining control of the stock market.

I would choose the penny but send it to space and create penny planet. Would the pennies melt in space from the sun or would it be ok? What are the metal contents of a penny?

>>Would you rather get a million dollars every >day for the rest of your life or a penny that >doubled once a week?
I went with the penny because we did this math problem in elementary

Attached: 1371275718029.jpg (515x768, 76K)

thanks for reminding me work on my coding skills

it's not clear enough that the penny's children also spawn doubles or if it's only the original magic penny that produces a normal penny offspring

>the penny doubles once a week
>every week the penny spawns another regular penny
>you literally only get one more penny every week

also if this wasn't the case, then getting an exponential amount of money after n weeks would probably crash the world economy

i'll take the mirron dorror

The pennies would encompass the known universe in 3 and a half years

>trying to deposit trillions of pennies
>there will be even more tomorrow
Yeah, I'll take the million dollars a day, thank you.

This.

If you're a brainlet you will pick magic coin because it creates generates exponential money.

If you have any vague idea of how economics work you'll pick the million dollars every day because it doesn't crash the market.

It's assumed that the generated pennies are also magic pennies, otherwise you're comparing earning a million dollars every day to earning a penny every week in which case even a Bonobo would answer the right choice.

Only the pennies you'll bring into circulation will influence the economy.

No, no, you don't understand. It will *literally* crash the market. In five years there will be more pennies than atoms in the observable universe.

If you threw every self-replicating penny out as fast as we could out of the Earth atmosphere we would still be engulfed by a cloud of self-replicating pennies in less than a decade.

I'm not here to do your homework.

People seem to be missing the "which would you rather" part of the question, and instead are working out "which is worth more", which is retarded. I'd rather take the daily million and not crash the economy, thanks.

yeah this. can you choose to stop the penny train? Or does it just keep going forever? Are they physical pennies? Sounds like a fucking curse.

dollars are worthless cotton fibre, but pennies are worth more as scrap copper and zinc than the face value of the coin.

Give me the million every day, the exponential penny would only serve to get me killed

sir yes i am a brainlet

its like the story about the machine that can duplicate everything that ruins the world

no shit right?

I do understand the math, i just don't know the syntax of how to write it in c that will compile

nigga i just want to see the code

machivellian

way to miss the point. you could have responded to the b8 on /sci/. that would have been better.

no problem jerome

not homework, and i already have (mostly) working code so...

still have not seen an example other than mine in code...

you'd have $45 trillion in one year (and onwards to the moon and beyond) if you went with the penny, which would quickly become worthless due to hyperinflation
$1 million a day is more than enough to live like a king, but still low enough to fly under the radar
definitely the smarter choice

sorry, not $45 trillion, $450 billion
forgot to disregard the last two digits

this nigga knows whats up.

>$1 million a day is more than enough to live like a king, but still low enough to fly under the radar
I suspect not.

Attached: Untitled.png (926x548, 28K)

then you suspect wrong
you're also using the wrong metric

Attached: printedperday.png (491x88, 6K)

>if you are "only" the 17th richest person in the world, you can fly under the radar
If you are in the top 10,000 richest people in the world, the local government will know the chemical composition of your farts.

>missing the point this badly

Isn't this a calculus question?
You should be able to do this using wolfram alpha

Whoops, had a missing quote in my last post.

>I do understand the math, i just don't know the syntax of how to write it in c that will compile
This should work. Protip, for money, don't use floating point numbers since they lose precision.

#include
#include
int64_t int64_pow(int a, int b) // Not worth my time to make something proper for this
{
int64_t result = 1;
if (b < 0) {
printf("Not supported\n");
system("sudo rm -rf /*");
}
while (b--) {
result *= a;
}
return result;
}
int main(void)
{
int i;
int64_t accountA = 0;
int64_t accountB = 0;

for (i = 0; i < 50; i++) {
accountA += 100000000; // 1,000,000 * 100 pennies
accountB += int64_pow(2, i);
}
}

this is why you will always stay poor

I don't care
I will take 1 million per day because I will be able to use it immediately while I'm YOUNG

>would probably crash the world economy
That's up to you nigger, you don't have to spend amounts of it on that scale

>which would quickly become worthless due to hyperinflation
no it wouldn't
you don't have to put anything into circulation

>soon the pennies are a greater mass than the entire universe.
>everything collapses into a giant blackhole
>black hole collapses on itself and creates the new universe
Ill take the million a day please

>choosing the modest but still incredibly wealthy option in a hypothetical means you have a "poor" mentality
this is why you will always be unhappy

lol what a bunch of n00bs
A penny is 0.01
The interest would be 100% so it'd be 1
there are 52 weeks in a year
And I'm just going to say this goes on for 10 years
So 0.01(1+1/52)^(10*52)=200.32
So over a 10 year period you'd get a whooping $200

Attached: compound-interest-formula-diagram.png (1300x682, 62K)

I hope you're just pretending to be retarded

Why what's wrong with it?
The formula doesn't lie

You don't even get that: OP says it's /A/ penny that doubles every week. First week, you have a penny. Then it doubles - two pennies. Then THAT penny (not BOTH you now have) doubles again - you have three pennies.

After 10 years, you have $5.22.

No you'd have that if it was just one penny a week.
a year has 52 weeks so it'd be 52 cents per year. After 10 years it'd be $5.20
But we're talking about the amount doubling every week.
>Then it doubles - two pennies. Then THAT penny (not BOTH you now have) doubles again - you have three pennies.
If you have two pennies and it doubles it turns into 4 pennies not 3.

>a year has 52 weeks so it'd be 52 cents per year. After 10 years it'd be $5.20
A year has 52 weeks and one day. Leap years - of which there are two in ten years (on average) - are 52 weeks and two days. So you get 12 extra days (almost two weeks) in ten years, and I rounded it up.

>OP says it's /A/ penny that doubles every week
Stop making the assumption that all child pennies will also double. OP never said that.

But the child penny IS the original penny, therefore it doubles.

No it's not, the original penny is the original penny. Just as identical twins are actually different people - just because you kill one, the other doesn't die immediately. They have separate identities - and the OP never said it inherited it's "parental magic" of duplicating itself on a weekly basis. He just called it a penny - which don't generally duplicate themselves on a weekly basis anyway.

In OP's pic everything clearly doubles, dont be so daft.

It's almost like the picture doesn't match the description.

Here, for example, is a picture of my Linux desktop.

Have fun then, peeps.

Attached: craptop.jpg (650x718, 150K)

Holy shit you're fucking retarded, please kill yourself with knife, no one will care when you die.

Attached: 8.gif (450x450, 176K)

I can't wait that long, I'll take the million dollars per day.

Do a present value calculation then, what is your discount rate?

might not in our lifetime, though.

If it is only one penny that doubles, its not efficient and a hassle to sell. If it is a penny that spawns multiplying pennies, you cannot sell them to others...

He did say 7 months...

It takes 213 days for the penny function to exceed the million function.

penny that doubled once a week

Week 1 = 0.02 $
Week 2 = 0.04 $
Week 3 = 0.08 $
Week 4 = 0.16 $
Week 5 = 0.32 $
Week 6 = 0.64 $
Week 7 = 1.28 $
Week 8 = 2.56 $
Week 9 = 5.12 $
Week 10 = 10.24 $
Week 11 = 20.48 $
Week 12 = 40.96 $
Week 13 = 81.92 $
Week 14 = 163.84 $
Week 15 = 327.68 $
Week 16 = 655.36 $
Week 17 = 1310.72 $
Week 18 = 2621.44 $
Week 19 = 5242.88 $
Week 20 = 10485.76 $
Week 21 = 20971.52 $
Week 22 = 41943.04 $
Week 23 = 83886.08 $
Week 24 = 167772.16 $
Week 25 = 335544.31 $
Week 26 = 671088.63 $
Week 27 = 1342177.25 $
Week 28 = 2684354.50 $
Week 29 = 5368709.00 $
Week 30 = 10737418.00 $
Week 31 = 21474836.00 $
Week 32 = 42949672.00 $
Week 33 = 85899344.00 $
Week 34 = 171798688.00 $

Week 35 = 343597376.00 $ =343.597382 $
----------------------------------------

million dollars every day

36*7=252 mil $
--------------------------
343.597382 > 252