#help-36

1 messages · Page 182 of 1

shell condor
#

Okay, so that's log((2 + x))/2 - x))

tranquil pine
#

Its not any normal bracket

#

Its gif

shell condor
#

GIF is the common bracket for Logarithms, it doesn't matter much in calculus (at least integration)

tranquil pine
#

Oh is that so?

shell condor
#

Eh, or I might be wrong, but it won't affect our question

tranquil pine
#

No im asking genuinely cuz i dont know fr

#

Well if u say so

shell condor
#

I remember seeing some questions with GIF, so it does matter, but not in this particular question

#

f(a + b - x) can be written as log(2 + x) - log(2 - x)

tranquil pine
#

Then integrate using parts?

shell condor
#

Nope

#

A faster method

#

f(x) was log(2 - x) - log(2 + x)

#

-f(x) would be log(2 + x) - log(2 - x)

tranquil pine
#

So add both

shell condor
#

And that is f(-x)

#

(Or f(a + b - x))

#

Now what do we call a function where f(-x) = -f(x)

tranquil pine
#

Odd

shell condor
#

And the integration of an odd function is?

tranquil pine
#

From -a to a is 0

#

Is that all?

shell condor
#

Yup

tranquil pine
#

Oh

shell condor
#

And here a is 1

tranquil pine
#

Ye

#

So shud i just ignore the brackets inside log?

shell condor
#

In such cases, where the lower limit is just the negative of the upper limit, we always first check if f(-x) = -f(x)

shell condor
shell condor
tranquil pine
#

Ou

#

Ok thanks a lot

#

.close

final saddleBOT
#
Channel closed

Closed by @gray mica

Use .reopen if this was a mistake.

lyric obsidian
#

Idt yall understood

#

.reopen

final saddleBOT
#

lyric obsidian
#

The function isn't defined for x>0, so it isn't odd

#

e.g. at x=1, log(floor((2-x)/(2+x)))=log(floor(1/3))=log(0) which is undefined

#

@tranquil pine You have to consider cases based on how the function is defined

tranquil pine
#

Oh

final saddleBOT
#

@tranquil pine Has your question been resolved?

tranquil pine
#

.close

final saddleBOT
#
Channel closed

Closed by @gray mica

Use .reopen if this was a mistake.

#
Available help channel!

Send your question here to claim the channel.

Remember:
Ask your math question in a clear, concise manner.
Show your work, and if possible, explain where you are stuck.
After 15 minutes, feel free to ping <@&286206848099549185>.
• Type the command .close to free the channel when you're done.
• Be polite and have a nice day!

Read #❓how-to-get-help for further information on how to ask a good question, and about conduct in the question channels.

lapis wedge
#

Does this proof look good?

final saddleBOT
lapis wedge
#

Or is there a more direct way to prove this

tired walrus
#

do you mean disprove

lapis wedge
#

yeah sorry

#

oh if im disproving

#

would it be better to prove the negation

#

not really sure what that would be of this set though

opal plinth
#

Don't you just need a counterexample?

lapis wedge
#

yeah thats true, is the counter example I proposed correct?

opal plinth
#

You didn't though

lapis wedge
#

oh I didnt?

#

I thought I took an (a,b) in the left hand side

#

and showed it wasnt in the right hand side

#

maybe im misunderstanding what counter example means

rigid scaffold
#

A counterexample would be stating explicitly four sets (A_1, A_2, B_1, B_2) for which the equality is false

lapis wedge
#

ohh ok

opal plinth
#

There may be some slack in the definition of a counterexample but to me it's with concrete values

rigid scaffold
#

You would also try to make them as simple as possible, while it's not mandatory

lapis wedge
#

Ok i'll try to constrcut a counter example

final saddleBOT
#

@lapis wedge Has your question been resolved?

#
Channel closed

Closed by @lapis wedge

Use .reopen if this was a mistake.

#
Available help channel!

Send your question here to claim the channel.

Remember:
Ask your math question in a clear, concise manner.
Show your work, and if possible, explain where you are stuck.
After 15 minutes, feel free to ping <@&286206848099549185>.
• Type the command .close to free the channel when you're done.
• Be polite and have a nice day!

Read #❓how-to-get-help for further information on how to ask a good question, and about conduct in the question channels.

vague anchor
final saddleBOT
vague anchor
#

,rccw

soft zealotBOT
worldly mesa
#

Which one

#

Also

#

!status

final saddleBOT
#
What step are you on?
1. I don't know where to begin.
2. I have begun but got stuck midway.
3. I got an answer but I was told that it's wrong.
4. I got an answer and would like my work checked.
5. I have a question about someone else's work/solution.
6. I have completed the problem and don't need help anymore. Thank you.
7. None of the above
vague anchor
#

3rd one and don't know how to begin

#

It's multiple correct

worldly mesa
#

I think you are supposed to use the IVT

#

Or not....

vague anchor
#

IVT?

worldly mesa
#

High school?

vague anchor
worldly mesa
#

Yeah ok so nvm

plucky rover
#

This just needs Rolles doesn't it

vague anchor
plucky rover
#

If a continuous function changes sign it is zero at a point in between

worldly mesa
#

High school level

plucky rover
#

I recall having done this during my JEE prep

solid notch
plucky rover
#

Hence me bringing it up

solid notch
#

unless calculus hasnt started at all

thin cloud
solid notch
#

but then why are you advance

vague anchor
worldly mesa
solid notch
thin cloud
vague anchor
worldly mesa
#

This looks like they wanted to type (x-e)(x-pi) in the denominaror on the right fraction

worldly mesa
#

Then when you multiply by (x-e)(x-pi) its a quadratic

plucky rover
#

They have π + e in the options

solid notch
# vague anchor I'm just at the quadratic equations

yeah there are a few jee question in the chapter quadratic equation which can be done with rolles theorem quickly , so i suggest you can mark this question , do it the conventional method and come back in like 12th 2nd month

plucky rover
#

So they definitely wanted it to be x - π - e

worldly mesa
#

Oh I am stupid

vague anchor
worldly mesa
#

Just mutiply by (x-e)(x-pi)(x-e-pi)

#

And you get a quadratic

solid notch
vague anchor
#

Hmm
Probably we aren't even given its solution in it's pdf

solid notch
#

quadratic equation can be solved using the completing the square method too , but do we use it generally?
middle term split does the trick most casses and sometimes we have to use quadratic formula

vague anchor
#

Shall I call someone
A good helper
By pinning her🫣

solid notch
vague anchor
solid notch
plucky rover
#

Not all problems will have pretty solutions

#

Especially when you don't have the necessary tools

solid notch
#

is location of root one of its topic, this is the question from that topic.

worldly mesa
#

And the numbers are ugly

plucky rover
#

Sometimes you need to get your hands dirty

vague anchor
plucky rover
solid notch
plucky rover
solid notch
plucky rover
#

Should still understand how to solve it on the base level

solid notch
plucky rover
vague anchor
plucky rover
#

(I was hoping he'd make that realisation himself)

solid notch
vague anchor
vague anchor
plucky rover
#

Nah, I got the JEE trauma as inheritance

vague anchor
#

Btw how do ppl become helper here?

plucky rover
#

It's a role you self assign isn't it

vague anchor
#

Idk

vague anchor
solid notch
plucky rover
#

No I don't want to be pinged whenever people need help

#

Oh helpful, that idk

vague anchor
#

Btw I guess like how helpers spent their time here they might be paid but no way

solid notch
#

its auto assigned to the person who is actively helping ig

plucky rover
solid notch
plucky rover
#

At least if you manage your time properly

#

Anyway, stop talking and go get your hands dirty

vague anchor
#

That equation is literally becoming more than like 2 lines

solid notch
#

?

#

dont mindlessly multiply things out bro

plucky rover
#

Collect the coefficients

vague anchor
#

Btw why is e so used why is it a natural no. Like one that is recurring

plucky rover
#

The original discovery of e was when studying compound interest

vague anchor
#

Dirty equation

plucky rover
#

But the one you might appreciate the most is the limit formulation

vague anchor
plucky rover
#

e is the limit of (1+1/n)^n as n approaches infinity

solid notch
vague anchor
solid notch
# worldly mesa A lot of graduates

yeah thats fair , **mostly **graduates are more active in the higher chanels or if a higher question is asked in the help chanel
which is lwk fair

plucky rover
#

Unfortunately very few people here are asking what I'm working on so I'm stuck with JEE trauma

thin cloud
solid notch
final saddleBOT
#
Channel closed

Closed by @vague anchor

Use .reopen if this was a mistake.

vague anchor
#

Ty

#

Guys

vague anchor
final saddleBOT
#
Available help channel!

Send your question here to claim the channel.

Remember:
Ask your math question in a clear, concise manner.
Show your work, and if possible, explain where you are stuck.
After 15 minutes, feel free to ping <@&286206848099549185>.
• Type the command .close to free the channel when you're done.
• Be polite and have a nice day!

Read #❓how-to-get-help for further information on how to ask a good question, and about conduct in the question channels.

vague anchor
#

6th one
I'm stuck in between

final saddleBOT
#

Show your work, and if possible, explain where you are stuck.

tired walrus
vague anchor
#

,rccw

soft zealotBOT
tired walrus
#

your work looks kinda hard to read ngl

#

can you rewrite all this but calligraphic please

vague anchor
#

Lemme Redox it

tame gust
#

I find the problem statement really funny:

...then a value which is greater than |n+m| is
...I'd just choose the highest value out of spite >:D

vague anchor
#

It's multiple correct 😑

tame gust
#

ah, again it is weirdly written as if they are asking for one

vague anchor
#

Here it is Ann

tired walrus
#

ok let's see

#

so D ≥ 0 yep

#

but i think you set up the discriminant incorrectly

#

$\frac{3x^2+mx+n}{x^2+1}=y \to yx^2 + y = 3x^2 + mx + n \to (y-3)x^2 + mx + (n-y) = 0$, which gives $a=y-3$, $b=m$ and $c=n-y$.

soft zealotBOT
tired walrus
#

so either you did some funny business in your head or you messed it up

#

or both! who knows.

#

but i would have expected $$m^2 - 4(y-3)(n-y) \geq 0$$

soft zealotBOT
vague anchor
#

Ummm, sure?

vague anchor
tired walrus
#

well you may have solved it but then you didn't communicate it properly.

#

i for sure was confused at what you idd.

#

did*

#

also i just realized the x^2 coeff in my thing should be 3-y and not y-3, oops.

tired walrus
vague anchor
#

Yeah I was thinking the same
But I was not so courageous to oppose an post-graduate😅

tired walrus
#

oh come on

vague anchor
#

Let's go ahead

tired walrus
#

just because i have a master's degree does not make me a goddess who is never to be doubted or crossed

#

anyway, $$m^2 - 4(3-y)(n-y) \geq 0$$

soft zealotBOT
vague anchor
#

Yepp next

tired walrus
#

the solution set of this ineq should be [-4, 3] but for now we should only keep that in the back of our mind.

#

and instead simplify this inequality. carefully, step by step, and without funny business.

tired walrus
#

original question says the range of $\frac{3x^2+mx+n}{x^2+1}$ should be $[-4,3]$. the equation $\frac{3x^2+mx+n}{x^2+1}=y$ should have solutions for $x$ precisely when $y \in [-4,3]$ (no more, no less).

soft zealotBOT
tired walrus
#

if you solved the question then why are you even here

vague anchor
#

U mean that I have to compare both equations?

tired walrus
#

... ok, we are definitely not understanding each other

#

wtf did you mean when you said "i did and it is right"

vague anchor
tired walrus
#

inequality*

vague anchor
tired walrus
#

so whats this then, is that the simplified version?

vague anchor
#

Yepp

tired walrus
#

ok yeah i retraced your steps and you didnt fuck up

#

now you need this quadratic in y to be equal to 4(y+4)(y-3).

#

(for all y)

#

so yes you compare.

vague anchor
tired walrus
#

no?

#

i do not believe that you will fuck up

#

it is a "trust but verify" situation

vague anchor
tired walrus
#

my gripe was that your work was mostly unwritten/mental which means unverifiable to external parties (everyone except you)

vague anchor
tired walrus
vague anchor
#

Oh

#

Actually both are same

#

Both represents y

#

But why less than or equal to 0

#

I'm f up

tired walrus
#

one moment...

#

the quadratic 4y^2 - 4(n+3)y + 12n-m^2 has to look like this

vague anchor
tired walrus
#

ok look

#

the range is an interval, yes?

#

yes or no

vague anchor
#

Yes
It's the all values of y

tired walrus
#

you've written down an inequality whose solution set is that same interval

tired walrus
#

ie you have passed from a "find the range of this function" exercise to a "solve this inequality" exercise...

tired walrus
vague anchor
#

Oh yeah that should be greater than 0
Bcoz y does have roots

tired walrus
#

lemme try to illustrate the logic here

vague anchor
tired walrus
solid notch
tired walrus
#

you've got 3 statements here

#

and the logic that underpins solving this question is the logical equivalences between these statements

#

this requires higher-level awareness than simply the ability to solve an inequality

vague anchor
#

Wait

vague anchor
tired walrus
#

vibe mathing Xd

vague anchor
#

Yepp

vague anchor
tired walrus
#

mmmmmmmmmmmmmmmmmmmmmmm no good.

vague anchor
#

😶‍🌫️

#

So now why we took (y+4)(y-3)<=0

solid notch
#

inequality for the y , given in the question

vague anchor
#

It's range why is it related with that

plucky rover
#

Because that's an inequality which is true exactly for that range

#

(do you see why)

solid notch
#

consider the function f(x)
if i write x>0 ,
can you tell me whats the domain

tired walrus
#

let me add to my diagram...

plucky rover
#

Okay did you understand the first part of what Ann did

tired walrus
#

there are 3 equivalences here which i've conveniently color-coded

plucky rover
#

(two of them look black to me)

tired walrus
#

"known from theory" is green.

vague anchor
#

Understood

plucky rover
#

Colour blindness kicking in

tired walrus
#

my aim is for mathemystic to:

  • understand the red equivalence, AND recognize that it is question data
  • understand the green equivalence, AND recognize that it is a manifestation of theory
  • understand the black equivalence, AND recognize it follows from the other two, AND recognize that it is the path forward
vague anchor
#

My, my, thank u guys for doing this so much for me🥹

vague anchor
plucky rover
#

Do you recognise any of those

vague anchor
#

.close

final saddleBOT
#
Channel closed

Closed by @vague anchor

Use .reopen if this was a mistake.

vague anchor
#

🥹

final saddleBOT
#
Available help channel!

Send your question here to claim the channel.

Remember:
Ask your math question in a clear, concise manner.
Show your work, and if possible, explain where you are stuck.
After 15 minutes, feel free to ping <@&286206848099549185>.
• Type the command .close to free the channel when you're done.
• Be polite and have a nice day!

Read #❓how-to-get-help for further information on how to ask a good question, and about conduct in the question channels.

robust horizon
#

Problem Statement: Given an array and a sum k, we need to print the length of the longest subarray that sums to k. how do i start with this? i know i can check which elements equal to the sum given, but how exactly do i keep track of the longest sub-array?

robust horizon
#

one thing i can think of is:

#

i keep track of all the sub-arrays whose sum equal k

#

and then check which one has the maximum number of elements

#

but i think that would result in a lot of memory wastage

#

plus would not be convenient

plucky rover
#

Are you familiar with dynamic programming

robust horizon
#

no, not yet

plucky rover
#

That's gonna make this difficult lol

#

What have you done so far

robust horizon
#

i am not really sure how i am going to start with it, but i provided which direction my mind is going in

plucky rover
#

No I meant if this is for a course, what types of algortihms have you done so far

robust horizon
#

it is not for a course. i have just started learning arrays

#

i am not following any course

plucky rover
#

I see

#

If you haven't done dynamic programming, all you really have for this is brute force

robust horizon
#

not sure what exactly do you mean by that

plucky rover
#

Dynamic programming is a type of algorithm essentially

#

Until you learn that, I don't think you can solve this in any way that isn't to just check all subarrays

#

(which is what your approach was, I don't think you currently have the tools to do better)

late rose
plucky rover
#

That's already her approach

robust horizon
#

but would that not result in a lot of memory/cost wastage?

plucky rover
#

It would yes

#

But until you have some better tools it is the best you can do

#

Look up dynamic programming if you wanna explore that

robust horizon
#

what exactly does it come after? i really want to go step-by-step

meager hedge
#

I have a solution

robust horizon
#

yes please

#

wait

#

can you guide me to it? rather than giving me the whole thing

plucky rover
opal plinth
#

That's quite the jump in difficulty

robust horizon
#

i want to build-up my logic thinking

opal plinth
#

@plucky rover I don't see how dynamic programming helps here

plucky rover
#

Wait hold on have I been saying dp instead of hashing

opal plinth
#

I don't see how hashing helps here

plucky rover
#

Hashing definitely helps here

robust horizon
#

i know a little about hashing, in theory

meager hedge
#

Ok here’s the thing, assume your array has n Numbers. Test all n arrays (There’s 1), then test all n-1 arrays (There’s n), etc.
Now think of the kind of test you wanna include

opal plinth
#

Is that really your solution?

plucky rover
#

That's still O(n²)

meager hedge
plucky rover
#

Wait Nel, I've been thinking contiguous subarrays

#

That's why I jumped to hashing (and called it DP)

opal plinth
#

There's a simple¹ O(n) solution for this problem
-# ¹when you've already solved this sort of problem before

meager hedge
plucky rover
opal plinth
meager hedge
opal plinth
#

Fair enough

plucky rover
opal plinth
meager hedge
#

It’s faster because you start by testing the longest sub arrays first

plucky rover
opal plinth
#

@robust horizon I can try to guide you through this but it is a difficult problem for someone who has just started using arrays...

robust horizon
#

can i try?

opal plinth
#

Of course

late rose
#

since summing is an O(n) operation

robust horizon
#

what would be the very first step i should be thinking of?

plucky rover
opal plinth
plucky rover
#

No I know I was being facetious

opal plinth
robust horizon
#

okay, say the array is {1, 2, 3, 5, 9}; with n = 5 and, say, k = 10

#

we know that there's two sub-arrays which equal to 10, i.e., {2, 3, 5}, and {1, 9}

#

oh

opal plinth
#

Oh, before we continue, I should ask: does the question define a subarray as contiguous? It should, but we can't be too sure...

plucky rover
#

(if it doesn't this is np-complete)

robust horizon
#

i copy-pasted the problem

plucky rover
#

I think subarray implies contiguous

#

vis a vis substring

opal plinth
#

It does

#

But clearly fudge doesn't quite know the terminology

robust horizon
#

i am sorry

plucky rover
#

Fair enough, also I just realized how to do this without hashing lol I was overcomplicating

opal plinth
#

It's normal, you're learning

robust horizon
opal plinth
#

Alright so it's almost certainly contiguous subsequences

#

No it wouldn't

#

Let me try making an example

#

{3, 2, 1, 1, 1, 1, 3}, k=4

#

That should do the trick

robust horizon
#

question, what happens if it is not contiguous? i mean it makes it more complicated, yes, but aren't we just checking if elements of the array equal the sum? like how does it make a difference?

opal plinth
#

It makes a big difference in complexity, because there are 2^n subsequences (not necessarily contiguous)

robust horizon
#

okay, but what if we skip that part? would we change our approach?

opal plinth
#

and there is no known algorithm to solve this in non-exponential time IIRC

plucky rover
#

It's np-complete yes

robust horizon
#

np-complete?

opal plinth
plucky rover
#

Essentially it's a class of very hard problems that can't be done in polynomial time (as of now)

robust horizon
plucky rover
#

So you have to check still

opal plinth
#

You know how, if you want to find the maximum value in an array, you need to check every single element?

robust horizon
#

how did you get {2, 3}, {3, 3}, {2, 1, 3} again?

robust horizon
opal plinth
#

Well in this problem you'd need to check every single one of the 2^n subsequences, and that's potentially a very big number

robust horizon
#

right

opal plinth
robust horizon
#

so basically kind of like all the power sets?

robust horizon
opal plinth
#

It's the power set, yes

#

But, going back to your problem, you only need to consider subarrays, and those are the contiguous kind

robust horizon
#

can i state what approach i am thinking of?

opal plinth
#

Go ahead

robust horizon
#

i am not sure if this is correct but

#

{3, 2, 1, 1, 1, 1, 3}, k=4

#

okay so

#

we start from the very first element, 3

#

we check if the next element plus itself equals 4

#

it does not

#

we keep an index?

#

so we know it is not {3} or {3, 2}

robust horizon
robust horizon
#

again, we repeat the process

#

3 is <= 4

#

so it could be {2, 1, ...}

opal plinth
robust horizon
#

oh, yes, sorry

opal plinth
#

Ok, so you get to {2, 1, 1}

robust horizon
#

then 2, 1

#

yeah

#

we get a sub-array

#

whose elements equal to 4

#

now we move our index to 1 (the first one)

#

and so on

#

but isn't that a super long process too?

#

wait

#

isn't that what the first thing i thought of, was

opal plinth
#

Kinda, but it's a start

#

I should've asked too, is it an array of positive integers only?

#

Do you have a link to the question?

late rose
#

yeah i was gonna say, negative numbers would throw a wrench in his solution

robust horizon
#

it was shared to me by a friend as a screenshot, is it okay if i forward the picture?

opal plinth
#

Yea

robust horizon
opal plinth
#

That formatting is wack but it does say "positives"

#

So I'm gonna take it as a yes

robust horizon
opal plinth
#

Well it's not bad, just not optimal

#

I think you should implement your solution before trying to improve on it

robust horizon
#

okay, let me work on it

#

would i need an inner loop for this?

opal plinth
#

Yes

opal plinth
robust horizon
#

question

#

so i would need to check for individual elements too, right

#

would that not result in a lot of ifs conditions?

opal plinth
#

Yeah, in the question's example there is a 5 in the array, and k=5

opal plinth
robust horizon
#

can i work on it like how we work on the fibonacci series

upper leaf
#

like compute the nth fibonacci number?

robust horizon
#

no, how we calculate the sum

#

well that does not make sense

#

never mind

upper leaf
#

well for now what have you consider trying?

#

(after some help)

robust horizon
#

i am thinking

#

say i find a sub-array which equals k

#

where do i store it?

#

or do i just remember the indexes?

opal plinth
#

The question only asks for the maximum length of valid subarrays

robust horizon
#

but we wouldn't know the maximum length until we have found all such sub-arrays, right?

opal plinth
#

Of course, but you don't need to remember all subarrays, just the maximum length

robust horizon
#

ah

#

like the previous question

opal plinth
#

I don't quite remember but yeah probably

upper leaf
#

Problems like these challenges the optimality of your solution

#

You can brute force or use an effective algorithm and data structure or whatever else

robust horizon
#

um, something like this? #include <iostream> using namespace std; int main() { int a[7] = {3, 2, 1, 1, 1, 1, 3}, k = 4, sum = 0, max = 0; for (int i = 0; i < 7; i++) { for (int j = 0; j < 7; j++) { sum += a[j]; if (sum == k) { int l = j - i + 1; if (l > max) max = l; } } } }

robust horizon
upper leaf
#

well thats one way to do it but reset the sum

opal plinth
#

Did you mean to start j at 0?

upper leaf
#

start j at i

#

and cout the results

robust horizon
#

ah yes, i

robust horizon
upper leaf
robust horizon
#

right, sorry

opal plinth
#

You need to reset sum at some point

#

I'll also give you a small improvement: you can start loop j from 0 to n-i; that immediately gives you the current subarray length

robust horizon
#

i do not follow how

robust horizon
#

or no?

opal plinth
#

Yes

robust horizon
#
using namespace std;
int main()
{
    int a[7] = {3, 2, 1, 1, 1, 1, 3}, k = 4, sum = 0, max = 0;
    for (int i = 0; i < 7; i++)   
    {
        sum = 0;
        for (int j = i; j < 7; j++)  
        {
            sum += a[j];            
            if (sum == k)
            {
               int l = j - i + 1;
               if (l > max)
                max = l;
            }
        }
    }
    cout << "maximum length of the required subarray is: " << max;
}```
#

is okay now?

opal plinth
#

Should be

upper leaf
#

yeah

#

congrats

robust horizon
#

yay

opal plinth
#

Ok this is just details so I'll give you a version of your code that is functionally equivalent but reads better:

#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int a[7] = {3, 2, 1, 1, 1, 1, 3}, k = 4, maxLength = 0;
    for (int i = 0; i < 7; i++)   
    {
        int sum = 0;
        for (int j = 0; j < 7-i; j++)  
        {
            sum += a[i+j];
            if (sum > k)
            { // optional, to not unnecessarily go to the end of the array
                break;
            }
            if (sum == k)
            {
               maxLength = max(maxLength, j+1);
            }
        }
    }
    cout << "maximum length of the required subarray is: " << maxLength;
}
#

Hopefully I didn't break it

robust horizon
#

i am trying to understand this: for (int j = 0; j < n-i; j++)

#

so

#

we start from 0

#

a[0]

opal plinth
#

I did break it, should've been sum += a[i+j]; (I edited just now)

robust horizon
#

also i did not declare n

#

so it should just be 7 - i

#

bad practice, sorry

opal plinth
#

True

robust horizon
#

i will fix it

#

so

opal plinth
#

You can also use size(a)

robust horizon
#

isn't it sizeof()?

#

or am i wrong

opal plinth
#

No, that would give you the number of bytes

#

int is more than one byte long

robust horizon
#

yes, makes sense

#

anyway

#

well

#

a five-minute break

#

head hurts

opal plinth
#

Sure

#

I'm gonna have to go, so if nobody answers, you can always just close and open a new channel

upper leaf
#

o7

robust horizon
#

for (int j = 0; j < 7-i; j++) does this not do something like this:

#

for i = 0, a[0] + a[1] + ... + a[6]
for i = 1, a[0] + a[1] + ... + a[5]

#

and so on?

upper leaf
#

Its supposed to be j < 7

robust horizon
#

right

#

sorry

#

fixed it

upper leaf
#

Does your code gives correct results now?

#

the next lune should be sum+= a[j]

#

line*

robust horizon
#

they did that before, but then changed it to sum += a[i + j]

upper leaf
#

Well why?

robust horizon
#

i also still do not get how it would be a better solution

upper leaf
#

Oh

robust horizon
#

because contiguous array?

#

or no?

upper leaf
#

Your solution and their given solution is kinda the same

robust horizon
#

yes, they mentioned it is just for better readability

upper leaf
#

Well yeah other than that theres not much improvement

robust horizon
#

okay so now that we have figured this one

#

what would be a better approach for this?

upper leaf
#

Well using hashmap and an algorithm called prefix sum

robust horizon
#

i know prefix sum but i do not see how exactly it helps

upper leaf
#

which will give you a solution for both negative numbers introduction and O(n) runtime

robust horizon
#

what exactly is the functionality of hashmap?

upper leaf
#

Its stores the prefix sums

robust horizon
#

😭

#

right

upper leaf
#

Basically instead of checking every subarray like your code

#

the optimal solution

#

uhm

#

It kinds of remembers the sums idk how to explain it

#

which let the code to not check alot of times and result in better runtime

robust horizon
#

i see, thank you

#

will close the channel now, thanks for the help!

#

.close

final saddleBOT
#
Channel closed

Closed by @robust horizon

Use .reopen if this was a mistake.

robust horizon
#

.reopen

final saddleBOT
#

robust horizon
#

wait

#

why does this not work for negative numbers?

#

like why does it matter at all?

upper leaf
#

negative numbers doe work on your current code but it slows it down alot

robust horizon
#

how so?

upper leaf
#

Because then there will be no early termination and keeping track of the sum is hard since it can now decrease instead of increase

upper leaf
robust horizon
#

yes but does that not mean that if we do not add that condition, like i did not, earlier, it slows the process down for positive numbers too?

#

that is just, bad?

upper leaf
#

Your code works fine for postive integers

#

though there is a better approach but it works

robust horizon
#

why if we do not do sum > k

#

is that not the same thing

upper leaf
#

sum > k strictly prohibits negative numbers

robust horizon
#

yes, exactly

#

i am talking about

upper leaf
#

Well its both O(n²)

robust horizon
#

i do not get how

#

say our array has a thousand elements

upper leaf
#

Yes

robust horizon
#

it sure makes a big difference, no?

upper leaf
#

Yup

robust horizon
#

then why?

robust horizon
#

sorry if that is stupid

#

i am just trying to understand

upper leaf
#

both negative numbers and positive numbers results in the same runtime in your code

robust horizon
#

exactly!

#

that is what i was trying to confirm

upper leaf
#

Now you got it

robust horizon
#

yes, thank you

upper leaf
#

Sorry for the brief confusion lol

#

I keep thinking that the original questions asked for positive numbers only

robust horizon
#

no is okay, it was my bad

#

well, thank you still

#

.close

final saddleBOT
#
Channel closed

Closed by @robust horizon

Use .reopen if this was a mistake.

final saddleBOT
#
Available help channel!

Send your question here to claim the channel.

Remember:
Ask your math question in a clear, concise manner.
Show your work, and if possible, explain where you are stuck.
After 15 minutes, feel free to ping <@&286206848099549185>.
• Type the command .close to free the channel when you're done.
• Be polite and have a nice day!

Read #❓how-to-get-help for further information on how to ask a good question, and about conduct in the question channels.

solar crest
#

why is it that for this question even tho we're just rotating 1 funciton around some axis, we have to use the washers method?? why is it not the disk??

solar crest
#

i thoguht we're just rotating f(x) around the axis so i can just use f(x) - (-2) as the radius and then use the disk method

#

this is the solution, i dont rlly understand

drowsy epoch
solar crest
#

wdym

drowsy epoch
solar crest
#

yea is it not like thar

drowsy epoch
#

You need to remove the -2 distance because else you wouldn't get that hole

solar crest
#

how can i know form the question that theres a hole..?

drowsy epoch
#

You are given a region

solar crest
#

doesnt it just say to rotate f(x) around the line y = -2?

drowsy epoch
#

,, R = {(x,y)\in\R^2 : (0 \le y \le 4-x) \land (0\le x \le 4) }

solar crest
#

OH

#

wait

soft zealotBOT
solar crest
#

is this what they want?? the red part

#

i just saw it says between x axis

#

and f(x)

drowsy epoch
#

yea

solar crest
#

OHHHHHHH

#

im tripping

#

tysm

#

but like

#

if it didbt say region between x axi

#

axis

#

and it just said to rotate f(x) around axis y = - 2

solar crest
drowsy epoch
#

most likely

#

saying rotate f(x) doesn't even make sense

#

you actually need to specify a region

solar crest
#

oh

#

😭

#

okay

#

ty

drowsy epoch
#

you would like

#

rotate a line

solar crest
#

oh

final saddleBOT
#

@solar crest Has your question been resolved?

final saddleBOT
#
Channel closed

Closed due to timeout

Use .reopen if this was a mistake.

final saddleBOT
#
Available help channel!

Send your question here to claim the channel.

Remember:
Ask your math question in a clear, concise manner.
Show your work, and if possible, explain where you are stuck.
After 15 minutes, feel free to ping <@&286206848099549185>.
• Type the command .close to free the channel when you're done.
• Be polite and have a nice day!

Read #❓how-to-get-help for further information on how to ask a good question, and about conduct in the question channels.

urban wasp
#

Solve $log(3y^2-10) to the base 4=2log(y-1)to the base 4+1/2$

soft zealotBOT
urban wasp
#

so i used the power rule

#

$log(3y^2-10)to the base 4=log(y-1)^2 to the base 4 +1/2$

soft zealotBOT
urban wasp
#

cancelled out log to the base 4

#

to get

#

$(3y^2-10)=y^2-2y+1) +1/2$

soft zealotBOT
umbral steppe
#

$\log_{4}(3y^2-10) = 2\log_{4}(y-1) + \frac{1}{2}$
did you mean this?

urban wasp
#

dont know how to proceed

urban wasp
#

yes

soft zealotBOT
tired walrus
#

you tried to do 4^ both sides, right?

urban wasp
#

?

#

no i cancelled out log

tired walrus
#

you can't do that unless you've got JUST log(...) on the left and JUST log(...) on the right

urban wasp
#

i do tho

tired walrus
#

no you dont

#

you got that +1/2 on the right

umbral steppe
#

you still have the 1/2.

tired walrus
#

that thing doesnt just stay as-is yknow

urban wasp
#

oh

tired walrus
#

you need to simplify $2 \log_4(y-1) + \frac12$ into JUST $\log_4(????)$ (with \textbf{nothing} outside the log)

soft zealotBOT
urban wasp
#

well i cant do anything abt it since if i subtract it from the rhs it appears on the lhs

tired walrus
#

you can write $\frac{1}{2}$ as $\log_4(4^{1/2})$

soft zealotBOT
urban wasp
#

oh

#

and then rewrite the rhs as a single logarithm?

tired walrus
#

yes (which i told you to do to begin with)

#

personally i think this alternative is a bit clunkier than simply applying the function 4^x on both sides but like you do you

urban wasp
#

how do u apply 4^x

#

i dont think we've learned that

tired walrus
#

you go from $$\log_4(3y^2-10) = 2 \log_4(y-1) + \frac12$$ to $$4^{\log_4(3y^2-10)} = 4^{2 \log_4(y-1) + \frac12}$$ and simplify from there

soft zealotBOT
tired walrus
#

yknow like, if a=b then 4^a = 4^b, you feel me?

dusty quarry
#

does it, though? (referring to OP's now deleted message)

urban wasp
#

yeah

dusty quarry
#

oh lmao rip message

urban wasp
#

wait

#

do 4^log cancel out?

#

$/4^/log{4}(3y^2-10)$

soft zealotBOT
urban wasp
#

this might be the worst texit message ever generated

#

i need to learn how to use this thing man

tired walrus
#

yes that you do

umbral steppe
#

$b^{\log_b(x)} = x$

soft zealotBOT
tired walrus
#

$4^{\log_4(3y^2-10)}$ does cancel out cleanly to just $3y^2-10$, yes. but on the RHS it is more interesting.

soft zealotBOT
urban wasp
#

$4^/log*{4}(3y^2-10)*$

soft zealotBOT
dusty quarry
#

what's with the forward slashes

urban wasp
urban wasp
#

$4^\log*{4{(3y^2-10)*$

soft zealotBOT
#

Tan
Compile Error! Click the errors reaction for more information.
(You may edit your message to recompile.)

dusty quarry
#

and what's with the *s

urban wasp
#

im making it itallic

dusty quarry
#

you don't have to

urban wasp
umbral steppe
# urban wasp
$\log_{4}(3y^2-10) = 2\log_{4}(y-1) + \frac{1}{2}$
#

those are underscores, and are used to write subscripts in latex.

urban wasp
#

what is a subscript

#

bases?

#

$4_2$

soft zealotBOT
urban wasp
#

YES

umbral steppe
#

bases are not subscripts, but we write bases in subscripts, yes.

urban wasp
#

IM RIGHT FOR ONCE

urban wasp
umbral steppe
#

because I did not escape the underscores, nor did I intend to.

urban wasp
#

can you elaborate

#

i dont understand

umbral steppe
#

?

urban wasp
#

wdym escape the underscores

dusty quarry
urban wasp
#

the underscore

umbral steppe
#

underscores are special characters in discord. you can surround text in one underscore (to either side) to italicize a phrase. surround a text with two to underline it.

urban wasp
#

wait in irl mathematics can we use _ to define subscripts like we use ^ to define exponents

umbral steppe
#

to show surrounding underscores as is, you need to escape them.

urban wasp
#

what

#

oh

#

okay

#

ty

#

but wait

umbral steppe
#

in real life you can write subscripts directly to begin with.

urban wasp
#

but now

#

do i expand (y-1)^2 first?

urban wasp
#

thats why they invented the carrot

#

karat

#

Caret

umbral steppe
#

no. writing superscripts and subscripts properly makes people less confused than spamming _ and ^.

#

plus, the caret was not invented for this purpose, as far as I understand.

urban wasp
#

i see

#

can you help me tho

urban wasp
dusty quarry
#

what is your current step

urban wasp
#

log(3y^2-10)=log(y-1)^2+log4^1/2

#

i wrote 4^1/2 as 2

#

(btw all the bases are 4)

#

and now

#

i want to write the rhs as a single log

#

do i expand (y-1)^2 first or just multiply to get (2y-2)^2 and then expand

umbral steppe
#

I don't see a need to do either. you can directly write the RHS as a single log from here.

urban wasp
#

yes

#

but how

dusty quarry
#

how do you normally simplify log x + log y if they're the same base

urban wasp
#

logxy

#

right?

dusty quarry
#

then do the same thing here.

urban wasp
#

2(y-1)^2?

#

or

#

y^2-2y+1(2)

#

oh okay

#

i got

#

3y^2-10=4y^2-8y+4

#

(after cancelling log)

#

0=y^2-8y+14??

dusty quarry
#

keep going

urban wasp
#

factors of 14:1,2,7,14

#

therefore

#

this question has no solutions

#

wait no the stupid formula

#

uhh

#

,w calculate 64-4(14)

urban wasp
#

i hope wolfram used pemdas

#

okay

#

(8+-8)/2

#

is my final answer

bold turtle
urban wasp
#

log*

bold turtle
#

No, I mean

#

The last message you sent where like three of us responded this, that's correct

#

How did you get from that, to this?

bold turtle
#

Did you misunderstand this to mean you square the 2 as well? (which is incorrect)

urban wasp
#

what

urban wasp
bold turtle
#

No, after cancelling logs it became " 3y^2 - 10 = 2(y-1)^2 "

#

Might I ask for a

#

!xy

final saddleBOT
#

Please show the original problem, exactly as it was stated to you, with the entire original context. A picture or screenshot is best. If the original problem is not in English, then post it anyway! The additional context might still be helpful. Do your best to provide a translation.

umbral steppe
final saddleBOT
#

@urban wasp Has your question been resolved?

urban wasp
#

@bold turtle

bold turtle
#

I mean, show me the source

#

If it's from a book, take a photo

#

If it's online, take a screenshot

urban wasp
#

there is nothing more.

#

its just

#

Solve $\log_{4}(3y^2-10)=2\log_{4}(y-1) + \frac{1}{2}$

soft zealotBOT
urban wasp
bold turtle
urban wasp
#

no

bold turtle
#

$3y^2 - 10 = 2(y-1)^2$

soft zealotBOT
#

Waes (Wires)

urban wasp
#

cuz i heard u cant cancel logs unless the coefficient is 1

urban wasp
#

yes

bold turtle
#

Okay

#

So you've mis-expanded the RHS then

#

How would you expand (y-1)^2?

urban wasp
#

y^2-2y+1

bold turtle
#

Right

#

So now we have two lots of (y-1)^2

#

i.e. 2 (y-1)^2

#

So what's this when expanded?

urban wasp
#

=(2y-2)^2
=4y^2-8y+4

bold turtle
#

No

urban wasp
#

or do u expand first

#

and them multiply by 2

bold turtle
#

You've got a multiplication and a power

#

Which comes first?

urban wasp
#

2y^2-4y+2

bold turtle
#

There we go

urban wasp
bold turtle
#

Okay, so are we going to take those parentheses and square first, or multiply by 2 first?

urban wasp
#

arent they the same thing???

#

simplify them

bold turtle
bold turtle
bold turtle
urban wasp
#

y^2-2y+1

urban wasp
#

y^2-2y+1

bold turtle
#

Okay but that logic is worse than shit I'm gonna be fully honest

#

Because by the same token, "4" is the same as "8" because half of 4 is 2 and a quarter of 8 is 2

urban wasp
#

so is this a super ultra rare case where it just so happens to be that they have the commutative property?

bold turtle
#

?

urban wasp
#

and it wouldnt happen with any other(or few) equations

bold turtle
#

No this is more of an ultra rare case where your algebra needs more revision before continuing with logs ngl

#

2x^2 = 2 times whatever x^2 is; it is not equal to the square of (2x)

urban wasp
#

sometimes i subtract things from the rhs and accidentally add them on the lhs

#

but yeah

#

thanks

bold turtle
#

Honestly at this point that's something you yourself need to practise

#

A person typing on a screen can only go so far to explain those concepts

urban wasp
#

i practice 3 hours a day

bold turtle
#

Practise what

#

I'm talking about basic algebra

urban wasp
#

addition, subtraction,multiplication, and division

bold turtle
#

...That's arithmetic

urban wasp
bold turtle
#

Not algebra

urban wasp
#

isnt arithmetic a sequence of stuff

#

(n-1)(n-2)

#

typa stuff

final saddleBOT
#
Channel closed

Closed due to timeout

Use .reopen if this was a mistake.

bold turtle
#

.reopen

final saddleBOT
#

bold turtle
#

You're thinking of arithmetic sequences (which you haven't described properly)

#

Those are called arithmetic because you're adding/subtracting between consecutive terms

urban wasp
#

so i suck at arithmetic

bold turtle
#

Similarly "geometric" sequences are so called because of having common ratios between consecutive terms

urban wasp
#

no wonder i always get polynomial questions wrong all the time

bold turtle
#

Arithmetic, the gerneral term, just means addition, subtraction, multiplication, division etc.

#

i.e., doing numerical calculations

urban wasp
#

i see

worldly mesa
urban wasp
#

calculators like wolfram can do more than arithmetic right

worldly mesa
#

yeah they can do a lot

urban wasp
#

,w differentiate 3x^2

bold turtle
#

That context is important

worldly mesa
#

yeah

urban wasp
#

,w integral 3x^2

bold turtle
late rose
#

who needs arithmetic skills when you have a calculator /s

bold turtle
#

But what I'm talking about is something that should be taught in elementary/middle school

#

That being said, I'm guessing you're from the US?

urban wasp
urban wasp
bold turtle
#

i.e. the land of no regulations on their maths syllabus so fuxk me if I ever understand what's on their papers

urban wasp
#

for cambridge

late rose
urban wasp
#

bro

late rose
#

without calculator i literally cannot function

urban wasp
#

i have to write 9 PAPERS for chemsitry,biology,and physics

#

🙏

#

3 papers per subject

late rose
#

i mean

#

i also have 3 papers

urban wasp
#

worth like 180/320 marks each

late rose
#

one mcq, one open-ended, one practical

urban wasp
#

okay

#

nvm

#

we are getting derailed

late rose
#

fr

#

have you solved the log question yet?

urban wasp
#

nope

#

but guess what

#

ik someone who can

#

,w solve $\log_{4}(3y^2-10)=2\log_{4}(y-1) + \frac{1}{2}$

#

nevermind

bold turtle
#

,w solve $\log_{4}(3y^2-10)=2\log_{4}(y-1) + \frac{1}{2}$

bold turtle
#

wait a fokken second

dusty quarry
#

just replace all the y with x

bold turtle
#

,w solve for y $\log{4}(3y^2-10)=2\log{4}(y-1) + \frac{1}{2}$

dusty quarry
#

WA loves its exes

bold turtle
#

It's got so many exes

dusty quarry
#

hang on

urban wasp
#

bruh

#

thought this calc was supposed to be smart

late rose
urban wasp
#

cant even do basic exponential equations

#

(just like me fr)

soft zealotBOT
bold turtle
urban wasp
dusty quarry
#

,w solve for y, log_4 (3y^2 - 10) = 2log_4 (y-1) + 1/2

bold turtle
#

There we go

bold turtle
#

Incidentally that's what I got by hand as well

dusty quarry
#

i should have checked your arithmetic

late rose
dusty quarry
bold turtle
#

So, 0, we've already gone through that

dusty quarry
#

anyway, OP, do you agree with WA's answer now

bold turtle
#

We've gone as far as $3y^2 - 10 = 2y^2 - 4y + 2$

soft zealotBOT
#

Waes (Wires)

urban wasp
#

ohhh

#

yeah that

#

i did it alr

#

just need help with basic algebra and arithmetic calculations

dusty quarry
#

cuz help channels are not the place for a crash course in topics

#

but btw OP, just curious. are you above 15 years old?

urban wasp
#

remember when you taught me the laws of square roots

dusty quarry
#

who

urban wasp
#

you

dusty quarry
#

idqr

#

i know another helpee fucked with me using square roots

#

it wasn't you

urban wasp
#

oh

dusty quarry
urban wasp
#

hollup lemme try find it

urban wasp
dusty quarry
#

what

bold turtle
#

,w peer

#

oh ffs

#

,w define peer

bold turtle
#

Sense 1

dusty quarry
#

not exactly sense 1

bold turtle
#

Well, ... okay yh

dusty quarry
#

peer here = same age

urban wasp
#

i got it

dusty quarry
#

oh ok, cool

urban wasp
#

WOLFRAM IS A DICTIONARY TOO?!

#

,w give me 3 synonyms for nice

late rose
#

WHAT